Skip to content

gen:migration & rem:migration ​

Create or remove versioned SQL migration files with Atlas.

goforge gen:migration [name] ​

Requires atlas on PATH.

  1. Runs atlas migrate diff --env gorm --config file://core/database/atlas.hcl <name> to generate a new .sql file in internal/database/migrations/.
  2. Strips backticks (`) and COLLATE ... clauses for cross-driver cleanliness.
  3. Recomputes atlas.sum via atlas migrate hash.
bash
goforge gen:migration create_tasks_table

goforge rem:migration ​

Deletes Latest Migration File Only

goforge rem:migration sorts internal/database/migrations/*.sql lexicographically, deletes the latest .sql file, and re-hashes atlas.sum. It does not execute a SQL DOWN rollback against already-applied database tables.

Released under the Apache-2.0 License.