@@ -34,6 +34,7 @@ public class MigratorConsole
3434 string _migrationsAssembly ;
3535 string _provider ;
3636 bool _trace ;
37+ string _defaultSchema ;
3738
3839 /// <summary>
3940 /// Builds a new console
@@ -118,7 +119,7 @@ public void Dump()
118119 {
119120 CheckArguments ( ) ;
120121
121- var dumper = new SchemaDumper ( _provider , _connectionString ) ;
122+ var dumper = new SchemaDumper ( _provider , _connectionString , _defaultSchema ) ;
122123
123124 dumper . DumpTo ( _dumpTo ) ;
124125 }
@@ -140,6 +141,7 @@ public void PrintUsage()
140141 Console . WriteLine ( "\t {0} {1}" , "migrationAssembly" . PadRight ( tab ) , "Path to the assembly containing the migrations" ) ;
141142 Console . WriteLine ( "Options:" ) ;
142143 Console . WriteLine ( "\t -{0}{1}" , "version NO" . PadRight ( tab ) , "To specific version to migrate the database to" ) ;
144+ Console . WriteLine ( "\t -{0}{1}" , "defaultSchema <schema>" . PadRight ( tab ) , "To specify the default schema" ) ;
143145 Console . WriteLine ( "\t -{0}{1}" , "list" . PadRight ( tab ) , "List migrations" ) ;
144146 Console . WriteLine ( "\t -{0}{1}" , "trace" . PadRight ( tab ) , "Show debug informations" ) ;
145147 Console . WriteLine ( "\t -{0}{1}" , "dump FILE" . PadRight ( tab ) , "Dump the database schema as migration code" ) ;
@@ -161,7 +163,7 @@ Migrator GetMigrator()
161163 {
162164 Assembly asm = Assembly . LoadFrom ( _migrationsAssembly ) ;
163165
164- var migrator = new Migrator ( _provider , _connectionString , asm , _trace ) ;
166+ var migrator = new Migrator ( _provider , _connectionString , _defaultSchema , asm , _trace ) ;
165167 migrator . args = args ;
166168 migrator . DryRun = _dryrun ;
167169 return migrator ;
@@ -188,6 +190,10 @@ void ParseArguments(string[] argv)
188190 _migrateTo = long . Parse ( argv [ i + 1 ] ) ;
189191 i ++ ;
190192 }
193+ else if ( argv [ i ] . EndsWith ( "-defaultSchema" ) )
194+ {
195+ _defaultSchema = argv [ i + 1 ] ;
196+ }
191197 else if ( argv [ i ] . Equals ( "-dump" ) )
192198 {
193199 _dumpTo = argv [ i + 1 ] ;
0 commit comments