#428 #436

Merged
edraft merged 19 commits from #428 into dev 2023-11-15 16:56:32 +01:00
3 changed files with 29 additions and 1 deletions
Showing only changes of commit aec7dac4c7 - Show all commits

View File

@ -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)

View File

@ -0,0 +1,4 @@
DROP TABLE `AutoRoles`;
DROP TABLE `AutoRoleRules`;

View 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`)
);