File-Based Migrations
Microbase tracks applied migrations in the _migrations table and reads .sql / .json files from ./mb_migrations.
# Create a new timestamped SQL migration./microbase migrate create add_posts_index
# Apply pending migrations./microbase migrate up
# Inspect status./microbase migrate status
# Roll back the last migration./microbase migrate down
# Export current schema as a JSON snapshot migration./microbase migrate snapshotSQL Migration Format
Section titled “SQL Migration Format”-- +migrate UpCREATE INDEX IF NOT EXISTS idx_posts_published ON posts (published);
-- +migrate DownDROP INDEX IF EXISTS idx_posts_published;