The command line version of
migra includes a number of options for getting the diff output you desire. If using the API, similarly named options are available on the
Specify a single schema to diff.
Only output create extension statements, nothing else. This is useful when you have extensions as part of a setup script for a single schema: Those extensions need to be installed, but extensions are usually not installed in a custom schema.
You'd generate a setup script in two steps:
- Generate the necessary
create extension if not exists...statements.
- Generate the schema changes with
- Combine the output of
2into a single database sync script.
migra to spit out permission-related change statements (
revoke). This is
False by default: Often one is comparing databases from different environments, where the users and permissions are completely different and not something one would want to sync.