mirror of
https://github.com/bitwarden/server.git
synced 2024-11-22 12:15:36 +01:00
if check on db migration of scriptnames
This commit is contained in:
parent
f4353b598e
commit
934b2c535b
@ -136,9 +136,11 @@ namespace Bit.Setup
|
||||
using(var connection = new SqlConnection(vaultConnectionString))
|
||||
{
|
||||
var command = new SqlCommand(
|
||||
"IF ((SELECT COUNT(1) FROM INFORMATION_SCHEMA.TABLES " +
|
||||
"WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = 'Migration') > 0) " +
|
||||
"UPDATE [dbo].[Migration] " +
|
||||
"SET [ScriptName] = REPLACE([ScriptName], 'Setup.DbScripts.', 'Bit.Setup.DbScripts.') " +
|
||||
"WHERE [ScriptName] LIKE 'Setup.DbScripts.%'",
|
||||
"WHERE [ScriptName] LIKE 'Setup.DbScripts.%';",
|
||||
connection);
|
||||
command.Connection.Open();
|
||||
command.ExecuteNonQuery();
|
||||
|
Loading…
Reference in New Issue
Block a user