Open jefarmstrong opened 2 months ago
I have six migration files that build up the final database structure. The last one runs some SQL to add Default behavior to created_at columns.
def migrate_forward(op, old_orm, new_orm): database = op.obj._database database.execute_sql( """ ALTER TABLE `UserBasicInfo` MODIFY COLUMN `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP; """ ) ......
When i run pem migrate it throws an error peewee.ProgrammingError: (1146, "Table 'db.userbasicinfo' doesn't exist")
pem migrate
peewee.ProgrammingError: (1146, "Table 'db.userbasicinfo' doesn't exist")
If I just run the first 5 migrations, and then add and run the sixth, it works fine.
How do I fix this so that they all work in one migration?
Did you try delete all your migrations files and then run pem watch to create a single migration file with all things? And to avoid errors, truncate the migrationhistory table if exists
pem watch
I have six migration files that build up the final database structure. The last one runs some SQL to add Default behavior to created_at columns.
When i run
pem migrate
it throws an errorpeewee.ProgrammingError: (1146, "Table 'db.userbasicinfo' doesn't exist")
If I just run the first 5 migrations, and then add and run the sixth, it works fine.
How do I fix this so that they all work in one migration?