The next step after setting up the desired target schema is creating a migration script. This is done by invoking the following command:
edgedb [connection-option...] migration create [OPTIONS]
This will start an interactive tool that will provide the user with suggestions based on the differences between the current database and the schema file. The prompts will look something like this:
did you create object type 'default::User'? [y,n,l,c,b,s,q,?] ? y - confirm the prompt, use the DDL statements n - reject the prompt l - list the DDL statements associated with prompt c - list already confirmed EdgeQL statements b - revert back to previous save point, perhaps previous question s - stop and save changes (splits migration into multiple) q - quit without saving changes h or ? - print help
See the Common Connection Options. The
command runs on the database it is connected to.
Directory where the schema files are located. Defaults to
Create a new migration even if there are no changes. This is useful for creating migration stubs for data-only migrations.
Do not prompts user for input. By default this works only if there are only “safe” changes to be done unless --allow-unsafe is also specified.
Apply the most probable unsafe changes in case there are any. This is only useful in non-interactive mode.