Setting up a local development database
When it comes to migrations, there is the advantage of decoupling the programming language that we are using from the migrations. In the past, I have had to switch servers from one language to another and simply wished that the migration’s implementation was not coupled with the language. This is also a deployment issue. For instance, in Kubernetes, deploying a new server or an update might require a migration to be run. Ideally, you want to run the migration automatically through what we call init Pods. This is a container that is spun up and executed before the main server is deployed. This init Pod can perform a database migration command. However, if the init Pod requires something such as Rust to be present to execute the migration, this can greatly increase the size of the init pod. Therefore, I built an open source Bash tool that is only dependent on the psql
and wget
libraries. It can create new migrations and roll the database...