Skip to content
Developer Resources
Database Migration

Database Migration

Changes to Fides could require a change to the database model. This includes scenarios where you want to persist a new field or replace an existing field. Changes made to the Fides databases are done through alembic migration scripts. Migrations can be found in the following directory: src/fides/api/ctl/migrations/versions

To create a new migration we use the alembic revision command:

cd src/fides/api/ctl
alembic revision --autogenerate -m "migration message"

The autogenerated script should be verified and could require some manual changes. Migrations will run on server startup.