edgedb migration create​

The next step after setting up the desired target schema is creating a migration script. This is done by invoking the following command:

  1. edgedb 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:

  1. did you create object type 'default::User'? [y,n,l,c,b,s,q,?]
  2. ?
  3. y - confirm the prompt, use the DDL statements
  4. n - reject the prompt
  5. l - list the DDL statements associated with prompt
  6. c - list already confirmed EdgeQL statements
  7. b - revert back to previous save point, perhaps previous question
  8. s - stop and save changes (splits migration into multiple)
  9. q - quit without saving changes
  10. h or ? - print help

Options​

The migration create command runs on the database it is connected to. For specifying the connection target see connection options.

--non-interactive

Do not prompt user for input. By default this works only if all the changes are “safe” unless —allow-unsafe is also specified.

--allow-unsafe

Apply the most probable unsafe changes in case there are any. This is only useful in non-interactive mode.

--allow-empty

Create a new migration even if there are no changes. This is useful for creating migration stubs for data-only migrations.

--schema-dir=schema-dir

Directory where the schema files are located. Defaults to ./dbschema.