-
Notifications
You must be signed in to change notification settings - Fork 651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POC - Just for discussion - Move all runner code except DB specific dependencies into FluentMigrator.Runner.Core #1198
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,10 +40,6 @@ static int Main(string[] args) | |
var app = new CommandLineApplication(); | ||
|
||
var help = app.HelpOption(); | ||
var mode = app.Option<MigrationMode>( | ||
"-m|--mode <MODE>", | ||
"The mode of the application (legacy or di)", | ||
CommandOptionType.SingleValue); | ||
var processor = app.Option( | ||
"-d|--dialect <DIALECT>", | ||
$"The database dialect ({string.Join(",", DefaultConfigurations.Keys)})", | ||
|
@@ -56,20 +52,8 @@ static int Main(string[] args) | |
app.OnExecute( | ||
() => | ||
{ | ||
var selectedMode = mode.HasValue() ? mode.ParsedValue : MigrationMode.DI; | ||
var dbConfig = CreateDatabaseConfiguration(processor, connectionString); | ||
switch (selectedMode) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gliljas See above. Not clear on why this needs to be removed? I looked at RunInLegacyMode and it doesnt seem to contain any concrete DB driver dependencies? RunWithServices below does, but that should be addressed by creating interfaces and letting people try to register a type if it exists. The downside I see to hot loading types in RunWithServices is that you move away from deps.json auto-resolving the dependency, so you can end up in situations where a developer has upgraded to a newer version of fluentmigrator, but the build ci/deploy cd servers are on older versions, and thus you get a runtime error due to not resolving dependencies. |
||
{ | ||
case MigrationMode.Legacy: | ||
Console.WriteLine(@"Using legacy mode"); | ||
RunInLegacyMode(dbConfig); | ||
break; | ||
case MigrationMode.DI: | ||
Console.WriteLine(@"Using dependency injection"); | ||
RunWithServices(dbConfig); | ||
break; | ||
} | ||
|
||
RunWithServices(dbConfig); | ||
return 0; | ||
}); | ||
|
||
|
@@ -109,11 +93,5 @@ private static DatabaseConfiguration CreateDatabaseConfiguration(CommandOption p | |
|
||
return DefaultDatabaseConfigurations.Sqlite; | ||
} | ||
|
||
private enum MigrationMode | ||
{ | ||
Legacy, | ||
DI, | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gliljas Why is this a pre-requisite to achieving this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I'm not sure. I believe it was just a victim of making things compile, i.e no legacy stuff.