-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename user_batches_new into user_batches_v2, add a note into the tab…
…le description
- Loading branch information
Showing
12 changed files
with
45 additions
and
45 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
-- +migrate Up | ||
|
||
CREATE TABLE IF NOT EXISTS `user_batches_new` ( | ||
CREATE TABLE IF NOT EXISTS `user_batches_v2` ( | ||
`group_prefix` VARCHAR(13) NOT NULL COMMENT 'Authorized (first) part of the full login prefix', | ||
`custom_prefix` VARCHAR(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL | ||
COMMENT 'Second part of the full login prefix, given by the user that created the batch', | ||
`size` MEDIUMINT UNSIGNED NOT NULL COMMENT 'Number of users created in this batch', | ||
`creator_id` BIGINT(20) DEFAULT NULL, | ||
`created_at` DATETIME NOT NULL DEFAULT NOW(), | ||
PRIMARY KEY (`group_prefix`, `custom_prefix`), | ||
CONSTRAINT `ck_user_batches_new_custom_prefix` CHECK (REGEXP_LIKE(`custom_prefix`, '^[a-z0-9-]+$')), | ||
CONSTRAINT `fk_user_batches_new_group_prefix_user_batch_prefixes_group_pref` | ||
CONSTRAINT `ck_user_batches_v2_custom_prefix` CHECK (REGEXP_LIKE(`custom_prefix`, '^[a-z0-9-]+$')), | ||
CONSTRAINT `fk_user_batches_v2_group_prefix_user_batch_prefixes_group_pref` | ||
FOREIGN KEY (`group_prefix`) REFERENCES `user_batch_prefixes`(`group_prefix`) ON DELETE RESTRICT, | ||
CONSTRAINT `fk_user_batches_new_creator_id_users_group_id` | ||
CONSTRAINT `fk_user_batches_v2_creator_id_users_group_id` | ||
FOREIGN KEY (`creator_id`) REFERENCES `users`(`group_id`) ON DELETE SET NULL | ||
) ENGINE=InnoDB CHARSET=utf8 | ||
COMMENT='Batches of users that were created'; | ||
COMMENT='Batches of users that were created (replaces user_batches which has been broken by a MySQL update)'; | ||
|
||
-- +migrate Down | ||
/* we pretend the table was always named `user_batches_new`, so we don't need to drop it */ | ||
/* we pretend the table was always named `user_batches_v2`, so we don't need to drop it */ | ||
; |