Skip to content

Commit

Permalink
Fix failing mssql + mysql migrations (#1213)
Browse files Browse the repository at this point in the history
remove backtick on drop table statements
  • Loading branch information
krbrs authored Jan 2, 2025
1 parent db935d3 commit 9cb88d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Shoko.Server/Databases/MySQL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -908,12 +908,12 @@ public class MySQL : BaseDatabase<MySqlConnection>
new(146, 41, "CREATE UNIQUE INDEX UIX_TMDB_Season_TmdbSeasonID ON TMDB_Season(TmdbSeasonID);"),
new(146, 42, "CREATE INDEX IX_TMDB_Season_TmdbShowID ON TMDB_Season(TmdbShowID);"),
new(146, 43, "CREATE UNIQUE INDEX UIX_TMDB_Network_TmdbNetworkID ON TMDB_Network(TmdbNetworkID);"),
new(147, 01, "DROP TABLE IF EXISTS `AnimeStaff`;"),
new(147, 02, "DROP TABLE IF EXISTS `CrossRef_Anime_Staff`;"),
new(147, 03, "DROP TABLE IF EXISTS `AniDB_Character`;"),
new(147, 04, "DROP TABLE IF EXISTS `AniDB_Anime_Staff`;"),
new(147, 05, "DROP TABLE IF EXISTS `AniDB_Anime_Character`;"),
new(147, 06, "DROP TABLE IF EXISTS `AniDB_Character_Creator`;"),
new(147, 01, "DROP TABLE IF EXISTS AnimeStaff;"),
new(147, 02, "DROP TABLE IF EXISTS CrossRef_Anime_Staff;"),
new(147, 03, "DROP TABLE IF EXISTS AniDB_Character;"),
new(147, 04, "DROP TABLE IF EXISTS AniDB_Anime_Staff;"),
new(147, 05, "DROP TABLE IF EXISTS AniDB_Anime_Character;"),
new(147, 06, "DROP TABLE IF EXISTS AniDB_Character_Creator;"),
// One character's name is 502 characters long, so 512 it is. Blame Gintama.
new(147, 07, "CREATE TABLE `AniDB_Character` (`AniDB_CharacterID` INT NOT NULL AUTO_INCREMENT, `CharacterID` INT NOT NULL, `Name` VARCHAR(512) CHARACTER SET UTF8 NOT NULL, `OriginalName` VARCHAR(512) CHARACTER SET UTF8 NOT NULL, `Description` TEXT CHARACTER SET UTF8 NOT NULL, `ImagePath` VARCHAR(20) CHARACTER SET UTF8 NOT NULL, Gender INT NOT NULL, PRIMARY KEY (`AniDB_CharacterID`));"),
new(147, 08, "CREATE TABLE `AniDB_Anime_Staff` (`AniDB_Anime_StaffID` INT NOT NULL AUTO_INCREMENT, `AnimeID` INT NOT NULL, `CreatorID` INT NOT NULL, `Role` VARCHAR(64) CHARACTER SET UTF8 NOT NULL, `RoleType` INT NOT NULL, `Ordering` INT NOT NULL, PRIMARY KEY (`AniDB_Anime_StaffID`));"),
Expand Down
12 changes: 6 additions & 6 deletions Shoko.Server/Databases/SQLServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -857,12 +857,12 @@ public override bool HasVersionsTable()
new DatabaseCommand(139, 41, "CREATE UNIQUE INDEX UIX_TMDB_Season_TmdbSeasonID ON TMDB_Season(TmdbSeasonID);"),
new DatabaseCommand(139, 42, "CREATE INDEX IX_TMDB_Season_TmdbShowID ON TMDB_Season(TmdbShowID);"),
new DatabaseCommand(139, 43, "CREATE UNIQUE INDEX UIX_TMDB_Network_TmdbNetworkID ON TMDB_Network(TmdbNetworkID);"),
new DatabaseCommand(140, 01, "DROP TABLE IF EXISTS `AnimeStaff`;"),
new DatabaseCommand(140, 02, "DROP TABLE IF EXISTS `CrossRef_Anime_Staff`;"),
new DatabaseCommand(140, 03, "DROP TABLE IF EXISTS `AniDB_Character`;"),
new DatabaseCommand(140, 04, "DROP TABLE IF EXISTS `AniDB_Anime_Staff`;"),
new DatabaseCommand(140, 05, "DROP TABLE IF EXISTS `AniDB_Anime_Character`;"),
new DatabaseCommand(140, 06, "DROP TABLE IF EXISTS `AniDB_Character_Creator`;"),
new DatabaseCommand(140, 01, "DROP TABLE IF EXISTS AnimeStaff;"),
new DatabaseCommand(140, 02, "DROP TABLE IF EXISTS CrossRef_Anime_Staff;"),
new DatabaseCommand(140, 03, "DROP TABLE IF EXISTS AniDB_Character;"),
new DatabaseCommand(140, 04, "DROP TABLE IF EXISTS AniDB_Anime_Staff;"),
new DatabaseCommand(140, 05, "DROP TABLE IF EXISTS AniDB_Anime_Character;"),
new DatabaseCommand(140, 06, "DROP TABLE IF EXISTS AniDB_Character_Creator;"),
// One character's name is 502 characters long, so 512 it is. Blame Gintama.
new DatabaseCommand(140, 07, "CREATE TABLE AniDB_Character (AniDB_CharacterID INT IDENTITY(1,1), CharacterID INT NOT NULL, Name NVARCHAR(512) NOT NULL, OriginalName NVARCHAR(512) NOT NULL, Description TEXT NOT NULL, ImagePath NVARCHAR(20) NOT NULL, Gender INT NOT NULL);"),
new DatabaseCommand(140, 08, "CREATE TABLE AniDB_Anime_Staff (AniDB_Anime_StaffID INT IDENTITY(1,1), AnimeID INT NOT NULL, CreatorID INT NOT NULL, Role NVARCHAR(64) NOT NULL, RoleType INT NOT NULL, Ordering INT NOT NULL);"),
Expand Down

0 comments on commit 9cb88d9

Please sign in to comment.