node-migrate icon indicating copy to clipboard operation
node-migrate copied to clipboard

create table, index/primary_key breaking

Open brihogan opened this issue 14 years ago • 1 comments

If you create a table and then set an index for a row that doesn't exist, the migration will fail. The table will still be in the DB but you will not be able to rollback. If you change the index to a legit name and re-migrate you'll get an error that says that that table is already in use.

I can make the problem work by starting the migration with: this.drop_table('table_name');

But, it seems like .drop_table should either be part of .create_table or the migrate shouldn't keep the table when an error occurs. The later would probably be ideal.

Thanks again for a great module.

brihogan avatar Feb 27 '11 22:02 brihogan

Let me take a look into this and the other issue you raised. Thanks for finding them!

rsandor avatar Feb 28 '11 10:02 rsandor