Product articles Database Dependencies

Managing PostgreSQL Extensions Using Flyway

Any reliable DevOps deployment process must not only deliver the right database code but also ensure that the correct conditions exist for the deployment to succeed. For PostgreSQL databases, this includes ensuring that any extensions on which the database code relies are installed, and at the correct version. Fortunately, Flyway will automatically track which extensions are installed on a database and at what version, so we can 'propagate' these changes accurately during deployments and avoid inconsistencies in database behavior and even application breakages. Read more

Undoing Actions on Groups of Database Tables

During development you'll occasionally need an undo script that drops a group of tables, or you might need to truncate a group of tables and then insert fresh data in order to run some tests. Unless you perform the required actions in the correct dependency order, you'll be tripped up by foreign key constraint violations. This article provides a SQL function that returns the list of tables in the correct dependency order. Read more

Checking for Missing Module References in a SQL Server Database Using Flyway

There are certain checks that need to be done after a database migration is complete. One good example of this is the check that a migration script, such as one that merges changes from a branch into main, doesn't cause 'invalid objects' (a.k.a. 'missing references') in your databases. I'll show you how to run this check, using sp_RefreshSQLModule, and incorporate it into a Flyway "after" migration script. Read more