sql-migrate icon indicating copy to clipboard operation
sql-migrate copied to clipboard

sql-migrate status fails if old migration file not found

Open dtelyukh opened this issue 9 years ago • 1 comments

  1. sql-migrate up
  2. remove sql-file
  3. sql-migrate status
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x10 pc=0x40b6be]

goroutine 1 [running]:
panic(0x8b2dc0, 0xc820010140)
        /usr/local/go/src/runtime/panic.go:481 +0x3e6
main.(*StatusCommand).Run(0xe65b08, 0xc82000a590, 0x0, 0x0, 0x9e0490)
        /home/d.telyukh/go/src/github.com/rubenv/sql-migrate/sql-migrate/command_status.go:86 +0x8be
github.com/mitchellh/cli.(*CLI).Run(0xc8203fa000, 0xc82001c450, 0x0, 0x0)
        /home/d.telyukh/go/src/github.com/mitchellh/cli/cli.go:154 +0x56e
main.realMain(0xc820000180)
        /home/d.telyukh/go/src/github.com/rubenv/sql-migrate/sql-migrate/main.go:39 +0x39e
main.main()
        /home/d.telyukh/go/src/github.com/rubenv/sql-migrate/sql-migrate/main.go:11 +0x18

dtelyukh avatar Sep 16 '16 10:09 dtelyukh

And sql-migrate up doesn't apply any new migrations when old files not found.

dtelyukh avatar Sep 16 '16 10:09 dtelyukh