The Neuronen Schmiede concerns itself with topics related to software development. One focus are robust web applications.

Use SQL for Database Migrations


Ruby on Rails, Hanami and Sequel offer tooling to manage database schemas. The syntax between the respective migration files is similar but not identical.

These differences cause mental overhead as soon as work happens in multiple projects that use different technologies.

Instead of a custom Ruby syntax the migration files should be written in plain SQL. The code to run them are simple bash scripts which are wrapped by the respective command line interfaces.

The advantages of this approach are vast. Writing migrations is the same for every technology. In the first paragraph only Ruby is mentioned, but SQL migrations work in every programming language and environment.

Autonomy from specific technologies makes it also easier to use features specific to a database without having to rely on support from another tool.

Are you using plain SQL migrations? If not, what is holding you back?