rubenv / sql-migrate

SQL schema migration tool for Go.
MIT License
3.18k stars 273 forks source link

Could not parse config: No environment: development #123

Closed martin-flower closed 5 years ago

martin-flower commented 5 years ago

I don't understand why I get the following error - is go caching or ignoring the environment variable?

host:dbMigrations martin$ sql-migrate up -env=localdocker
Applied 25 migrations
host:dbMigrations martin$ sql-migrate down 1 -env=localdocker
Could not parse config: No environment: development

dbconfig.yml:

localdocker:
    dialect: postgres
    datasource: dbname=postgres port=5432 user=routesroot sslmode=disable
    dir: migrations

If I rename localdockerto development everything works .. ..

risentveber commented 5 years ago

@martin-flower this is because of 1. You should use -limit=1

martin-flower commented 5 years ago

So the correct syntax is:

host:dbMigrations martin$ sql-migrate down -limit=1 -env=localdocker

rubenv commented 5 years ago

@risentveber Thanks for helping out!