diff --git a/src/EFCore.Jet/Migrations/JetMigrationsSqlGenerator.cs b/src/EFCore.Jet/Migrations/JetMigrationsSqlGenerator.cs index 114e216..0d5b379 100644 --- a/src/EFCore.Jet/Migrations/JetMigrationsSqlGenerator.cs +++ b/src/EFCore.Jet/Migrations/JetMigrationsSqlGenerator.cs @@ -454,13 +454,13 @@ namespace Microsoft.EntityFrameworkCore.Migrations builder .Append("CREATE DATABASE ") - .Append(Dependencies.SqlGenerationHelper.DelimitIdentifier(operation.Name)); + .Append(_stringTypeMapping.GenerateSqlLiteral(operation.Name)); if (!string.IsNullOrEmpty(operation.Password)) { builder .Append(" PASSWORD ") - .Append(Dependencies.SqlGenerationHelper.DelimitIdentifier(operation.Password)); + .Append(_stringTypeMapping.GenerateSqlLiteral(operation.Password)); } builder @@ -508,7 +508,7 @@ namespace Microsoft.EntityFrameworkCore.Migrations builder .Append("DROP DATABASE ") //.Append(ExpandFileName(operation.Name)) - .Append(Dependencies.SqlGenerationHelper.DelimitIdentifier(operation.Name)) + .Append(_stringTypeMapping.GenerateSqlLiteral(operation.Name)) .AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator) .EndCommand(suppressTransaction: true); } diff --git a/test/EFCore.Jet.FunctionalTests/JetMigrationsSqlGeneratorTest.cs b/test/EFCore.Jet.FunctionalTests/JetMigrationsSqlGeneratorTest.cs index ea7bc1c..443ec44 100644 --- a/test/EFCore.Jet.FunctionalTests/JetMigrationsSqlGeneratorTest.cs +++ b/test/EFCore.Jet.FunctionalTests/JetMigrationsSqlGeneratorTest.cs @@ -386,7 +386,7 @@ ALTER TABLE `Person` ALTER COLUMN [Id] bigint NOT NULL; new JetCreateDatabaseOperation { Name = "Northwind" }); AssertSql( - @"CREATE DATABASE `Northwind`; + @"CREATE DATABASE 'Northwind'; "); } @@ -511,7 +511,7 @@ ALTER TABLE `Person` ALTER COLUMN [Id] bigint NOT NULL; new JetDropDatabaseOperation { Name = "Northwind" }); AssertSql( - @"DROP DATABASE `Northwind`; + @"DROP DATABASE 'Northwind'; "); }