Petrus Theron
Petrus Theron

Reputation: 28837

Generate initial database migration script from existing schema

I have a huge pre-existing database that I'd like to bring under version control using Migrator.NET for migration scripts and I don't like keeping the MDF file around just for the existing schema.

How can I generate an initial migration script (Migration class) for Migrator.NET from the existing schema that I can use to build the schema from scratch and use incremental builds onwards?

Upvotes: 2

Views: 740

Answers (1)

Fergus Bown
Fergus Bown

Reputation: 1696

According to this link http://code.google.com/p/migratordotnet/wiki/WritingMigrations you can do this:

Migrator.Console.exe SqlServer "Server=localhost\SQLEXPRESS;Database=DB;Trusted_Connection?=True" MyMigrations.dll -dump "c:\temp\dump.cs"

Upvotes: 1

Related Questions