Back to Goose

SQL migrations only

examples/sql-migrations/README.md

3.27.1769 B
Original Source

SQL migrations only

See this example for Go migrations.

bash
$ go install github.com/pressly/goose/v3/cmd/goose@latest
bash
$ goose sqlite3 ./foo.db status
    Applied At                  Migration
    =======================================
    Pending                  -- 00001_create_users_table.sql
    Pending                  -- 00002_rename_root.sql

$ goose sqlite3 ./foo.db up
OK    00001_create_users_table.sql
OK    00002_rename_root.sql
goose: no migrations to run. current version: 2

$ goose sqlite3 ./foo.db status
    Applied At                  Migration
    =======================================
    Mon Jun 19 21:56:00 2017 -- 00001_create_users_table.sql
    Mon Jun 19 21:56:00 2017 -- 00002_rename_root.sql