我进行了一次迁移,创建了一个包含 2 列的表。运行迁移并且它有效。但我意识到我希望其中一列是不同的数据类型。我在我的数据库中删除了表,更改了迁移并再次运行它并且没有创建表?我尝试使用change()
和create()
问问题
61 次
1 回答
0
you need to create a new migration to change columns, don't do that in the old migration, because when you run a migration a new row will be inserted in phinxlog table, and if you try migrate again , phinx will check on phinxlog table what migration has been executed, so deleting table is not enough, you need to delete the inserted row in phinxlog. but it will be good if you create a new migration.
于 2020-08-27T07:54:07.443 回答