mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 00:52:49 -05:00
Fix sql scripts
This commit is contained in:
@ -64,7 +64,30 @@ public class RerunableSqlTableJournal : SqlTableJournal
|
|||||||
|
|
||||||
protected override string GetJournalEntriesSql()
|
protected override string GetJournalEntriesSql()
|
||||||
{
|
{
|
||||||
return $"select [ScriptName] from {FqSchemaTableName} where [Rerunable] = 0 order by [ScriptName]";
|
return @$"DECLARE @columnVariable AS NVARCHAR(max)
|
||||||
|
DECLARE @SQLString AS NVARCHAR(max)
|
||||||
|
|
||||||
|
|
||||||
|
SELECT @columnVariable =
|
||||||
|
CASE WHEN EXISTS
|
||||||
|
(
|
||||||
|
SELECT 1 FROM sys.columns WHERE Name = N'Rerunable' AND Object_ID = Object_ID(N'dbo.Migration')
|
||||||
|
)
|
||||||
|
THEN
|
||||||
|
(
|
||||||
|
'where [Rerunable] = 0'
|
||||||
|
)
|
||||||
|
ELSE
|
||||||
|
('')
|
||||||
|
END
|
||||||
|
|
||||||
|
PRINT @columnVariable
|
||||||
|
|
||||||
|
SET @SQLString = N'select [ScriptName] from dbo.Migration ' + @columnVariable + ' order by [ScriptName]'
|
||||||
|
|
||||||
|
PRINT @SQLString
|
||||||
|
|
||||||
|
EXECUTE sp_executesql @SQLString";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string CreateSchemaTableSql(string quotedPrimaryKeyName)
|
protected override string CreateSchemaTableSql(string quotedPrimaryKeyName)
|
||||||
|
Reference in New Issue
Block a user