![]() Several orders of magnitude faster than traditional backups and restores. Especially for larger data volumes, this can be Technology of your underlying storage solution. Optimal performance, and if your infrastructure supports this, we recommend using the snapshot Of the database structure, and once it is tested and proven to work, no migration script can break it. This should be complemented with a proper, well tested, backup and restore strategy. The old version of the application is still compatible with the DB, so youĬan simply roll back the application code, investigate, and take corrective measures. This way aįailed migration is not a disaster. In contrast, undo migrations are written to undo an entire versioned migration and will notĪn alternative approach which we find preferable is to maintain backwards compatibilityīetween the DB and all versions of the code currently deployed in production. It is possible for the 1st, the 5th, the 7th or the 10th to fail. Migrations on databases without DDL transactions. Undo migrations assume the whole migration succeeded and should now be undone. You end up creating home-made alternatives for restoring backups, which need to be properly tested as well. You have destructive changes (drop, delete, truncate, …), you start getting into trouble. While the idea of undo migrations is nice, unfortunately it sometimes breaks down in practice. Undo migrations are optional and not required to run regular versioned migrations.įor the example above, this is how the undo migration would look like:ĭELETE FROM brand WHERE name = 'DeLorean' ALTER TABLE owner DROP driver_license_id DROP TABLE car Important Notes Of the versioned migration with the same version. An undo migration is responsible for undoing the effects Undo migrations are the opposite of regular versioned migrations. Versions are sorted numerically as you would normally expect. Versioned migrations are applied in the order of their versions. However Flyway is quite flexible andĪll these versions are valid versioned migration versions: For most cases a simple increasing integer should be all you need. Any version is valid as long as it conforms to the usualĭotted notation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |