Tools For Better Developers

Osm Admin

Previously known as The Big Red Button project.

A package for defining application data structures and logic using PHP 8 classes and attributes, pressing the big red button (it's also the project codename), and getting fully functioning Admin Panel and API.

Osm Admin: Adding Explicit Properties. Data Conversions

2022 April Osm Admin

2 weeks 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: Schema Migrations In Development Vs Production

2022 April Osm Admin

1 month 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.