staging #447

Merged
edraft merged 56 commits from staging into master 2023-12-02 19:34:25 +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`)
);