Added automatic permissions migration for more renamed customreaction commands

This commit is contained in:
Kwoth
2022-01-10 15:58:12 +01:00
parent b044eb2d9a
commit 73901158ab
2 changed files with 13 additions and 1 deletions

View File

@@ -53,10 +53,21 @@ namespace NadekoBot.Migrations
migrationBuilder.Sql(@"UPDATE Permissions migrationBuilder.Sql(@"UPDATE Permissions
SET SecondaryTargetName='ACTUALEXPRESSIONS' SET SecondaryTargetName='ACTUALEXPRESSIONS'
WHERE SecondaryTargetName='ActualCustomReactions' COLLATE NOCASE;"); WHERE SecondaryTargetName='ActualCustomReactions' COLLATE NOCASE;");
migrationBuilder.Sql(@"UPDATE Permissions migrationBuilder.Sql(@"UPDATE Permissions
SET SecondaryTargetName='EXPRESSIONS' SET SecondaryTargetName='EXPRESSIONS'
WHERE SecondaryTargetName='CustomReactions' COLLATE NOCASE;"); WHERE SecondaryTargetName='CustomReactions' COLLATE NOCASE;");
migrationBuilder.Sql(@"UPDATE Permissions
SET SecondaryTargetName= case lower(SecondaryTargetName)
WHEN 'editcustreact' THEN 'expredit'
WHEN 'delcustreact' THEN 'exprdel'
WHEN 'listcustreact' THEN 'exprlist'
WHEN 'addcustreact' THEN 'expradd'
WHEN 'showcustreact' THEN 'exprshow'
ELSE SecondaryTargetName
END
WHERE lower(SecondaryTargetName) in ('editcustreact', 'delcustreact', 'listcustreact', 'addcustreact', 'showcustreact');");
} }
protected override void Down(MigrationBuilder migrationBuilder) protected override void Down(MigrationBuilder migrationBuilder)

View File

@@ -1256,6 +1256,7 @@ expredit:
- expredit - expredit
- exe - exe
- exedit - exedit
- ecr
exprsimport: exprsimport:
- eximport - eximport
exprsexport: exprsexport: