|
| 1 | +CREATE TABLE IF NOT EXISTS `drafts_draft` ( |
| 2 | + `id` int(11) NOT NULL, |
| 3 | + `created_at` datetime(6) NOT NULL, |
| 4 | + `updated_at` datetime(6) NOT NULL, |
| 5 | + `username` varchar(255) NOT NULL, |
| 6 | + `origin_repo_id` varchar(36) NOT NULL, |
| 7 | + `origin_file_version` varchar(100) NOT NULL, |
| 8 | + `draft_file_path` varchar(1024) NOT NULL, |
| 9 | + `origin_file_uuid` char(32) NOT NULL, |
| 10 | + `publish_file_version` varchar(100) DEFAULT NULL, |
| 11 | + `status` varchar(20) NOT NULL, |
| 12 | + PRIMARY KEY (`id`), |
| 13 | + KEY `drafts_draft_origin_file_uuid_id_f150319e_fk_tags_file` (`origin_file_uuid`), |
| 14 | + KEY `drafts_draft_created_at_e9f4523f` (`created_at`), |
| 15 | + KEY `drafts_draft_updated_at_0a144b05` (`updated_at`), |
| 16 | + KEY `drafts_draft_username_73e6738b` (`username`) |
| 17 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 18 | + |
| 19 | +CREATE TABLE IF NOT EXISTS `drafts_draftreviewer` ( |
| 20 | + `id` int(11) NOT NULL, |
| 21 | + `reviewer` varchar(255) NOT NULL, |
| 22 | + `draft_id` int(11) NOT NULL, |
| 23 | + PRIMARY KEY (`id`), |
| 24 | + KEY `drafts_draftreviewer_reviewer_e4c777ac` (`reviewer`), |
| 25 | + KEY `drafts_draftreviewer_draft_id_4ea59775_fk_drafts_draft_id` (`draft_id`), |
| 26 | + CONSTRAINT `drafts_draftreviewer_draft_id_4ea59775_fk_drafts_draft_id` FOREIGN KEY (`draft_id`) REFERENCES `drafts_draft` (`id`) |
| 27 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 28 | + |
| 29 | +ALTER TABLE `options_useroptions` ADD INDEX `options_useroptions_option_key_7bf7ae4b` (`option_key`); |
| 30 | + |
| 31 | +ALTER TABLE TotalStorageStat DROP primary key; |
| 32 | +ALTER TABLE TotalStorageStat ADD `id` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST; |
| 33 | +ALTER TABLE TotalStorageStat ADD `org_id` INT NOT NULL DEFAULT -1; |
| 34 | +ALTER TABLE TotalStorageStat ADD INDEX `idx_storage_time_org` (`timestamp`, `org_id`); |
| 35 | + |
| 36 | +ALTER TABLE FileOpsStat ADD `org_id` INT NOT NULL DEFAULT -1; |
| 37 | +ALTER TABLE FileOpsStat ADD INDEX `idx_file_ops_time_org` (`timestamp`, `org_id`); |
| 38 | + |
| 39 | +ALTER TABLE UserActivityStat DROP primary key; |
| 40 | +ALTER TABLE UserActivityStat ADD `id` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST; |
| 41 | +ALTER TABLE UserActivityStat ADD UNIQUE (name_time_md5); |
| 42 | +ALTER TABLE UserActivityStat ADD `org_id` INT NOT NULL DEFAULT -1; |
| 43 | +ALTER TABLE UserActivityStat ADD INDEX `idx_activity_time_org` (`timestamp`, `org_id`); |
| 44 | + |
| 45 | +DROP TABLE UserTrafficStat; |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | +CREATE TABLE IF NOT EXISTS `repo_tags_repotags` ( |
| 50 | + `id` int(11) NOT NULL AUTO_INCREMENT, |
| 51 | + `repo_id` varchar(36) NOT NULL, |
| 52 | + `name` varchar(255) NOT NULL, |
| 53 | + `color` varchar(255) NOT NULL, |
| 54 | + PRIMARY KEY (`id`), |
| 55 | + KEY `repo_tags_repotags_repo_id_1163a48f` (`repo_id`), |
| 56 | + KEY `repo_tags_repotags_name_3f4c9027` (`name`), |
| 57 | + KEY `repo_tags_repotags_color_1292b6c1` (`color`) |
| 58 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +CREATE TABLE IF NOT EXISTS `file_tags_filetags` ( |
| 63 | + `id` int(11) NOT NULL AUTO_INCREMENT, |
| 64 | + `file_uuid_id` char(32) NOT NULL, |
| 65 | + `repo_tag_id` int(11) NOT NULL, |
| 66 | + PRIMARY KEY (`id`), |
| 67 | + KEY `file_tags_filetags_file_uuid_id_e30f0ec8_fk_tags_file` (`file_uuid_id`), |
| 68 | + KEY `file_tags_filetags_repo_tag_id_c39660cb_fk_repo_tags_repotags_id` (`repo_tag_id`), |
| 69 | + CONSTRAINT `file_tags_filetags_file_uuid_id_e30f0ec8_fk_tags_file` FOREIGN KEY (`file_uuid_id`) REFERENCES `tags_fileuuidmap` (`uuid`), |
| 70 | + CONSTRAINT `file_tags_filetags_repo_tag_id_c39660cb_fk_repo_tags_repotags_id` FOREIGN KEY (`repo_tag_id`) REFERENCES `repo_tags_repotags` (`id`) |
| 71 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | +CREATE TABLE IF NOT EXISTS `related_files_relatedfiles` ( |
| 76 | + `id` int(11) NOT NULL AUTO_INCREMENT, |
| 77 | + `o_uuid_id` char(32) NOT NULL, |
| 78 | + `r_uuid_id` char(32) NOT NULL, |
| 79 | + PRIMARY KEY (`id`), |
| 80 | + KEY `related_files_relate_o_uuid_id_aaa8e613_fk_tags_file` (`o_uuid_id`), |
| 81 | + KEY `related_files_relate_r_uuid_id_031751df_fk_tags_file` (`r_uuid_id`), |
| 82 | + CONSTRAINT `related_files_relate_o_uuid_id_aaa8e613_fk_tags_file` FOREIGN KEY (`o_uuid_id`) REFERENCES `tags_fileuuidmap` (`uuid`), |
| 83 | + CONSTRAINT `related_files_relate_r_uuid_id_031751df_fk_tags_file` FOREIGN KEY (`r_uuid_id`) REFERENCES `tags_fileuuidmap` (`uuid`) |
| 84 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | +CREATE TABLE IF NOT EXISTS `organizations_orgsettings` ( |
| 89 | + `id` int(11) NOT NULL AUTO_INCREMENT, |
| 90 | + `org_id` int(11) NOT NULL, |
| 91 | + `role` varchar(100) DEFAULT NULL, |
| 92 | + PRIMARY KEY (`id`), |
| 93 | + UNIQUE KEY `organizations_orgsettings_org_id_630f6843_uniq` (`org_id`) |
| 94 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 95 | + |
| 96 | +DROP INDEX `profile_profile_contact_email_0975e4bf_uniq` ON `profile_profile`; |
| 97 | +ALTER TABLE `profile_profile` ADD CONSTRAINT `profile_profile_contact_email_0975e4bf_uniq` UNIQUE (`contact_email`); |
| 98 | + |
| 99 | +CREATE TABLE IF NOT EXISTS `social_auth_usersocialauth` ( |
| 100 | + `id` int(11) NOT NULL AUTO_INCREMENT, |
| 101 | + `username` varchar(255) NOT NULL, |
| 102 | + `provider` varchar(32) NOT NULL, |
| 103 | + `uid` varchar(150) NOT NULL, |
| 104 | + `extra_data` longtext NOT NULL, |
| 105 | + PRIMARY KEY (`id`), |
| 106 | + UNIQUE KEY `social_auth_usersocialauth_provider_uid_e6b5e668_uniq` (`provider`,`uid`), |
| 107 | + KEY `social_auth_usersocialauth_username_3f06b5cf` (`username`) |
| 108 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | +ALTER TABLE `base_filecomment` ADD `detail` LONGTEXT DEFAULT NULL; |
| 113 | +ALTER TABLE `base_filecomment` ADD `resolved` TINYINT(1) NOT NULL DEFAULT 0; |
| 114 | +ALTER TABLE `base_filecomment` ADD INDEX `resolved` (`resolved`); |
0 commit comments