Hmm, thats not a bad idea. I was however thinking of adding that functionality into Migrator. I found the SchemaDumper class and tried it out and I noticed it created a migration but all the types were strings.
I think I can get that working by getting the DATA_TYPE and COLUMN_DEFAULT values (this is sqlserver specific); however, a question comes up in how to create the column. It looks like column constructors take a DbType parameter, so basically I need to take a string i.e. "uniqueidentifier" and turn that into a DbType value. Is there anything in the code base that does this already? I have been poking around the source and have found the typenames class that takes DbTypes and turns them into strings, I need to go the other way. Also, once I get the types worked out, I need to add foreign key constraints to it. If I can get it all working I will submit a patch to you if you are interested, although it may just be for sql server. :D Thanks, Joe On Aug 28, 6:50 am, Geoffrey Lane <[email protected]> wrote: > There's not anything like that really. > One thing you can do is export your schema using a database specific > tool and then use ExecuteQuery on that schema (directly in code as a > string or read in from another file) as your first migration. > > On Aug 27, 2009, at 11:06 AM, Joe wrote: > > > > > Is there there a way to export a schema for an existing database so > > that migrations may then be used? > > > Basically what I want to do is create one (the initial) migration for > > the existing database and then be able add additional migrations to > > handle the schema changes. > > > Joe > > -- > Geoff Lane <[email protected]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "migratordotnet-devel" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/migratordotnet-devel?hl=en -~----------~----~----~----~------~----~------~--~---
