I have a 2 months old DB & I want to fetch new Schema for that DB without deleting the data in it using ALTER
statements. Is it possible?
Currently I am taking a backup of table data of Old DB in some temporary DB & then replacing the Old DB with the new one & Inserting the backup data from the temporary DB. What could be the best solution to migrate the Schema?
Best Answer
I would write something like this, and first run in on the new database - to get the migration code, and then running resulting migration code on the old database - to alter the schema.
It's just a part to add missing columns and not complete. You should also check for is_identity, constraints, other data types and etc.
Maybe there is a complete code in the internet...
Result - migration code: