You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Connected.Framework/Connected.Data/Schema/Sql/SchemaSynchronize.cs

20 lines
446 B

namespace Connected.Data.Schema.Sql
{
internal class SchemaSynchronize : SynchronizationTransaction
{
protected override async Task OnExecute()
{
if (string.IsNullOrWhiteSpace(Context.Schema.Schema))
return;
if (!await new SchemaExists(Context.Schema.Schema).Execute(Context))
await CreateSchema();
}
private async Task CreateSchema()
{
await Context.Execute($"CREATE SCHEMA {Context.Schema.Schema};");
}
}
}