rubenv / sql-migrate

SQL schema migration tool for Go.
MIT License
3.2k stars 275 forks source link

Migration not applied #224

Closed fahmifan closed 2 years ago

fahmifan commented 2 years ago

So, i create two migration file using sql-migrate new <name>. Then I run the sql-migrate up -env=postgres with this config

postgres:
  dialect: postgres
  datasource: dbname=dbname sslmode=disable user=user password=pass
  dir: db/migrations
  table: migrations

I check table migrations and the all migrations file is added there. But only the first migration script that actually executed. There is also no error reported, when I try running the migration script directly to postgres, it works.

How to debug this? Thanks

[Update] So, the previous one is using v1.2.0 Then, I try downgrade it into v1.1.2 and it worked. Not sure what cause the bug tho

[Update] So, the bug actually on my migration script, I accidentally added a space before -- +migrate Up, So it looks like this

 -- +migrate Up
crate table ...