I have two tables: A and B. Both tables are filled with data.
Table A contain column: col. I want to move col with data from table A to table B. After all I want to drop col from table A. Should I write raw sql to copy data or there are method to copy data.
Your migration will need to add col
to B, then use raw SQL to update B from A, then drop col
from A.
AddColumn("B", "col", c => c...);
Sql("update B set col = ...");
DropColumn("A", "col");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With