Table renamed but old table remains
Hi all. I renamed a table from automobiles to cars like this:
But now in the database I have both tables instead of one being renamed to the other. What would be the correct way to delete the postgres table without messing anything up?
7 Replies
Delete the generated migration contents that creates a new table and replace its contents with a command to rename the table
I messed up and already pushed it to github and to my live server 🙁 obviously this is my bad..
Can I make a new migration to just drop that table?
Yep!
But you probably want to get the data to the table right?
So you could drop the new empty table and then rename the old one to the new one
I dont care about that data, this time 😄
How would I properly create this kind of "one of a kind" migration in Ash properly? I am worried about messing up generators in the future.
Solution
mix ecto.gen.migration
gets you a one-off migrationthank you very much
it wont mess up anything with Ash and the way it tracks things for
codegen
?Nope