Fix bug in new Migration to support PostgreSQL

This commit is contained in:
Charles Nurse
2021-04-08 14:58:02 -07:00
parent 8c45b7e42f
commit a0329b1b6c
2 changed files with 10 additions and 1 deletions

View File

@ -53,8 +53,12 @@ namespace Oqtane.Migrations
} }
//Version 2.1.0 //Version 2.1.0
var appVersions = RewriteName("AppVersions");
var version = RewriteName("Version");
var appledDate = RewriteName("AppliedDate");
migrationBuilder.Sql($@" migrationBuilder.Sql($@"
INSERT INTO AppVersions(Version, AppliedDate) INSERT INTO {appVersions}({version}, {appledDate})
VALUES('02.01.00', '{DateTime.UtcNow:u}') VALUES('02.01.00', '{DateTime.UtcNow:u}')
"); ");
} }

View File

@ -15,5 +15,10 @@ namespace Oqtane.Migrations
} }
protected IOqtaneDatabase ActiveDatabase => _databases.FirstOrDefault(d => d.Provider == ActiveProvider); protected IOqtaneDatabase ActiveDatabase => _databases.FirstOrDefault(d => d.Provider == ActiveProvider);
protected string RewriteName(string name)
{
return ActiveDatabase.RewriteName(name);
}
} }
} }