revert to use our stringtypemapping to generate the sql literal. Some regex depends on using this format to pick the filename from the connection string

pull/131/head
Christopher Jolly 3 years ago
parent d100231ce9
commit 81f6cbb254

@ -454,13 +454,13 @@ namespace Microsoft.EntityFrameworkCore.Migrations
builder builder
.Append("CREATE DATABASE ") .Append("CREATE DATABASE ")
.Append(Dependencies.SqlGenerationHelper.DelimitIdentifier(operation.Name)); .Append(_stringTypeMapping.GenerateSqlLiteral(operation.Name));
if (!string.IsNullOrEmpty(operation.Password)) if (!string.IsNullOrEmpty(operation.Password))
{ {
builder builder
.Append(" PASSWORD ") .Append(" PASSWORD ")
.Append(Dependencies.SqlGenerationHelper.DelimitIdentifier(operation.Password)); .Append(_stringTypeMapping.GenerateSqlLiteral(operation.Password));
} }
builder builder
@ -508,7 +508,7 @@ namespace Microsoft.EntityFrameworkCore.Migrations
builder builder
.Append("DROP DATABASE ") .Append("DROP DATABASE ")
//.Append(ExpandFileName(operation.Name)) //.Append(ExpandFileName(operation.Name))
.Append(Dependencies.SqlGenerationHelper.DelimitIdentifier(operation.Name)) .Append(_stringTypeMapping.GenerateSqlLiteral(operation.Name))
.AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator) .AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator)
.EndCommand(suppressTransaction: true); .EndCommand(suppressTransaction: true);
} }

@ -386,7 +386,7 @@ ALTER TABLE `Person` ALTER COLUMN [Id] bigint NOT NULL;
new JetCreateDatabaseOperation { Name = "Northwind" }); new JetCreateDatabaseOperation { Name = "Northwind" });
AssertSql( AssertSql(
@"CREATE DATABASE `Northwind`; @"CREATE DATABASE 'Northwind';
"); ");
} }
@ -511,7 +511,7 @@ ALTER TABLE `Person` ALTER COLUMN [Id] bigint NOT NULL;
new JetDropDatabaseOperation { Name = "Northwind" }); new JetDropDatabaseOperation { Name = "Northwind" });
AssertSql( AssertSql(
@"DROP DATABASE `Northwind`; @"DROP DATABASE 'Northwind';
"); ");
} }

Loading…
Cancel
Save