Added 0.2.2 migration scripts #428
This commit is contained in:
parent
407ec08463
commit
aec7dac4c7
@ -4,7 +4,7 @@ from bot_data.db_context import DBContext
|
||||
|
||||
|
||||
class AutoRoleMigration(MigrationABC):
|
||||
name = "0.2.1_AutoRoleMigration"
|
||||
name = "0.2.2_AutoRoleMigration"
|
||||
|
||||
def __init__(self, logger: DatabaseLogger, db: DBContext):
|
||||
MigrationABC.__init__(self)
|
||||
|
4
bot/src/bot_data/scripts/0.2.2/AutoRole_down.sql
Normal file
4
bot/src/bot_data/scripts/0.2.2/AutoRole_down.sql
Normal file
@ -0,0 +1,4 @@
|
||||
DROP TABLE `AutoRoles`;
|
||||
|
||||
DROP TABLE `AutoRoleRules`;
|
||||
|
24
bot/src/bot_data/scripts/0.2.2/AutoRole_up.sql
Normal file
24
bot/src/bot_data/scripts/0.2.2/AutoRole_up.sql
Normal file
@ -0,0 +1,24 @@
|
||||
CREATE TABLE IF NOT EXISTS `AutoRoles`
|
||||
(
|
||||
`AutoRoleId` BIGINT NOT NULL AUTO_INCREMENT,
|
||||
`ServerId` BIGINT,
|
||||
`DiscordMessageId` BIGINT NOT NULL,
|
||||
`CreatedAt` DATETIME(6),
|
||||
`LastModifiedAt` DATETIME(6),
|
||||
PRIMARY KEY (`AutoRoleId`),
|
||||
FOREIGN KEY (`ServerId`) REFERENCES `Servers` (`ServerId`)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `AutoRoleRules`
|
||||
(
|
||||
`AutoRoleRuleId` BIGINT NOT NULL AUTO_INCREMENT,
|
||||
`AutoRoleId` BIGINT,
|
||||
`DiscordEmojiName` VARCHAR(64),
|
||||
`DiscordRoleId` BIGINT NOT NULL,
|
||||
`CreatedAt` DATETIME(6),
|
||||
`LastModifiedAt` DATETIME(6),
|
||||
PRIMARY KEY (`AutoRoleRuleId`),
|
||||
FOREIGN KEY (`AutoRoleId`) REFERENCES `AutoRoles` (`AutoRoleId`)
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user