0

I had a migration that created a table with 2 columns. Ran the migration and it worked. But I realised I would like one of the columns to be a different data type. I dropped the table in my db, changed the migration and ran it again and the table isn't created ? I tried using change() and create()

Puck
  • 2,080
  • 4
  • 19
  • 30
TiernO
  • 427
  • 6
  • 20

1 Answers1

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.

cc-dev
  • 7
  • 5