Skip to content

Commit

Permalink
Added support to default schema name for VersionInfo table
Browse files Browse the repository at this point in the history
  • Loading branch information
Alegrowin committed Jul 3, 2018
1 parent e82aafa commit 79d15ba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/FluentMigrator.DotNet.Cli/Commands/MigrationCommand.cs
Expand Up @@ -46,5 +46,8 @@ public class MigrationCommand : BaseCommand

[Option("-b|--allow-breaking-changes", Description = "Allows execution of migrations marked as breaking changes.")]
public bool AllowBreakingChanges { get; }

[Option("--default-schema-name", Description = "Set default Schema Name for VersionInfo table")]
public string SchemaName { get; internal set; } = null;
}
}
2 changes: 2 additions & 0 deletions src/FluentMigrator.DotNet.Cli/MigratorOptions.cs
Expand Up @@ -56,6 +56,7 @@ private MigratorOptions(string task)
public bool Output { get; private set; }
public string OutputFileName { get; private set; }
public bool AllowBreakingChanges { get; private set; }
public string SchemaName { get; private set; }

public static MigratorOptions CreateListMigrations(ListMigrations cmd)
{
Expand Down Expand Up @@ -138,6 +139,7 @@ private MigratorOptions Init(MigrationCommand cmd)
WorkingDirectory = cmd.WorkingDirectory;
Tags = cmd.Tags?.ToList() ?? new List<string>();
AllowBreakingChanges = cmd.AllowBreakingChanges;
SchemaName = cmd.SchemaName;
return this;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/FluentMigrator.DotNet.Cli/Setup.cs
Expand Up @@ -44,7 +44,7 @@ public static IServiceProvider BuildServiceProvider(MigratorOptions options, ICo

private static IServiceProvider ConfigureServices(IServiceCollection services, MigratorOptions options, IConsole console)
{
var conventionSet = new DefaultConventionSet(defaultSchemaName: null, options.WorkingDirectory);
var conventionSet = new DefaultConventionSet(defaultSchemaName: options.SchemaName, options.WorkingDirectory);

var targetIsSqlServer = !string.IsNullOrEmpty(options.ProcessorType)
&& options.ProcessorType.StartsWith("sqlserver", StringComparison.OrdinalIgnoreCase);
Expand Down

0 comments on commit 79d15ba

Please sign in to comment.