diff --git a/model/DBHelper.cs b/model/DBHelper.cs index a5c6b050..7a522b62 100644 --- a/model/DBHelper.cs +++ b/model/DBHelper.cs @@ -63,13 +63,13 @@ public static void CreateDb(string connection, string databaseFilesPath = null) if (databaseFilesPath != null) { Directory.CreateDirectory(databaseFilesPath); files = $@"ON -(NAME = {dbName}, +(NAME = '{dbName}', FILENAME = '{databaseFilesPath}\{dbName + Guid.NewGuid()}.mdf') LOG ON -(NAME = {dbName}_log, +(NAME = '{dbName}_log', FILENAME = '{databaseFilesPath}\{dbName + Guid.NewGuid()}.ldf')"; } - ExecSql(cnBuilder.ToString(), "CREATE DATABASE [" + dbName + "]" + files); + ExecSql(cnBuilder.ToString(), "CREATE DATABASE [" + dbName + "] " + files); } public static bool DbExists(string conn) { diff --git a/model/Models/Column.cs b/model/Models/Column.cs index ce0d1126..a4391dd6 100644 --- a/model/Models/Column.cs +++ b/model/Models/Column.cs @@ -57,7 +57,7 @@ public string IdentityText { } } - public string RowGuidColText => IsRowGuidCol ? "ROWGUIDCOL" : string.Empty; + public string RowGuidColText => IsRowGuidCol ? " ROWGUIDCOL " : string.Empty; public ColumnDiff Compare(Column c) { return new ColumnDiff(this, c); @@ -98,7 +98,7 @@ private string ScriptBase(bool includeDefaultConstraint) { val.Append($" {IsNullableText}"); if (includeDefaultConstraint) val.Append(DefaultText); if (Identity != null) val.Append(IdentityText); - if (IsRowGuidCol) val.Append(@" {RowGuidColText}"); + if (IsRowGuidCol) val.Append(RowGuidColText); return val.ToString(); case "binary":