【发布时间】:2022-07-07 12:25:28
【问题描述】:
我有以下 down 脚本,名为 000001_init_schema.down.sql
DROP TABLE IF EXISTS entries;
DROP TABLE IF EXISTS transfers;
DROP TABLE IF EXISTS accounts;
当我跑步时
migrate -path db/migrations --database "postgresql://root:secret@localhost:5432/accountsdb?sslmode=disable" -verbose down
▶ make migratedown
migrate -path db/migrations --database "postgresql://root:secret@localhost:5432/accountsdb?sslmode=disable" -verbose down
2022/02/12 21:43:19 Are you sure you want to apply all down migrations? [y/N]
y
2022/02/12 21:43:21 Applying all down migrations
2022/02/12 21:43:21 no change
2022/02/12 21:43:21 Finished after 2.242449209s
2022/02/12 21:43:21 Closing source and database
没有任何变化。
这是为什么呢?
我对应的up 脚本按预期工作。
【问题讨论】:
-
错字,已修复!
标签: postgresql go golang-migrate