Tools For Better Developers

2022 April Posts

Osm Admin: Adding Explicit Properties. Data Conversions

2022 April Osm Admin

7 months ago ∙ 4 minutes read

This time, I tackled adding an explicit property to an existing table, and then making it non-nullable.

It raised the need for data conversions - additional handling of the existing data - or otherwise, the database engine fails, or the data becomes invalid.

And it made me split migrations in two parts - the one that runs before the data conversion, and the other one that runs afterwards.

Osm Admin: Logging

2022 April Osm Admin

7 months ago ∙ 2 minutes read

After a system update, I've got some problem with my laptop, and one thing to check was system log files.

This got me thinking: what makes a good log for my own application? And I think that application logs are as useful as they are able to answer potential questions I may have when an application is in production.

Let's think what kind of questions I might have, and what information might be useful to answer them.

Osm Admin: Schema Migrations In Development Vs Production

2022 April Osm Admin

7 months ago ∙ 2 minutes read

Schema migrations are going to be generated and executed automatically under gulp watch. It will result in lots of tiny migrations: add a column, change its type, make it not nullable, and so on.

It's convenient during development, but it might be not optimal to reapply in production. Indeed, it's better to convert a large table to new structure all at once rather than running a conversion for each of the tiny migration.

This observation contradicts the previously stated migration workflow, so let's update it.