Beginner
Beginner

Reputation: 710

How to reflect local database changes to TEST environment database in entityframework database first

I have a MVC4 + EntityFramework Database First application. I have made some changes in my local database (added table and columns in couple of tables). After this I updated my .edmx file and ran the custom tool. This has updated my models of the table whose schema i have changed. Everything is working fine.

I want to know, How to reflect those local database changes on my Test database?

Upvotes: 1

Views: 275

Answers (4)

Endi Zhupani
Endi Zhupani

Reputation: 736

I suggest you have a look at xSQL Schema Compare. It's a great tool for comparing and synchronizing database schemas. It should do the trick in your case. Also, this comes bundled with xSQL Data Compare which you can use to compare and synchronize the data as well, should the need to do so arise.

Upvotes: 0

objectNotFound
objectNotFound

Reputation: 1783

Try SQL Server Data Tools for Visual studio :

https://msdn.microsoft.com/en-us/mt186501.aspx

Very easy and intuitive to use for Schema comparison and generating delta scripts.

Upvotes: 0

Nkosi
Nkosi

Reputation: 247561

Within VS you can compare the two databases and generate a change script that will bring them on par with each other.

In your case you want to do a schema compare.

Tools -> SQL Server -> New Schema Comparison.

You select your local database and then select the test database. it will compare the schema of both and show you the differences. You can select which you want to apply and either apply it directly or generate a change script and execute when you want from SSMS.

Compare and Synchronize Database Schemas

Upvotes: 1

Ingenioushax
Ingenioushax

Reputation: 718

In SQL Server Management Studio you can export the database script to drop and recreate the tables, indexes, relationships, etc... You can also use Visual Studio to export the SQL script to create all the tables. The other way is to manually add the updated columns. I'm unsure of any other ways to do this in a database first approach.

Upvotes: 0

Related Questions