Restore of database is comparing to first version of database
swkuhn
Posts: 4 New member
Using Sql Automation in VS 2017 connected to VSTS Git and SQL 2017.
We've updated to Sql Automation. About the same time we updated from Readyroll to SQL Automation I backed up a dev database from Sql 2008 R2 and restored to SQL 2017 on a different dev server. The restore went fine and compares exactly with the db on Sql 2008 R1. SQL Automation connected to the new instance of SQL Server 2017 just fine.
The problem is that SQL Automation wants to update all db tables to the "Original Version" of the tables. Many tables have been identified as needing updated to a now incorrect old definition of the tables. I've confirmed that the files in the Shema-Model folder are correct. However, the baseline definition is the one being used for the Refresh compare, which is not correct. The current version in source control should be used in the case that I restored the database from a backup on one server to another server.
How to I convince SQL Automation to use the current version of the db for Refresh compare instead of the "Original Version"?
We've updated to Sql Automation. About the same time we updated from Readyroll to SQL Automation I backed up a dev database from Sql 2008 R2 and restored to SQL 2017 on a different dev server. The restore went fine and compares exactly with the db on Sql 2008 R1. SQL Automation connected to the new instance of SQL Server 2017 just fine.
The problem is that SQL Automation wants to update all db tables to the "Original Version" of the tables. Many tables have been identified as needing updated to a now incorrect old definition of the tables. I've confirmed that the files in the Shema-Model folder are correct. However, the baseline definition is the one being used for the Refresh compare, which is not correct. The current version in source control should be used in the case that I restored the database from a backup on one server to another server.
How to I convince SQL Automation to use the current version of the db for Refresh compare instead of the "Original Version"?
Tagged:
Answers
What I really want to do is use the target database as my golden database to compare against source control and import from and update source control. This was the case when my database was on the other sql server. It just worked. Refresh would tell me what tables changed and I could import and generate a migration script.
But now it is trying to do the reverse, update my target database to a very old version of the database. Something has gone very wrong.
I haven't gotten in this situation, and not sure I can recreate it. Haven't had time today, but perhaps I can try to upgrade an old project and see what happens.