Migration file format reference¶
Table of contents
Introduction¶
The config V3
migrations files generated by the CLI are pure SQL files.
Note
For config v2
, see Migration file format reference (config v2).
Migration directory format¶
Each migration is stored inside a directory, which has the following structure:
<version>_<name>/{up|down}.sql
A version
which is the Unix timestamp in nanoseconds when the migration was
created is the first part of the name of the directory. Followed by a name
which is either manually added
or auto-generated by the console. The files inside this directory indicates what step this is.
up.sql
file is supposed to have forward step(s), e.g. creating a table.
The down.sql
file should include the corresponding rollback step.