Migrations are the result of changes to your database models.
drorm, migrations are represented by an agreed-upon declarative format
using TOML as file format.
These files can be generated by the
You can also take a look at the more in-depth introduction to the file format if you want to explore more options.
Why file based migrations?
Some ORMs choose to use an auto-migrator that tries to check the current state of the database scheme and modifies it, until it matches with its model declaration.
In the beginning this sounds like a smart idea.
- there are no random files lying around.
- your app is able to apply migrations on startup
but there are some drawbacks to this method:
- magic applied by the auto-migrator is difficult to understand
- reversing changes back to a defined state is impossible
- no easy way to insert arbitrary sql, that should be executed once