-
Hello, I'm a big fan of GRDB and we use it in our app. I have a question involving how to rename a column that is currently used as part of a foreign key. In v1 of our migrations, we have a table and it has a foreign key declaration that looks like this:
In a later migration, I want to rename the "accountId" column. Renaming a column is easy, but now any references using the FK will break. Is there a simple way to do this that I am missing? Or will this require creating a temp table, copying the data, dropping the old table and then renaming the temp table? Thanks in advance for any help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello @cimp8504, You're about to recreate the table indeed. Follow closely the technique described in the Migrations guide, "Advanced Database Schema Changes" chapter, in order to talk to SQLite in a proper way. |
Beta Was this translation helpful? Give feedback.
Hello @cimp8504,
You're about to recreate the table indeed. Follow closely the technique described in the Migrations guide, "Advanced Database Schema Changes" chapter, in order to talk to SQLite in a proper way.