1
votes

I'm using Vapor 3 for some server-side Swift, with the Fluent add-in for handling database/model management, with MySQL underneath.

I'm working in development and wanted to force the migrator to recreate a table, so I went into mysql on the command line and did:

mysql> drop table SomeTableName;

However, re-running, the migration doesn't re-create the table. It has a zillion columns and lots of constraints, so I don't really want to do it manually.

1

1 Answers

3
votes

If you look in the table called fluent in your database you will see a record with the name of the table. Delete this record and vapor will re-create the table the next time you run the app.

Like this:

mysql> drop table SomeTableName;
mysql> delete from fluent where name ='SomeTableName';