Skip to content

migrate & loader ​

Apply database migrations or inspect the GORM SQL DDL schema.

goforge migrate ​

Reads DB_MIGRATOR from .env (defaults to atlas):

  • atlas: Runs atlas migrate apply --env gorm --config file://core/database/atlas.hcl with database environment variables injected.
  • gorm: Runs gormDB.AutoMigrate(services.Model()...).

You can also run the built-in app binary command directly (recommended in Docker/CI where goforge-cli is not installed):

bash
go run ./app migrate
# Or with a compiled binary:
./goforge migrate

goforge loader ​

Outputs the SQL DDL generated from services.Model() via ariga.io/atlas-provider-gorm/gormschema:

bash
goforge loader
# Or via the app binary (used by core/database/atlas.hcl):
go run ./app/main.go loader

Production Builds (-tags prod)

core/console/db_loader.go is guarded by //go:build !prod, so loader and atlas-provider-gorm are excluded from production binaries.

Released under the Apache-2.0 License.