forked from Desenvolvimento-de-Software/mslovelace_bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Desenvolvimento-de-Software#15 from mleandrojr/master
Commands refactor.
- Loading branch information
Showing
40 changed files
with
1,487 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
CREATE TABLE `ada`.`federations` ( | ||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
`user_id` int(10) unsigned NOT NULL, | ||
`hash` varchar(32) NOT NULL, | ||
`description` varchar(100) DEFAULT NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE KEY `idx_hash` (`hash`), | ||
KEY `fk_federations_user_id_idx` (`user_id`), | ||
CONSTRAINT `fk_federations_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION | ||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 | ||
|
||
ALTER TABLE `ada`.`chats` | ||
ADD COLUMN `federation_id` INT UNSIGNED NULL AFTER `id`, | ||
ADD INDEX `idx_federation_id` (`federation_id` ASC) VISIBLE; | ||
|
||
ALTER TABLE `ada`.`chats` | ||
ADD CONSTRAINT `fk_chats_federation_id` | ||
FOREIGN KEY (`federation_id`) | ||
REFERENCES `ada`.`federations` (`id`) | ||
ON DELETE NO ACTION | ||
ON UPDATE NO ACTION; | ||
|
||
ALTER TABLE `ada`.`bans` | ||
ADD COLUMN `federation_id` INT UNSIGNED NULL AFTER `chat_id`, | ||
ADD INDEX `fk_bans_federation_id_idx` (`federation_id` ASC) VISIBLE; | ||
|
||
ALTER TABLE `ada`.`bans` | ||
ADD CONSTRAINT `fk_bans_federation_id` | ||
FOREIGN KEY (`federation_id`) | ||
REFERENCES `ada`.`federations` (`id`) | ||
ON DELETE NO ACTION | ||
ON UPDATE NO ACTION; | ||
|
||
CREATE TABLE `ada`.`rel_users_federations` ( | ||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | ||
`user_id` INT UNSIGNED NOT NULL, | ||
`federation_id` INT UNSIGNED NOT NULL, | ||
`date` INT UNSIGNED NOT NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE INDEX `idx_uq_user_id_federation_id` (`user_id` ASC, `federation_id` ASC) VISIBLE, | ||
INDEX `fk_rel_users_federations_federation_id_idx` (`federation_id` ASC) VISIBLE, | ||
CONSTRAINT `fk_rel_users_federations_user_id` | ||
FOREIGN KEY (`user_id`) | ||
REFERENCES `ada`.`users` (`id`) | ||
ON DELETE NO ACTION | ||
ON UPDATE NO ACTION, | ||
CONSTRAINT `fk_rel_users_federations_federation_id` | ||
FOREIGN KEY (`federation_id`) | ||
REFERENCES `ada`.`federations` (`id`) | ||
ON DELETE NO ACTION | ||
ON UPDATE NO ACTION); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
CREATE TABLE `ada`.`bans` ( | ||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | ||
`user_id` INT UNSIGNED NOT NULL, | ||
`chat_id` INT UNSIGNED NOT NULL, | ||
`reason` VARCHAR(50) NULL, | ||
`date` INT UNSIGNED NOT NULL, | ||
PRIMARY KEY (`id`), | ||
INDEX `idx_user_id_chat_id` (`chat_id` ASC, `user_id` ASC) VISIBLE, | ||
INDEX `fk_bans_user_id_idx` (`user_id` ASC) VISIBLE, | ||
CONSTRAINT `fk_bans_user_id` | ||
FOREIGN KEY (`user_id`) | ||
REFERENCES `ada`.`users` (`id`) | ||
ON DELETE NO ACTION | ||
ON UPDATE NO ACTION, | ||
CONSTRAINT `fk_bans_chat_id` | ||
FOREIGN KEY (`chat_id`) | ||
REFERENCES `ada`.`chats` (`id`) | ||
ON DELETE NO ACTION | ||
ON UPDATE NO ACTION); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.