mirror of
https://github.com/bitwarden/server
synced 2025-12-06 00:03:34 +00:00
[PM-14818] Update migrate.ps1 to support test database used by integration tests (#4912)
* Check for correct database in an old MySql migration * Update `migrate.ps1` to support integration test databases
This commit is contained in:
@@ -74,13 +74,13 @@ public partial class GrantIdWithIndexes : Migration
|
||||
|
||||
migrationBuilder.Sql(@"
|
||||
DROP PROCEDURE IF EXISTS GrantSchemaChange;
|
||||
|
||||
|
||||
CREATE PROCEDURE GrantSchemaChange()
|
||||
BEGIN
|
||||
IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Grant' AND COLUMN_NAME = 'Id') THEN
|
||||
IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Grant' AND COLUMN_NAME = 'Id' AND TABLE_SCHEMA=database()) THEN
|
||||
ALTER TABLE `Grant` DROP COLUMN `Id`;
|
||||
END IF;
|
||||
|
||||
|
||||
ALTER TABLE `Grant` ADD COLUMN `Id` INT AUTO_INCREMENT UNIQUE;
|
||||
END;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user