move logic for inserting migrations history from MigrateableModuleBase to MigrationUtils

This commit is contained in:
Shaun Walker
2021-05-31 16:17:06 -04:00
parent 4576f056d5
commit b76e8498d7
3 changed files with 11 additions and 9 deletions

View File

@ -38,5 +38,14 @@ namespace Oqtane.Migrations.Framework
.ToString();
}
// only used in upgrade scenarios for modules that used SQL scripts originally
public static string BuildInsertScript(string MigrationId)
{
var query = "IF NOT EXISTS(SELECT 1 FROM __EFMigrationsHistory WHERE MigrationId = '" + MigrationId + "') ";
query += "INSERT INTO __EFMigrationsHistory(MigrationId, ProductVersion, AppliedDate, AppliedVersion) ";
query += "VALUES('" + MigrationId + "', '5.0.0', SYSDATETIME(), '" + Constants.Version + "')";
return query;
}
}
}