Migration file format reference

Introduction

The config V3 migrations files generated by the CLI are pure SQL files.

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.