Create Migration Files

Bytebase will observe file changes in the configured VCS connector. The files must meet the following requirements.

Path

Files must be under the immediate directory of the specified base directory. As the example below, if the base directory is bytebase, then only bytebase/100_create_t1.sql will be observed by Bytebase.

activity

File name

  • The default file name is <<version>>_<<description>> such as 202401010000_create_hello_table.sql. The migration version, 202401010000, dictates the sequence of changes. The version must be all numeric characters. create_hello_table succinctly describes the purpose of the change.
  • For DML change, append dml after the version, like so: 202401010000_dml_create_hello_table.sql.
  • For gh-ost online DDL change, append ghost after the version, like so: 202401010000_ghost_create_hello_table.sql.
Edit this page on GitHub

Subscribe to Newsletter

By subscribing, you agree with Bytebase's Terms of Service and Privacy Policy.