Reset DB evolution script by play2
- Remove all previous db evloution script - Regenerate evloution for maria/mysql db by play framework
@8ff03648decac74734a66ed4c6bcd8ce59e126f2
--- conf/evolutions/default/1.sql
+++ conf/evolutions/default/1.sql
... | ... | @@ -1,413 +1,757 @@ |
1 |
-# --- !Ups |
|
2 |
- |
|
1 |
+# --- Created by Ebean DDL |
|
2 |
+# To stop Ebean DDL generation, remove this comment and start using Evolutions |
|
3 |
+ |
|
4 |
+# --- !Ups |
|
5 |
+ |
|
3 | 6 |
create table assignee ( |
4 |
- id bigint not null, |
|
7 |
+ id bigint auto_increment not null, |
|
5 | 8 |
user_id bigint, |
6 | 9 |
project_id bigint, |
7 | 10 |
constraint pk_assignee primary key (id)) |
8 | 11 |
; |
9 | 12 |
|
10 | 13 |
create table attachment ( |
11 |
- id bigint not null, |
|
14 |
+ id bigint auto_increment not null, |
|
12 | 15 |
name varchar(255), |
13 | 16 |
hash varchar(255), |
14 |
- project_id bigint, |
|
15 |
- container_type varchar(15), |
|
17 |
+ container_type varchar(20), |
|
16 | 18 |
mime_type varchar(255), |
17 | 19 |
size bigint, |
18 |
- container_id bigint, |
|
19 |
- constraint ck_attachment_container_type check (container_type in ('ISSUE_POST','ISSUE_COMMENT','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_NOTICE','ISSUE_LABEL','BOARD_POST','BOARD_COMMENT','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT')), |
|
20 |
+ container_id varchar(255), |
|
21 |
+ created_date datetime, |
|
22 |
+ constraint ck_attachment_container_type check (container_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK','COMMIT_COMMENT','PULL_REQUEST','COMMIT','COMMENT_THREAD','REVIEW_COMMENT','ORGANIZATION','PROJECT_TRANSFER','ISSUE_LABEL_CATEGORY','WEBHOOK','NOT_A_RESOURCE')), |
|
20 | 23 |
constraint pk_attachment primary key (id)) |
21 | 24 |
; |
22 | 25 |
|
23 |
-create table card ( |
|
24 |
- id bigint not null, |
|
25 |
- title varchar(255), |
|
26 |
- checklist_id bigint, |
|
27 |
- line_id bigint, |
|
28 |
- story_point integer, |
|
29 |
- body varchar(255), |
|
30 |
- due_date timestamp, |
|
31 |
- constraint pk_card primary key (id)) |
|
32 |
-; |
|
33 |
- |
|
34 |
-create table card_assignee ( |
|
35 |
- id bigint not null, |
|
36 |
- card_id bigint, |
|
37 |
- project_user_id bigint, |
|
38 |
- constraint pk_card_assignee primary key (id)) |
|
39 |
-; |
|
40 |
- |
|
41 |
-create table card_label ( |
|
42 |
- id bigint not null, |
|
43 |
- card_id bigint, |
|
44 |
- label_id bigint, |
|
45 |
- constraint pk_card_label primary key (id)) |
|
46 |
-; |
|
47 |
- |
|
48 |
-create table checklist ( |
|
49 |
- id bigint not null, |
|
50 |
- title varchar(255), |
|
51 |
- constraint pk_checklist primary key (id)) |
|
52 |
-; |
|
53 |
- |
|
54 |
-create table comment ( |
|
55 |
- id bigint not null, |
|
56 |
- contents varchar(4000), |
|
57 |
- date timestamp, |
|
58 |
- file_path varchar(255), |
|
26 |
+create table comment_thread ( |
|
27 |
+ dtype varchar(10) not null, |
|
28 |
+ id bigint auto_increment not null, |
|
59 | 29 |
author_id bigint, |
60 | 30 |
author_login_id varchar(255), |
61 | 31 |
author_name varchar(255), |
62 |
- post_id bigint, |
|
63 |
- constraint pk_comment primary key (id)) |
|
32 |
+ state varchar(6), |
|
33 |
+ created_date datetime, |
|
34 |
+ pull_request_id bigint, |
|
35 |
+ project_id bigint, |
|
36 |
+ prev_commit_id varchar(255), |
|
37 |
+ commit_id varchar(255), |
|
38 |
+ path varchar(255), |
|
39 |
+ start_side varchar(1), |
|
40 |
+ start_line integer, |
|
41 |
+ start_column integer, |
|
42 |
+ end_side varchar(1), |
|
43 |
+ end_line integer, |
|
44 |
+ end_column integer, |
|
45 |
+ constraint ck_comment_thread_state check (state in ('OPEN','CLOSED')), |
|
46 |
+ constraint ck_comment_thread_start_side check (start_side in ('A','B')), |
|
47 |
+ constraint ck_comment_thread_end_side check (end_side in ('A','B')), |
|
48 |
+ constraint pk_comment_thread primary key (id)) |
|
49 |
+; |
|
50 |
+ |
|
51 |
+create table commit_comment ( |
|
52 |
+ id bigint auto_increment not null, |
|
53 |
+ project_id bigint, |
|
54 |
+ path varchar(255), |
|
55 |
+ line integer, |
|
56 |
+ side varchar(1), |
|
57 |
+ contents longtext, |
|
58 |
+ created_date datetime, |
|
59 |
+ author_id bigint, |
|
60 |
+ author_login_id varchar(255), |
|
61 |
+ author_name varchar(255), |
|
62 |
+ commit_id varchar(255), |
|
63 |
+ constraint ck_commit_comment_side check (side in ('A','B')), |
|
64 |
+ constraint pk_commit_comment primary key (id)) |
|
65 |
+; |
|
66 |
+ |
|
67 |
+create table email ( |
|
68 |
+ id bigint auto_increment not null, |
|
69 |
+ user_id bigint, |
|
70 |
+ email varchar(255), |
|
71 |
+ valid tinyint(1) default 0, |
|
72 |
+ token varchar(255), |
|
73 |
+ constraint pk_email primary key (id)) |
|
64 | 74 |
; |
65 | 75 |
|
66 | 76 |
create table issue ( |
67 |
- id bigint not null, |
|
77 |
+ id bigint auto_increment not null, |
|
68 | 78 |
title varchar(255), |
69 |
- body clob, |
|
70 |
- date timestamp, |
|
71 |
- num_of_comments integer, |
|
72 |
- milestone_id bigint, |
|
79 |
+ body longtext, |
|
80 |
+ created_date datetime, |
|
81 |
+ updated_date datetime, |
|
73 | 82 |
author_id bigint, |
74 | 83 |
author_login_id varchar(255), |
75 | 84 |
author_name varchar(255), |
76 |
- state integer, |
|
77 | 85 |
project_id bigint, |
86 |
+ number bigint, |
|
87 |
+ num_of_comments integer, |
|
88 |
+ state integer, |
|
89 |
+ due_date datetime, |
|
90 |
+ milestone_id bigint, |
|
78 | 91 |
assignee_id bigint, |
79 |
- constraint ck_issue_state check (state in (0,1,2)), |
|
92 |
+ constraint ck_issue_state check (state in (0,1,2,3,4,5,6)), |
|
93 |
+ constraint uq_issue_1 unique (project_id,number), |
|
80 | 94 |
constraint pk_issue primary key (id)) |
81 | 95 |
; |
82 | 96 |
|
83 | 97 |
create table issue_comment ( |
84 |
- id bigint not null, |
|
85 |
- contents varchar(4000), |
|
86 |
- date timestamp, |
|
98 |
+ id bigint auto_increment not null, |
|
99 |
+ contents longtext, |
|
100 |
+ created_date datetime, |
|
87 | 101 |
author_id bigint, |
88 | 102 |
author_login_id varchar(255), |
89 | 103 |
author_name varchar(255), |
90 |
- file_path varchar(255), |
|
91 | 104 |
issue_id bigint, |
92 | 105 |
constraint pk_issue_comment primary key (id)) |
93 | 106 |
; |
94 | 107 |
|
108 |
+create table issue_event ( |
|
109 |
+ id bigint auto_increment not null, |
|
110 |
+ created datetime, |
|
111 |
+ sender_login_id varchar(255), |
|
112 |
+ sender_email varchar(255), |
|
113 |
+ issue_id bigint, |
|
114 |
+ event_type varchar(34), |
|
115 |
+ old_value varchar(255), |
|
116 |
+ new_value varchar(255), |
|
117 |
+ constraint ck_issue_event_event_type check (event_type in ('NEW_ISSUE','NEW_POSTING','NEW_PULL_REQUEST','ISSUE_STATE_CHANGED','ISSUE_ASSIGNEE_CHANGED','PULL_REQUEST_STATE_CHANGED','NEW_COMMENT','NEW_REVIEW_COMMENT','MEMBER_ENROLL_REQUEST','PULL_REQUEST_MERGED','ISSUE_REFERRED_FROM_COMMIT','PULL_REQUEST_COMMIT_CHANGED','NEW_COMMIT','PULL_REQUEST_REVIEW_STATE_CHANGED','ISSUE_BODY_CHANGED','ISSUE_REFERRED_FROM_PULL_REQUEST','REVIEW_THREAD_STATE_CHANGED','ORGANIZATION_MEMBER_ENROLL_REQUEST','COMMENT_UPDATED')), |
|
118 |
+ constraint pk_issue_event primary key (id)) |
|
119 |
+; |
|
120 |
+ |
|
95 | 121 |
create table issue_label ( |
96 |
- id bigint not null, |
|
97 |
- category varchar(255), |
|
122 |
+ id bigint auto_increment not null, |
|
123 |
+ category_id bigint, |
|
98 | 124 |
color varchar(255), |
99 | 125 |
name varchar(255), |
100 | 126 |
project_id bigint, |
101 | 127 |
constraint pk_issue_label primary key (id)) |
102 | 128 |
; |
103 | 129 |
|
104 |
-create table item ( |
|
105 |
- id bigint not null, |
|
106 |
- state boolean, |
|
107 |
- body varchar(255), |
|
108 |
- checklist_id bigint, |
|
109 |
- constraint pk_item primary key (id)) |
|
130 |
+create table issue_label_category ( |
|
131 |
+ id bigint auto_increment not null, |
|
132 |
+ project_id bigint, |
|
133 |
+ name varchar(255), |
|
134 |
+ is_exclusive tinyint(1) default 0, |
|
135 |
+ constraint pk_issue_label_category primary key (id)) |
|
110 | 136 |
; |
111 | 137 |
|
112 | 138 |
create table label ( |
113 |
- id bigint not null, |
|
139 |
+ id bigint auto_increment not null, |
|
140 |
+ category varchar(255), |
|
114 | 141 |
name varchar(255), |
115 |
- color varchar(255), |
|
116 |
- task_board_id bigint, |
|
142 |
+ constraint uq_label_1 unique (category,name), |
|
117 | 143 |
constraint pk_label primary key (id)) |
118 | 144 |
; |
119 | 145 |
|
120 |
-create table line ( |
|
121 |
- id bigint not null, |
|
122 |
- title varchar(255), |
|
123 |
- task_board_id bigint, |
|
124 |
- constraint pk_line primary key (id)) |
|
146 |
+create table mention ( |
|
147 |
+ id bigint auto_increment not null, |
|
148 |
+ resource_type varchar(20), |
|
149 |
+ resource_id varchar(255), |
|
150 |
+ user_id bigint, |
|
151 |
+ constraint ck_mention_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK','COMMIT_COMMENT','PULL_REQUEST','COMMIT','COMMENT_THREAD','REVIEW_COMMENT','ORGANIZATION','PROJECT_TRANSFER','ISSUE_LABEL_CATEGORY','WEBHOOK','NOT_A_RESOURCE')), |
|
152 |
+ constraint pk_mention primary key (id)) |
|
125 | 153 |
; |
126 | 154 |
|
127 | 155 |
create table milestone ( |
128 |
- id bigint not null, |
|
156 |
+ id bigint auto_increment not null, |
|
129 | 157 |
title varchar(255), |
130 |
- due_date timestamp, |
|
131 |
- contents clob, |
|
158 |
+ due_date datetime, |
|
159 |
+ contents longtext, |
|
132 | 160 |
state integer, |
133 | 161 |
project_id bigint, |
134 |
- constraint ck_milestone_state check (state in (0,1,2)), |
|
162 |
+ constraint ck_milestone_state check (state in (0,1,2,3,4,5,6)), |
|
163 |
+ constraint uq_milestone_1 unique (project_id,title), |
|
135 | 164 |
constraint pk_milestone primary key (id)) |
136 | 165 |
; |
137 | 166 |
|
138 |
-create table post ( |
|
139 |
- id bigint not null, |
|
167 |
+create table notification_event ( |
|
168 |
+ id bigint auto_increment not null, |
|
140 | 169 |
title varchar(255), |
141 |
- contents clob, |
|
142 |
- date timestamp, |
|
143 |
- comment_count integer, |
|
144 |
- file_path varchar(255), |
|
170 |
+ sender_id bigint, |
|
171 |
+ created datetime, |
|
172 |
+ resource_type varchar(20), |
|
173 |
+ resource_id varchar(255), |
|
174 |
+ event_type varchar(34), |
|
175 |
+ old_value longtext, |
|
176 |
+ new_value longtext, |
|
177 |
+ constraint ck_notification_event_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK','COMMIT_COMMENT','PULL_REQUEST','COMMIT','COMMENT_THREAD','REVIEW_COMMENT','ORGANIZATION','PROJECT_TRANSFER','ISSUE_LABEL_CATEGORY','WEBHOOK','NOT_A_RESOURCE')), |
|
178 |
+ constraint ck_notification_event_event_type check (event_type in ('NEW_ISSUE','NEW_POSTING','NEW_PULL_REQUEST','ISSUE_STATE_CHANGED','ISSUE_ASSIGNEE_CHANGED','PULL_REQUEST_STATE_CHANGED','NEW_COMMENT','NEW_REVIEW_COMMENT','MEMBER_ENROLL_REQUEST','PULL_REQUEST_MERGED','ISSUE_REFERRED_FROM_COMMIT','PULL_REQUEST_COMMIT_CHANGED','NEW_COMMIT','PULL_REQUEST_REVIEW_STATE_CHANGED','ISSUE_BODY_CHANGED','ISSUE_REFERRED_FROM_PULL_REQUEST','REVIEW_THREAD_STATE_CHANGED','ORGANIZATION_MEMBER_ENROLL_REQUEST','COMMENT_UPDATED')), |
|
179 |
+ constraint pk_notification_event primary key (id)) |
|
180 |
+; |
|
181 |
+ |
|
182 |
+create table notification_mail ( |
|
183 |
+ id bigint auto_increment not null, |
|
184 |
+ notification_event_id bigint, |
|
185 |
+ constraint pk_notification_mail primary key (id)) |
|
186 |
+; |
|
187 |
+ |
|
188 |
+create table organization ( |
|
189 |
+ id bigint auto_increment not null, |
|
190 |
+ name varchar(255), |
|
191 |
+ created datetime, |
|
192 |
+ descr varchar(255), |
|
193 |
+ constraint pk_organization primary key (id)) |
|
194 |
+; |
|
195 |
+ |
|
196 |
+create table organization_user ( |
|
197 |
+ id bigint auto_increment not null, |
|
198 |
+ user_id bigint, |
|
199 |
+ organization_id bigint, |
|
200 |
+ role_id bigint, |
|
201 |
+ constraint pk_organization_user primary key (id)) |
|
202 |
+; |
|
203 |
+ |
|
204 |
+create table original_email ( |
|
205 |
+ id bigint auto_increment not null, |
|
206 |
+ message_id varchar(255), |
|
207 |
+ resource_type varchar(20), |
|
208 |
+ resource_id varchar(255), |
|
209 |
+ handled_date datetime, |
|
210 |
+ constraint ck_original_email_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK','COMMIT_COMMENT','PULL_REQUEST','COMMIT','COMMENT_THREAD','REVIEW_COMMENT','ORGANIZATION','PROJECT_TRANSFER','ISSUE_LABEL_CATEGORY','WEBHOOK','NOT_A_RESOURCE')), |
|
211 |
+ constraint uq_original_email_message_id unique (message_id), |
|
212 |
+ constraint uq_original_email_1 unique (resource_type,resource_id), |
|
213 |
+ constraint pk_original_email primary key (id)) |
|
214 |
+; |
|
215 |
+ |
|
216 |
+create table posting ( |
|
217 |
+ id bigint auto_increment not null, |
|
218 |
+ title varchar(255), |
|
219 |
+ body longtext, |
|
220 |
+ created_date datetime, |
|
221 |
+ updated_date datetime, |
|
145 | 222 |
author_id bigint, |
146 | 223 |
author_login_id varchar(255), |
147 | 224 |
author_name varchar(255), |
148 | 225 |
project_id bigint, |
149 |
- constraint pk_post primary key (id)) |
|
226 |
+ number bigint, |
|
227 |
+ num_of_comments integer, |
|
228 |
+ notice tinyint(1) default 0, |
|
229 |
+ readme tinyint(1) default 0, |
|
230 |
+ constraint uq_posting_1 unique (project_id,number), |
|
231 |
+ constraint pk_posting primary key (id)) |
|
232 |
+; |
|
233 |
+ |
|
234 |
+create table posting_comment ( |
|
235 |
+ id bigint auto_increment not null, |
|
236 |
+ contents longtext, |
|
237 |
+ created_date datetime, |
|
238 |
+ author_id bigint, |
|
239 |
+ author_login_id varchar(255), |
|
240 |
+ author_name varchar(255), |
|
241 |
+ posting_id bigint, |
|
242 |
+ constraint pk_posting_comment primary key (id)) |
|
150 | 243 |
; |
151 | 244 |
|
152 | 245 |
create table project ( |
153 |
- id bigint not null, |
|
246 |
+ id bigint auto_increment not null, |
|
154 | 247 |
name varchar(255), |
155 | 248 |
overview varchar(255), |
156 | 249 |
vcs varchar(255), |
157 | 250 |
siteurl varchar(255), |
158 |
- logo_path varchar(255), |
|
159 | 251 |
owner varchar(255), |
160 |
- share_option boolean, |
|
161 |
- is_author_editable boolean, |
|
162 |
- date timestamp, |
|
252 |
+ created_date datetime, |
|
253 |
+ last_issue_number bigint, |
|
254 |
+ last_posting_number bigint, |
|
255 |
+ original_project_id bigint, |
|
256 |
+ last_pushed_date datetime, |
|
257 |
+ default_reviewer_count integer, |
|
258 |
+ is_using_reviewer_count tinyint(1) default 0, |
|
259 |
+ organization_id bigint, |
|
260 |
+ project_scope varchar(9), |
|
261 |
+ previous_owner_login_id varchar(255), |
|
262 |
+ previous_name varchar(255), |
|
263 |
+ previous_name_changed_time bigint, |
|
264 |
+ constraint ck_project_project_scope check (project_scope in ('PRIVATE','PROTECTED','PUBLIC')), |
|
163 | 265 |
constraint pk_project primary key (id)) |
164 | 266 |
; |
165 | 267 |
|
268 |
+create table project_menu_setting ( |
|
269 |
+ id bigint auto_increment not null, |
|
270 |
+ project_id bigint, |
|
271 |
+ code tinyint(1) default 0, |
|
272 |
+ issue tinyint(1) default 0, |
|
273 |
+ pull_request tinyint(1) default 0, |
|
274 |
+ review tinyint(1) default 0, |
|
275 |
+ milestone tinyint(1) default 0, |
|
276 |
+ board tinyint(1) default 0, |
|
277 |
+ constraint pk_project_menu_setting primary key (id)) |
|
278 |
+; |
|
279 |
+ |
|
280 |
+create table project_transfer ( |
|
281 |
+ id bigint auto_increment not null, |
|
282 |
+ sender_id bigint, |
|
283 |
+ destination varchar(255), |
|
284 |
+ project_id bigint, |
|
285 |
+ requested datetime, |
|
286 |
+ confirm_key varchar(255), |
|
287 |
+ accepted tinyint(1) default 0, |
|
288 |
+ new_project_name varchar(255), |
|
289 |
+ constraint pk_project_transfer primary key (id)) |
|
290 |
+; |
|
291 |
+ |
|
166 | 292 |
create table project_user ( |
167 |
- id bigint not null, |
|
293 |
+ id bigint auto_increment not null, |
|
168 | 294 |
user_id bigint, |
169 | 295 |
project_id bigint, |
170 | 296 |
role_id bigint, |
171 | 297 |
constraint pk_project_user primary key (id)) |
172 | 298 |
; |
173 | 299 |
|
174 |
-create table role ( |
|
175 |
- id bigint not null, |
|
300 |
+create table project_visitation ( |
|
301 |
+ id bigint auto_increment not null, |
|
302 |
+ project_id bigint, |
|
303 |
+ recently_visited_projects_id bigint, |
|
304 |
+ visited datetime, |
|
305 |
+ constraint uq_project_visitation_1 unique (project_id,recently_visited_projects_id), |
|
306 |
+ constraint pk_project_visitation primary key (id)) |
|
307 |
+; |
|
308 |
+ |
|
309 |
+create table property ( |
|
310 |
+ id bigint auto_increment not null, |
|
311 |
+ name varchar(25), |
|
312 |
+ value varchar(255), |
|
313 |
+ constraint ck_property_name check (name in ('MAILBOX_LAST_SEEN_UID','MAILBOX_LAST_UID_VALIDITY')), |
|
314 |
+ constraint pk_property primary key (id)) |
|
315 |
+; |
|
316 |
+ |
|
317 |
+create table pull_request ( |
|
318 |
+ id bigint auto_increment not null, |
|
319 |
+ title varchar(255), |
|
320 |
+ body longtext, |
|
321 |
+ to_project_id bigint, |
|
322 |
+ from_project_id bigint, |
|
323 |
+ to_branch varchar(255), |
|
324 |
+ from_branch varchar(255), |
|
325 |
+ contributor_id bigint, |
|
326 |
+ receiver_id bigint, |
|
327 |
+ created datetime, |
|
328 |
+ updated datetime, |
|
329 |
+ received datetime, |
|
330 |
+ state integer, |
|
331 |
+ is_conflict tinyint(1) default 0, |
|
332 |
+ is_merging tinyint(1) default 0, |
|
333 |
+ last_commit_id varchar(255), |
|
334 |
+ merged_commit_id_from varchar(255), |
|
335 |
+ merged_commit_id_to varchar(255), |
|
336 |
+ number bigint, |
|
337 |
+ constraint ck_pull_request_state check (state in (0,1,2,3,4,5,6)), |
|
338 |
+ constraint pk_pull_request primary key (id)) |
|
339 |
+; |
|
340 |
+ |
|
341 |
+create table pull_request_commit ( |
|
342 |
+ id bigint auto_increment not null, |
|
343 |
+ pull_request_id bigint, |
|
344 |
+ commit_id varchar(255), |
|
345 |
+ author_date datetime, |
|
346 |
+ created datetime, |
|
347 |
+ commit_message longtext, |
|
348 |
+ commit_short_id varchar(255), |
|
349 |
+ author_email varchar(255), |
|
350 |
+ state varchar(7), |
|
351 |
+ constraint ck_pull_request_commit_state check (state in ('PRIOR','CURRENT')), |
|
352 |
+ constraint pk_pull_request_commit primary key (id)) |
|
353 |
+; |
|
354 |
+ |
|
355 |
+create table pull_request_event ( |
|
356 |
+ id bigint auto_increment not null, |
|
357 |
+ sender_login_id varchar(255), |
|
358 |
+ pull_request_id bigint, |
|
359 |
+ event_type varchar(34), |
|
360 |
+ created datetime, |
|
361 |
+ old_value longtext, |
|
362 |
+ new_value longtext, |
|
363 |
+ constraint ck_pull_request_event_event_type check (event_type in ('NEW_ISSUE','NEW_POSTING','NEW_PULL_REQUEST','ISSUE_STATE_CHANGED','ISSUE_ASSIGNEE_CHANGED','PULL_REQUEST_STATE_CHANGED','NEW_COMMENT','NEW_REVIEW_COMMENT','MEMBER_ENROLL_REQUEST','PULL_REQUEST_MERGED','ISSUE_REFERRED_FROM_COMMIT','PULL_REQUEST_COMMIT_CHANGED','NEW_COMMIT','PULL_REQUEST_REVIEW_STATE_CHANGED','ISSUE_BODY_CHANGED','ISSUE_REFERRED_FROM_PULL_REQUEST','REVIEW_THREAD_STATE_CHANGED','ORGANIZATION_MEMBER_ENROLL_REQUEST','COMMENT_UPDATED')), |
|
364 |
+ constraint pk_pull_request_event primary key (id)) |
|
365 |
+; |
|
366 |
+ |
|
367 |
+create table project_pushed_branch ( |
|
368 |
+ id bigint auto_increment not null, |
|
369 |
+ pushed_date datetime, |
|
176 | 370 |
name varchar(255), |
177 |
- active boolean, |
|
371 |
+ project_id bigint, |
|
372 |
+ constraint pk_project_pushed_branch primary key (id)) |
|
373 |
+; |
|
374 |
+ |
|
375 |
+create table recently_visited_projects ( |
|
376 |
+ id bigint auto_increment not null, |
|
377 |
+ user_id bigint, |
|
378 |
+ constraint pk_recently_visited_projects primary key (id)) |
|
379 |
+; |
|
380 |
+ |
|
381 |
+create table review_comment ( |
|
382 |
+ id bigint auto_increment not null, |
|
383 |
+ contents longtext, |
|
384 |
+ created_date datetime, |
|
385 |
+ author_id bigint, |
|
386 |
+ author_login_id varchar(255), |
|
387 |
+ author_name varchar(255), |
|
388 |
+ thread_id bigint, |
|
389 |
+ constraint pk_review_comment primary key (id)) |
|
390 |
+; |
|
391 |
+ |
|
392 |
+create table role ( |
|
393 |
+ id bigint auto_increment not null, |
|
394 |
+ name varchar(255), |
|
395 |
+ active tinyint(1) default 0, |
|
178 | 396 |
constraint pk_role primary key (id)) |
179 | 397 |
; |
180 | 398 |
|
181 | 399 |
create table site_admin ( |
182 |
- id bigint not null, |
|
400 |
+ id bigint auto_increment not null, |
|
183 | 401 |
admin_id bigint, |
184 | 402 |
constraint pk_site_admin primary key (id)) |
185 | 403 |
; |
186 | 404 |
|
187 |
-create table task_board ( |
|
188 |
- id bigint not null, |
|
189 |
- project_id bigint, |
|
190 |
- constraint pk_task_board primary key (id)) |
|
191 |
-; |
|
192 |
- |
|
193 |
-create table task_comment ( |
|
194 |
- id bigint not null, |
|
195 |
- body varchar(255), |
|
196 |
- card_id bigint, |
|
197 |
- constraint pk_task_comment primary key (id)) |
|
405 |
+create table unwatch ( |
|
406 |
+ id bigint auto_increment not null, |
|
407 |
+ user_id bigint, |
|
408 |
+ resource_type varchar(20), |
|
409 |
+ resource_id varchar(255), |
|
410 |
+ constraint ck_unwatch_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK','COMMIT_COMMENT','PULL_REQUEST','COMMIT','COMMENT_THREAD','REVIEW_COMMENT','ORGANIZATION','PROJECT_TRANSFER','ISSUE_LABEL_CATEGORY','WEBHOOK','NOT_A_RESOURCE')), |
|
411 |
+ constraint pk_unwatch primary key (id)) |
|
198 | 412 |
; |
199 | 413 |
|
200 | 414 |
create table n4user ( |
201 |
- id bigint not null, |
|
415 |
+ id bigint auto_increment not null, |
|
202 | 416 |
name varchar(255), |
203 | 417 |
login_id varchar(255), |
204 | 418 |
password varchar(255), |
205 | 419 |
password_salt varchar(255), |
206 | 420 |
email varchar(255), |
207 |
- avatar_url varchar(255), |
|
208 |
- remember_me boolean, |
|
209 |
- date timestamp, |
|
421 |
+ remember_me tinyint(1) default 0, |
|
422 |
+ state varchar(7), |
|
423 |
+ last_state_modified_date datetime, |
|
424 |
+ created_date datetime, |
|
425 |
+ lang varchar(255), |
|
426 |
+ constraint ck_n4user_state check (state in ('ACTIVE','LOCKED','DELETED')), |
|
210 | 427 |
constraint pk_n4user primary key (id)) |
211 | 428 |
; |
212 | 429 |
|
430 |
+create table user_project_notification ( |
|
431 |
+ id bigint auto_increment not null, |
|
432 |
+ user_id bigint, |
|
433 |
+ project_id bigint, |
|
434 |
+ notification_type varchar(34), |
|
435 |
+ allowed tinyint(1) default 0, |
|
436 |
+ constraint ck_user_project_notification_notification_type check (notification_type in ('NEW_ISSUE','NEW_POSTING','NEW_PULL_REQUEST','ISSUE_STATE_CHANGED','ISSUE_ASSIGNEE_CHANGED','PULL_REQUEST_STATE_CHANGED','NEW_COMMENT','NEW_REVIEW_COMMENT','MEMBER_ENROLL_REQUEST','PULL_REQUEST_MERGED','ISSUE_REFERRED_FROM_COMMIT','PULL_REQUEST_COMMIT_CHANGED','NEW_COMMIT','PULL_REQUEST_REVIEW_STATE_CHANGED','ISSUE_BODY_CHANGED','ISSUE_REFERRED_FROM_PULL_REQUEST','REVIEW_THREAD_STATE_CHANGED','ORGANIZATION_MEMBER_ENROLL_REQUEST','COMMENT_UPDATED')), |
|
437 |
+ constraint uq_user_project_notification_1 unique (project_id,user_id,notification_type), |
|
438 |
+ constraint pk_user_project_notification primary key (id)) |
|
439 |
+; |
|
440 |
+ |
|
441 |
+create table watch ( |
|
442 |
+ id bigint auto_increment not null, |
|
443 |
+ user_id bigint, |
|
444 |
+ resource_type varchar(20), |
|
445 |
+ resource_id varchar(255), |
|
446 |
+ constraint ck_watch_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK','COMMIT_COMMENT','PULL_REQUEST','COMMIT','COMMENT_THREAD','REVIEW_COMMENT','ORGANIZATION','PROJECT_TRANSFER','ISSUE_LABEL_CATEGORY','WEBHOOK','NOT_A_RESOURCE')), |
|
447 |
+ constraint pk_watch primary key (id)) |
|
448 |
+; |
|
449 |
+ |
|
450 |
+create table webhook ( |
|
451 |
+ id bigint auto_increment not null, |
|
452 |
+ project_id bigint, |
|
453 |
+ payload_url varchar(2000), |
|
454 |
+ secret varchar(250), |
|
455 |
+ created_at datetime, |
|
456 |
+ constraint pk_webhook primary key (id)) |
|
457 |
+; |
|
458 |
+ |
|
459 |
+ |
|
460 |
+create table comment_thread_n4user ( |
|
461 |
+ comment_thread_id bigint not null, |
|
462 |
+ n4user_id bigint not null, |
|
463 |
+ constraint pk_comment_thread_n4user primary key (comment_thread_id, n4user_id)) |
|
464 |
+; |
|
213 | 465 |
|
214 | 466 |
create table issue_issue_label ( |
215 | 467 |
issue_id bigint not null, |
216 | 468 |
issue_label_id bigint not null, |
217 | 469 |
constraint pk_issue_issue_label primary key (issue_id, issue_label_id)) |
218 | 470 |
; |
219 |
-create sequence assignee_seq; |
|
220 | 471 |
|
221 |
-create sequence attachment_seq; |
|
472 |
+create table issue_voter ( |
|
473 |
+ issue_id bigint not null, |
|
474 |
+ user_id bigint not null, |
|
475 |
+ constraint pk_issue_voter primary key (issue_id, user_id)) |
|
476 |
+; |
|
222 | 477 |
|
223 |
-create sequence card_seq; |
|
478 |
+create table issue_comment_voter ( |
|
479 |
+ issue_comment_id bigint not null, |
|
480 |
+ user_id bigint not null, |
|
481 |
+ constraint pk_issue_comment_voter primary key (issue_comment_id, user_id)) |
|
482 |
+; |
|
224 | 483 |
|
225 |
-create sequence card_assignee_seq; |
|
484 |
+create table notification_event_n4user ( |
|
485 |
+ notification_event_id bigint not null, |
|
486 |
+ n4user_id bigint not null, |
|
487 |
+ constraint pk_notification_event_n4user primary key (notification_event_id, n4user_id)) |
|
488 |
+; |
|
226 | 489 |
|
227 |
-create sequence card_label_seq; |
|
490 |
+create table posting_issue_label ( |
|
491 |
+ posting_id bigint not null, |
|
492 |
+ issue_label_id bigint not null, |
|
493 |
+ constraint pk_posting_issue_label primary key (posting_id, issue_label_id)) |
|
494 |
+; |
|
228 | 495 |
|
229 |
-create sequence checklist_seq; |
|
496 |
+create table project_label ( |
|
497 |
+ project_id bigint not null, |
|
498 |
+ label_id bigint not null, |
|
499 |
+ constraint pk_project_label primary key (project_id, label_id)) |
|
500 |
+; |
|
230 | 501 |
|
231 |
-create sequence comment_seq; |
|
502 |
+create table pull_request_reviewers ( |
|
503 |
+ pull_request_id bigint not null, |
|
504 |
+ user_id bigint not null, |
|
505 |
+ constraint pk_pull_request_reviewers primary key (pull_request_id, user_id)) |
|
506 |
+; |
|
232 | 507 |
|
233 |
-create sequence issue_seq; |
|
508 |
+create table user_enrolled_project ( |
|
509 |
+ user_id bigint not null, |
|
510 |
+ project_id bigint not null, |
|
511 |
+ constraint pk_user_enrolled_project primary key (user_id, project_id)) |
|
512 |
+; |
|
234 | 513 |
|
235 |
-create sequence issue_comment_seq; |
|
236 |
- |
|
237 |
-create sequence issue_label_seq; |
|
238 |
- |
|
239 |
-create sequence item_seq; |
|
240 |
- |
|
241 |
-create sequence label_seq; |
|
242 |
- |
|
243 |
-create sequence line_seq; |
|
244 |
- |
|
245 |
-create sequence milestone_seq; |
|
246 |
- |
|
247 |
-create sequence post_seq; |
|
248 |
- |
|
249 |
-create sequence project_seq; |
|
250 |
- |
|
251 |
-create sequence project_user_seq; |
|
252 |
- |
|
253 |
-create sequence role_seq; |
|
254 |
- |
|
255 |
-create sequence site_admin_seq; |
|
256 |
- |
|
257 |
-create sequence task_board_seq; |
|
258 |
- |
|
259 |
-create sequence task_comment_seq; |
|
260 |
- |
|
261 |
-create sequence n4user_seq; |
|
262 |
- |
|
514 |
+create table user_enrolled_organization ( |
|
515 |
+ user_id bigint not null, |
|
516 |
+ organization_id bigint not null, |
|
517 |
+ constraint pk_user_enrolled_organization primary key (user_id, organization_id)) |
|
518 |
+; |
|
263 | 519 |
alter table assignee add constraint fk_assignee_user_1 foreign key (user_id) references n4user (id) on delete restrict on update restrict; |
264 | 520 |
create index ix_assignee_user_1 on assignee (user_id); |
265 | 521 |
alter table assignee add constraint fk_assignee_project_2 foreign key (project_id) references project (id) on delete restrict on update restrict; |
266 | 522 |
create index ix_assignee_project_2 on assignee (project_id); |
267 |
-alter table card add constraint fk_card_checklist_3 foreign key (checklist_id) references checklist (id) on delete restrict on update restrict; |
|
268 |
-create index ix_card_checklist_3 on card (checklist_id); |
|
269 |
-alter table card add constraint fk_card_line_4 foreign key (line_id) references line (id) on delete restrict on update restrict; |
|
270 |
-create index ix_card_line_4 on card (line_id); |
|
271 |
-alter table card_assignee add constraint fk_card_assignee_card_5 foreign key (card_id) references card (id) on delete restrict on update restrict; |
|
272 |
-create index ix_card_assignee_card_5 on card_assignee (card_id); |
|
273 |
-alter table card_assignee add constraint fk_card_assignee_projectUser_6 foreign key (project_user_id) references project_user (id) on delete restrict on update restrict; |
|
274 |
-create index ix_card_assignee_projectUser_6 on card_assignee (project_user_id); |
|
275 |
-alter table card_label add constraint fk_card_label_card_7 foreign key (card_id) references card (id) on delete restrict on update restrict; |
|
276 |
-create index ix_card_label_card_7 on card_label (card_id); |
|
277 |
-alter table card_label add constraint fk_card_label_label_8 foreign key (label_id) references label (id) on delete restrict on update restrict; |
|
278 |
-create index ix_card_label_label_8 on card_label (label_id); |
|
279 |
-alter table comment add constraint fk_comment_post_9 foreign key (post_id) references post (id) on delete restrict on update restrict; |
|
280 |
-create index ix_comment_post_9 on comment (post_id); |
|
281 |
-alter table issue add constraint fk_issue_project_10 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
282 |
-create index ix_issue_project_10 on issue (project_id); |
|
283 |
-alter table issue add constraint fk_issue_assignee_11 foreign key (assignee_id) references assignee (id) on delete restrict on update restrict; |
|
284 |
-create index ix_issue_assignee_11 on issue (assignee_id); |
|
285 |
-alter table issue_comment add constraint fk_issue_comment_issue_12 foreign key (issue_id) references issue (id) on delete restrict on update restrict; |
|
286 |
-create index ix_issue_comment_issue_12 on issue_comment (issue_id); |
|
523 |
+alter table comment_thread add constraint fk_comment_thread_pullRequest_3 foreign key (pull_request_id) references pull_request (id) on delete restrict on update restrict; |
|
524 |
+create index ix_comment_thread_pullRequest_3 on comment_thread (pull_request_id); |
|
525 |
+alter table comment_thread add constraint fk_comment_thread_project_4 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
526 |
+create index ix_comment_thread_project_4 on comment_thread (project_id); |
|
527 |
+alter table commit_comment add constraint fk_commit_comment_project_5 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
528 |
+create index ix_commit_comment_project_5 on commit_comment (project_id); |
|
529 |
+alter table email add constraint fk_email_user_6 foreign key (user_id) references n4user (id) on delete restrict on update restrict; |
|
530 |
+create index ix_email_user_6 on email (user_id); |
|
531 |
+alter table issue add constraint fk_issue_project_7 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
532 |
+create index ix_issue_project_7 on issue (project_id); |
|
533 |
+alter table issue add constraint fk_issue_milestone_8 foreign key (milestone_id) references milestone (id) on delete restrict on update restrict; |
|
534 |
+create index ix_issue_milestone_8 on issue (milestone_id); |
|
535 |
+alter table issue add constraint fk_issue_assignee_9 foreign key (assignee_id) references assignee (id) on delete restrict on update restrict; |
|
536 |
+create index ix_issue_assignee_9 on issue (assignee_id); |
|
537 |
+alter table issue_comment add constraint fk_issue_comment_issue_10 foreign key (issue_id) references issue (id) on delete restrict on update restrict; |
|
538 |
+create index ix_issue_comment_issue_10 on issue_comment (issue_id); |
|
539 |
+alter table issue_event add constraint fk_issue_event_issue_11 foreign key (issue_id) references issue (id) on delete restrict on update restrict; |
|
540 |
+create index ix_issue_event_issue_11 on issue_event (issue_id); |
|
541 |
+alter table issue_label add constraint fk_issue_label_category_12 foreign key (category_id) references issue_label_category (id) on delete restrict on update restrict; |
|
542 |
+create index ix_issue_label_category_12 on issue_label (category_id); |
|
287 | 543 |
alter table issue_label add constraint fk_issue_label_project_13 foreign key (project_id) references project (id) on delete restrict on update restrict; |
288 | 544 |
create index ix_issue_label_project_13 on issue_label (project_id); |
289 |
-alter table item add constraint fk_item_checklist_14 foreign key (checklist_id) references checklist (id) on delete restrict on update restrict; |
|
290 |
-create index ix_item_checklist_14 on item (checklist_id); |
|
291 |
-alter table label add constraint fk_label_taskBoard_15 foreign key (task_board_id) references task_board (id) on delete restrict on update restrict; |
|
292 |
-create index ix_label_taskBoard_15 on label (task_board_id); |
|
293 |
-alter table line add constraint fk_line_taskBoard_16 foreign key (task_board_id) references task_board (id) on delete restrict on update restrict; |
|
294 |
-create index ix_line_taskBoard_16 on line (task_board_id); |
|
295 |
-alter table milestone add constraint fk_milestone_project_17 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
296 |
-create index ix_milestone_project_17 on milestone (project_id); |
|
297 |
-alter table post add constraint fk_post_project_18 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
298 |
-create index ix_post_project_18 on post (project_id); |
|
299 |
-alter table project_user add constraint fk_project_user_user_19 foreign key (user_id) references n4user (id) on delete restrict on update restrict; |
|
300 |
-create index ix_project_user_user_19 on project_user (user_id); |
|
301 |
-alter table project_user add constraint fk_project_user_project_20 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
302 |
-create index ix_project_user_project_20 on project_user (project_id); |
|
303 |
-alter table project_user add constraint fk_project_user_role_21 foreign key (role_id) references role (id) on delete restrict on update restrict; |
|
304 |
-create index ix_project_user_role_21 on project_user (role_id); |
|
305 |
-alter table site_admin add constraint fk_site_admin_admin_22 foreign key (admin_id) references n4user (id) on delete restrict on update restrict; |
|
306 |
-create index ix_site_admin_admin_22 on site_admin (admin_id); |
|
307 |
-alter table task_board add constraint fk_task_board_project_23 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
308 |
-create index ix_task_board_project_23 on task_board (project_id); |
|
309 |
-alter table task_comment add constraint fk_task_comment_card_24 foreign key (card_id) references card (id) on delete restrict on update restrict; |
|
310 |
-create index ix_task_comment_card_24 on task_comment (card_id); |
|
545 |
+alter table issue_label_category add constraint fk_issue_label_category_project_14 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
546 |
+create index ix_issue_label_category_project_14 on issue_label_category (project_id); |
|
547 |
+alter table mention add constraint fk_mention_user_15 foreign key (user_id) references n4user (id) on delete restrict on update restrict; |
|
548 |
+create index ix_mention_user_15 on mention (user_id); |
|
549 |
+alter table milestone add constraint fk_milestone_project_16 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
550 |
+create index ix_milestone_project_16 on milestone (project_id); |
|
551 |
+alter table notification_mail add constraint fk_notification_mail_notificationEvent_17 foreign key (notification_event_id) references notification_event (id) on delete restrict on update restrict; |
|
552 |
+create index ix_notification_mail_notificationEvent_17 on notification_mail (notification_event_id); |
|
553 |
+alter table organization_user add constraint fk_organization_user_user_18 foreign key (user_id) references n4user (id) on delete restrict on update restrict; |
|
554 |
+create index ix_organization_user_user_18 on organization_user (user_id); |
|
555 |
+alter table organization_user add constraint fk_organization_user_organization_19 foreign key (organization_id) references organization (id) on delete restrict on update restrict; |
|
556 |
+create index ix_organization_user_organization_19 on organization_user (organization_id); |
|
557 |
+alter table organization_user add constraint fk_organization_user_role_20 foreign key (role_id) references role (id) on delete restrict on update restrict; |
|
558 |
+create index ix_organization_user_role_20 on organization_user (role_id); |
|
559 |
+alter table posting add constraint fk_posting_project_21 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
560 |
+create index ix_posting_project_21 on posting (project_id); |
|
561 |
+alter table posting_comment add constraint fk_posting_comment_posting_22 foreign key (posting_id) references posting (id) on delete restrict on update restrict; |
|
562 |
+create index ix_posting_comment_posting_22 on posting_comment (posting_id); |
|
563 |
+alter table project add constraint fk_project_originalProject_23 foreign key (original_project_id) references project (id) on delete restrict on update restrict; |
|
564 |
+create index ix_project_originalProject_23 on project (original_project_id); |
|
565 |
+alter table project add constraint fk_project_organization_24 foreign key (organization_id) references organization (id) on delete restrict on update restrict; |
|
566 |
+create index ix_project_organization_24 on project (organization_id); |
|
567 |
+alter table project_menu_setting add constraint fk_project_menu_setting_project_25 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
568 |
+create index ix_project_menu_setting_project_25 on project_menu_setting (project_id); |
|
569 |
+alter table project_transfer add constraint fk_project_transfer_sender_26 foreign key (sender_id) references n4user (id) on delete restrict on update restrict; |
|
570 |
+create index ix_project_transfer_sender_26 on project_transfer (sender_id); |
|
571 |
+alter table project_transfer add constraint fk_project_transfer_project_27 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
572 |
+create index ix_project_transfer_project_27 on project_transfer (project_id); |
|
573 |
+alter table project_user add constraint fk_project_user_user_28 foreign key (user_id) references n4user (id) on delete restrict on update restrict; |
|
574 |
+create index ix_project_user_user_28 on project_user (user_id); |
|
575 |
+alter table project_user add constraint fk_project_user_project_29 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
576 |
+create index ix_project_user_project_29 on project_user (project_id); |
|
577 |
+alter table project_user add constraint fk_project_user_role_30 foreign key (role_id) references role (id) on delete restrict on update restrict; |
|
578 |
+create index ix_project_user_role_30 on project_user (role_id); |
|
579 |
+alter table project_visitation add constraint fk_project_visitation_project_31 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
580 |
+create index ix_project_visitation_project_31 on project_visitation (project_id); |
|
581 |
+alter table project_visitation add constraint fk_project_visitation_recentlyVisitedProjects_32 foreign key (recently_visited_projects_id) references recently_visited_projects (id) on delete restrict on update restrict; |
|
582 |
+create index ix_project_visitation_recentlyVisitedProjects_32 on project_visitation (recently_visited_projects_id); |
|
583 |
+alter table pull_request add constraint fk_pull_request_toProject_33 foreign key (to_project_id) references project (id) on delete restrict on update restrict; |
|
584 |
+create index ix_pull_request_toProject_33 on pull_request (to_project_id); |
|
585 |
+alter table pull_request add constraint fk_pull_request_fromProject_34 foreign key (from_project_id) references project (id) on delete restrict on update restrict; |
|
586 |
+create index ix_pull_request_fromProject_34 on pull_request (from_project_id); |
|
587 |
+alter table pull_request add constraint fk_pull_request_contributor_35 foreign key (contributor_id) references n4user (id) on delete restrict on update restrict; |
|
588 |
+create index ix_pull_request_contributor_35 on pull_request (contributor_id); |
|
589 |
+alter table pull_request add constraint fk_pull_request_receiver_36 foreign key (receiver_id) references n4user (id) on delete restrict on update restrict; |
|
590 |
+create index ix_pull_request_receiver_36 on pull_request (receiver_id); |
|
591 |
+alter table pull_request_commit add constraint fk_pull_request_commit_pullRequest_37 foreign key (pull_request_id) references pull_request (id) on delete restrict on update restrict; |
|
592 |
+create index ix_pull_request_commit_pullRequest_37 on pull_request_commit (pull_request_id); |
|
593 |
+alter table pull_request_event add constraint fk_pull_request_event_pullRequest_38 foreign key (pull_request_id) references pull_request (id) on delete restrict on update restrict; |
|
594 |
+create index ix_pull_request_event_pullRequest_38 on pull_request_event (pull_request_id); |
|
595 |
+alter table project_pushed_branch add constraint fk_project_pushed_branch_project_39 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
596 |
+create index ix_project_pushed_branch_project_39 on project_pushed_branch (project_id); |
|
597 |
+alter table recently_visited_projects add constraint fk_recently_visited_projects_user_40 foreign key (user_id) references n4user (id) on delete restrict on update restrict; |
|
598 |
+create index ix_recently_visited_projects_user_40 on recently_visited_projects (user_id); |
|
599 |
+alter table review_comment add constraint fk_review_comment_thread_41 foreign key (thread_id) references comment_thread (id) on delete restrict on update restrict; |
|
600 |
+create index ix_review_comment_thread_41 on review_comment (thread_id); |
|
601 |
+alter table site_admin add constraint fk_site_admin_admin_42 foreign key (admin_id) references n4user (id) on delete restrict on update restrict; |
|
602 |
+create index ix_site_admin_admin_42 on site_admin (admin_id); |
|
603 |
+alter table unwatch add constraint fk_unwatch_user_43 foreign key (user_id) references n4user (id) on delete restrict on update restrict; |
|
604 |
+create index ix_unwatch_user_43 on unwatch (user_id); |
|
605 |
+alter table user_project_notification add constraint fk_user_project_notification_user_44 foreign key (user_id) references n4user (id) on delete restrict on update restrict; |
|
606 |
+create index ix_user_project_notification_user_44 on user_project_notification (user_id); |
|
607 |
+alter table user_project_notification add constraint fk_user_project_notification_project_45 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
608 |
+create index ix_user_project_notification_project_45 on user_project_notification (project_id); |
|
609 |
+alter table watch add constraint fk_watch_user_46 foreign key (user_id) references n4user (id) on delete restrict on update restrict; |
|
610 |
+create index ix_watch_user_46 on watch (user_id); |
|
611 |
+alter table webhook add constraint fk_webhook_project_47 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
612 |
+create index ix_webhook_project_47 on webhook (project_id); |
|
311 | 613 |
|
312 | 614 |
|
615 |
+ |
|
616 |
+alter table comment_thread_n4user add constraint fk_comment_thread_n4user_comment_thread_01 foreign key (comment_thread_id) references comment_thread (id) on delete restrict on update restrict; |
|
617 |
+ |
|
618 |
+alter table comment_thread_n4user add constraint fk_comment_thread_n4user_n4user_02 foreign key (n4user_id) references n4user (id) on delete restrict on update restrict; |
|
313 | 619 |
|
314 | 620 |
alter table issue_issue_label add constraint fk_issue_issue_label_issue_01 foreign key (issue_id) references issue (id) on delete restrict on update restrict; |
315 | 621 |
|
316 |
-alter table issue_issue_label add constraint fk_issue_issue_label_issue_la_02 foreign key (issue_label_id) references issue_label (id) on delete restrict on update restrict; |
|
622 |
+alter table issue_issue_label add constraint fk_issue_issue_label_issue_label_02 foreign key (issue_label_id) references issue_label (id) on delete restrict on update restrict; |
|
317 | 623 |
|
318 |
-# --- !Downs |
|
624 |
+alter table issue_voter add constraint fk_issue_voter_issue_01 foreign key (issue_id) references issue (id) on delete restrict on update restrict; |
|
319 | 625 |
|
320 |
-SET REFERENTIAL_INTEGRITY FALSE; |
|
626 |
+alter table issue_voter add constraint fk_issue_voter_n4user_02 foreign key (user_id) references n4user (id) on delete restrict on update restrict; |
|
321 | 627 |
|
322 |
-drop table if exists assignee; |
|
628 |
+alter table issue_comment_voter add constraint fk_issue_comment_voter_issue_comment_01 foreign key (issue_comment_id) references issue_comment (id) on delete restrict on update restrict; |
|
323 | 629 |
|
324 |
-drop table if exists attachment; |
|
630 |
+alter table issue_comment_voter add constraint fk_issue_comment_voter_n4user_02 foreign key (user_id) references n4user (id) on delete restrict on update restrict; |
|
325 | 631 |
|
326 |
-drop table if exists card; |
|
632 |
+alter table notification_event_n4user add constraint fk_notification_event_n4user_notification_event_01 foreign key (notification_event_id) references notification_event (id) on delete restrict on update restrict; |
|
327 | 633 |
|
328 |
-drop table if exists card_assignee; |
|
634 |
+alter table notification_event_n4user add constraint fk_notification_event_n4user_n4user_02 foreign key (n4user_id) references n4user (id) on delete restrict on update restrict; |
|
329 | 635 |
|
330 |
-drop table if exists card_label; |
|
636 |
+alter table posting_issue_label add constraint fk_posting_issue_label_posting_01 foreign key (posting_id) references posting (id) on delete restrict on update restrict; |
|
331 | 637 |
|
332 |
-drop table if exists checklist; |
|
638 |
+alter table posting_issue_label add constraint fk_posting_issue_label_issue_label_02 foreign key (issue_label_id) references issue_label (id) on delete restrict on update restrict; |
|
333 | 639 |
|
334 |
-drop table if exists comment; |
|
640 |
+alter table project_label add constraint fk_project_label_project_01 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
335 | 641 |
|
336 |
-drop table if exists issue; |
|
642 |
+alter table project_label add constraint fk_project_label_label_02 foreign key (label_id) references label (id) on delete restrict on update restrict; |
|
337 | 643 |
|
338 |
-drop table if exists issue_issue_label; |
|
644 |
+alter table pull_request_reviewers add constraint fk_pull_request_reviewers_pull_request_01 foreign key (pull_request_id) references pull_request (id) on delete restrict on update restrict; |
|
339 | 645 |
|
340 |
-drop table if exists issue_comment; |
|
646 |
+alter table pull_request_reviewers add constraint fk_pull_request_reviewers_n4user_02 foreign key (user_id) references n4user (id) on delete restrict on update restrict; |
|
341 | 647 |
|
342 |
-drop table if exists issue_label; |
|
648 |
+alter table user_enrolled_project add constraint fk_user_enrolled_project_n4user_01 foreign key (user_id) references n4user (id) on delete restrict on update restrict; |
|
343 | 649 |
|
344 |
-drop table if exists item; |
|
650 |
+alter table user_enrolled_project add constraint fk_user_enrolled_project_project_02 foreign key (project_id) references project (id) on delete restrict on update restrict; |
|
345 | 651 |
|
346 |
-drop table if exists label; |
|
652 |
+alter table user_enrolled_organization add constraint fk_user_enrolled_organization_n4user_01 foreign key (user_id) references n4user (id) on delete restrict on update restrict; |
|
347 | 653 |
|
348 |
-drop table if exists line; |
|
654 |
+alter table user_enrolled_organization add constraint fk_user_enrolled_organization_organization_02 foreign key (organization_id) references organization (id) on delete restrict on update restrict; |
|
655 |
+ |
|
656 |
+# --- !Downs |
|
657 |
+ |
|
658 |
+SET FOREIGN_KEY_CHECKS=0; |
|
349 | 659 |
|
350 |
-drop table if exists milestone; |
|
660 |
+drop table assignee; |
|
351 | 661 |
|
352 |
-drop table if exists post; |
|
662 |
+drop table attachment; |
|
353 | 663 |
|
354 |
-drop table if exists project; |
|
664 |
+drop table comment_thread; |
|
355 | 665 |
|
356 |
-drop table if exists project_user; |
|
666 |
+drop table commit_comment; |
|
357 | 667 |
|
358 |
-drop table if exists role; |
|
668 |
+drop table email; |
|
359 | 669 |
|
360 |
-drop table if exists site_admin; |
|
670 |
+drop table issue; |
|
361 | 671 |
|
362 |
-drop table if exists task_board; |
|
672 |
+drop table issue_issue_label; |
|
363 | 673 |
|
364 |
-drop table if exists task_comment; |
|
674 |
+drop table issue_voter; |
|
365 | 675 |
|
366 |
-drop table if exists n4user; |
|
676 |
+drop table issue_comment; |
|
367 | 677 |
|
368 |
-SET REFERENTIAL_INTEGRITY TRUE; |
|
678 |
+drop table issue_comment_voter; |
|
369 | 679 |
|
370 |
-drop sequence if exists assignee_seq; |
|
680 |
+drop table issue_event; |
|
371 | 681 |
|
372 |
-drop sequence if exists attachment_seq; |
|
682 |
+drop table issue_label; |
|
373 | 683 |
|
374 |
-drop sequence if exists card_seq; |
|
684 |
+drop table posting_issue_label; |
|
375 | 685 |
|
376 |
-drop sequence if exists card_assignee_seq; |
|
686 |
+drop table issue_label_category; |
|
377 | 687 |
|
378 |
-drop sequence if exists card_label_seq; |
|
688 |
+drop table label; |
|
379 | 689 |
|
380 |
-drop sequence if exists checklist_seq; |
|
690 |
+drop table project_label; |
|
381 | 691 |
|
382 |
-drop sequence if exists comment_seq; |
|
692 |
+drop table mention; |
|
383 | 693 |
|
384 |
-drop sequence if exists issue_seq; |
|
694 |
+drop table milestone; |
|
385 | 695 |
|
386 |
-drop sequence if exists issue_comment_seq; |
|
696 |
+drop table notification_event; |
|
387 | 697 |
|
388 |
-drop sequence if exists issue_label_seq; |
|
698 |
+drop table notification_event_n4user; |
|
389 | 699 |
|
390 |
-drop sequence if exists item_seq; |
|
700 |
+drop table notification_mail; |
|
391 | 701 |
|
392 |
-drop sequence if exists label_seq; |
|
702 |
+drop table organization; |
|
393 | 703 |
|
394 |
-drop sequence if exists line_seq; |
|
704 |
+drop table user_enrolled_organization; |
|
395 | 705 |
|
396 |
-drop sequence if exists milestone_seq; |
|
706 |
+drop table organization_user; |
|
397 | 707 |
|
398 |
-drop sequence if exists post_seq; |
|
708 |
+drop table original_email; |
|
399 | 709 |
|
400 |
-drop sequence if exists project_seq; |
|
710 |
+drop table posting; |
|
401 | 711 |
|
402 |
-drop sequence if exists project_user_seq; |
|
712 |
+drop table posting_comment; |
|
403 | 713 |
|
404 |
-drop sequence if exists role_seq; |
|
714 |
+drop table project; |
|
405 | 715 |
|
406 |
-drop sequence if exists site_admin_seq; |
|
716 |
+drop table user_enrolled_project; |
|
407 | 717 |
|
408 |
-drop sequence if exists task_board_seq; |
|
718 |
+drop table project_menu_setting; |
|
409 | 719 |
|
410 |
-drop sequence if exists task_comment_seq; |
|
720 |
+drop table project_transfer; |
|
411 | 721 |
|
412 |
-drop sequence if exists n4user_seq; |
|
722 |
+drop table project_user; |
|
723 |
+ |
|
724 |
+drop table project_visitation; |
|
725 |
+ |
|
726 |
+drop table property; |
|
727 |
+ |
|
728 |
+drop table pull_request; |
|
729 |
+ |
|
730 |
+drop table pull_request_reviewers; |
|
731 |
+ |
|
732 |
+drop table pull_request_commit; |
|
733 |
+ |
|
734 |
+drop table pull_request_event; |
|
735 |
+ |
|
736 |
+drop table project_pushed_branch; |
|
737 |
+ |
|
738 |
+drop table recently_visited_projects; |
|
739 |
+ |
|
740 |
+drop table review_comment; |
|
741 |
+ |
|
742 |
+drop table role; |
|
743 |
+ |
|
744 |
+drop table site_admin; |
|
745 |
+ |
|
746 |
+drop table unwatch; |
|
747 |
+ |
|
748 |
+drop table n4user; |
|
749 |
+ |
|
750 |
+drop table user_project_notification; |
|
751 |
+ |
|
752 |
+drop table watch; |
|
753 |
+ |
|
754 |
+drop table webhook; |
|
755 |
+ |
|
756 |
+SET FOREIGN_KEY_CHECKS=1; |
|
413 | 757 |
|
--- conf/evolutions/default/10.sql
... | ... | @@ -1,6 +0,0 @@ |
1 | -# --- !Ups | |
2 | -ALTER TABLE N4USER ADD COLUMN is_locked boolean default false; | |
3 | - | |
4 | - | |
5 | -# --- !Downs | |
6 | -ALTER TABLE N4USER DROP COLUMN is_locked; |
--- conf/evolutions/default/100.sql
... | ... | @@ -1,13 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -alter table notification_event add column tmp_resource_id varchar(255); | |
4 | -update notification_event set tmp_resource_id = cast(resource_id as varchar(255)); | |
5 | -alter table notification_event drop column if exists resource_id; | |
6 | -alter table notification_event alter column tmp_resource_id rename to resource_id; | |
7 | - | |
8 | -# --- !Downs | |
9 | - | |
10 | --- Drop all records whose resource_id is not a number then restore the type of | |
11 | --- resource_id to bigint. | |
12 | -delete from notification_event where resource_id regexp '[^0-9]'; | |
13 | -alter table notification_event alter column resource_id bigint; |
--- conf/evolutions/default/101.sql
... | ... | @@ -1,13 +0,0 @@ |
1 | -# --- !Ups | |
2 | --- remove duplicated rows in pull_request_reviewers table | |
3 | -create table prr_tmp (pull_request_id bigint, user_id bigint); | |
4 | - | |
5 | -insert into prr_tmp (pull_request_id, user_id) select distinct pull_request_id, user_id from pull_request_reviewers; | |
6 | - | |
7 | -truncate table pull_request_reviewers; | |
8 | - | |
9 | -insert into pull_request_reviewers (pull_request_id, user_id) select pull_request_id, user_id from prr_tmp; | |
10 | - | |
11 | -drop table prr_tmp; | |
12 | - | |
13 | -# --- !Downs |
--- conf/evolutions/default/102.sql
... | ... | @@ -1,7 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -alter table pull_request_reviewers add constraint uq_pull_request_reviewer unique (pull_request_id, user_id); | |
4 | - | |
5 | -# --- !Downs | |
6 | - | |
7 | -alter table pull_request_reviewers drop constraint if exists uq_pull_request_reviewer; |
--- conf/evolutions/default/103.sql
... | ... | @@ -1,6 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -update project_user set role_id = (select id from role where name = 'sitemanager') | |
4 | -where role_id = 0 and user_id = (select admin_id from site_admin); | |
5 | - | |
6 | -# --- !Downs |
--- conf/evolutions/default/104.sql
... | ... | @@ -1,15 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE PROJECT ADD previous_name VARCHAR(255); | |
4 | -ALTER TABLE PROJECT ADD previous_owner_login_id VARCHAR(255); | |
5 | -ALTER TABLE PROJECT ADD previous_name_changed_time BIGINT; | |
6 | - | |
7 | -CREATE INDEX ix_project_previous_01 ON project(previous_owner_login_id, previous_name); | |
8 | - | |
9 | -# --- !Downs | |
10 | - | |
11 | -DROP INDEX IF EXISTS ix_project_previous_01; | |
12 | - | |
13 | -ALTER TABLE project DROP COLUMN IF EXISTS previous_name; | |
14 | -ALTER TABLE project DROP COLUMN IF EXISTS previous_owner_login_id; | |
15 | -ALTER TABLE project DROP COLUMN IF EXISTS previous_name_changed_time; |
--- conf/evolutions/default/105.sql
... | ... | @@ -1,19 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -create table webhook ( | |
4 | - id bigint not null, | |
5 | - project_id bigint not null, | |
6 | - payload_url varchar(2048) not null, | |
7 | - secret varchar(256), | |
8 | - created_at timestamp, | |
9 | - constraint pk_webhook primary key (id)) | |
10 | -; | |
11 | - | |
12 | -create sequence webhook_seq; | |
13 | -alter table webhook add constraint fk_project_webhook foreign key (project_id) references project (id) on delete restrict on update restrict; | |
14 | - | |
15 | -# --- !Downs | |
16 | - | |
17 | -drop table if exists webhook; | |
18 | - | |
19 | -drop sequence if exists webhook_seq; |
--- conf/evolutions/default/106.sql
... | ... | @@ -1,14 +0,0 @@ |
1 | -# --- !Ups | |
2 | -create table posting_issue_label ( | |
3 | - posting_id bigint not null, | |
4 | - issue_label_id bigint not null, | |
5 | - constraint pk_posting_issue_label primary key (posting_id, issue_label_id)) | |
6 | -; | |
7 | - | |
8 | -alter table posting_issue_label add constraint fk_posting_issue_label_issue_01 foreign key (posting_id) references posting (id) on delete restrict on update restrict; | |
9 | - | |
10 | -alter table posting_issue_label add constraint fk_posting_issue_label_issue_la_02 foreign key (issue_label_id) references issue_label (id) on delete restrict on update restrict; | |
11 | - | |
12 | -# --- !Downs | |
13 | -drop table if exists POSTING_ISSUE_LABEL; | |
14 | - |
--- conf/evolutions/default/11.sql
... | ... | @@ -1,173 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE tag DROP COLUMN IF EXISTS category; | |
4 | -ALTER TABLE tag ADD COLUMN category VARCHAR(255); | |
5 | -UPDATE tag SET category='Tag'; | |
6 | -ALTER TABLE tag ALTER COLUMN category SET NOT NULL; | |
7 | -ALTER TABLE tag DROP CONSTRAINT IF EXISTS uq_tag_name; | |
8 | -ALTER TABLE tag DROP CONSTRAINT IF EXISTS uq_tag_category_name; | |
9 | -ALTER TABLE tag ADD CONSTRAINT uq_tag_category_name UNIQUE (category, name); | |
10 | - | |
11 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ALGOL 58'); | |
12 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ALGOL 60'); | |
13 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ALGOL 68'); | |
14 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'APL'); | |
15 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ASP.NET'); | |
16 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'AWK'); | |
17 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ActionScript'); | |
18 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Ada'); | |
19 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'AppleScript'); | |
20 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'AspectJ'); | |
21 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Assembly language'); | |
22 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'AutoLISP / Visual LISP'); | |
23 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'B'); | |
24 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'BASIC'); | |
25 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'BCPL'); | |
26 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'BREW'); | |
27 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Bash'); | |
28 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Batch (Windows/Dos)'); | |
29 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Bourne shell'); | |
30 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'C#'); | |
31 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'C'); | |
32 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'C++'); | |
33 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'COBOL'); | |
34 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Clipper'); | |
35 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Clojure'); | |
36 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'CobolScript'); | |
37 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'CoffeeScript'); | |
38 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ColdFusion'); | |
39 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Common Lisp'); | |
40 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Component Pascal'); | |
41 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Curl'); | |
42 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'D'); | |
43 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Dart'); | |
44 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Delphi'); | |
45 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ECMAScript'); | |
46 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Eiffel'); | |
47 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Emacs Lisp'); | |
48 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Erlang'); | |
49 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'F#'); | |
50 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'F'); | |
51 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Forth'); | |
52 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Fortran'); | |
53 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'FoxBase'); | |
54 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'FoxPro'); | |
55 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Go!'); | |
56 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Go'); | |
57 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Groovy'); | |
58 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Haskell'); | |
59 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Io'); | |
60 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'J'); | |
61 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'JScript'); | |
62 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Java'); | |
63 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'JavaFX Script'); | |
64 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'JavaScript'); | |
65 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'LaTeX'); | |
66 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Lisp'); | |
67 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Logo'); | |
68 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Lua'); | |
69 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'MATLAB'); | |
70 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'MDL'); | |
71 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ML'); | |
72 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Machine code'); | |
73 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Mathematica'); | |
74 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Maya'); | |
75 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Microcode'); | |
76 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Microsoft Visual C++'); | |
77 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Modula'); | |
78 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Modula-2'); | |
79 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Modula-3'); | |
80 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'OCaml'); | |
81 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Object Lisp'); | |
82 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Object Pascal'); | |
83 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Objective-C'); | |
84 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Opa'); | |
85 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Orc'); | |
86 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PHP'); | |
87 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL-11'); | |
88 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL/0'); | |
89 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL/B'); | |
90 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL/C'); | |
91 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL/I'); | |
92 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL/M'); | |
93 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL/P'); | |
94 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL/SQL'); | |
95 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'POP-11'); | |
96 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Pascal'); | |
97 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Perl'); | |
98 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PostScript'); | |
99 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PowerBuilder'); | |
100 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PowerShell'); | |
101 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Processing.js'); | |
102 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Prolog'); | |
103 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Python'); | |
104 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'QBasic'); | |
105 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'QuakeC'); | |
106 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'R'); | |
107 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'R++'); | |
108 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'REXX'); | |
109 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Ruby'); | |
110 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Rust'); | |
111 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Scala'); | |
112 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Scheme'); | |
113 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Script.NET'); | |
114 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Sed'); | |
115 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Self'); | |
116 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Simula'); | |
117 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Simulink'); | |
118 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Small Basic'); | |
119 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Smalltalk'); | |
120 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Snowball'); | |
121 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Squeak'); | |
122 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'TEX'); | |
123 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Tcl'); | |
124 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'TeX'); | |
125 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'UNITY'); | |
126 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Unix shell'); | |
127 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'UnrealScript'); | |
128 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'VBA'); | |
129 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'VBScript'); | |
130 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'VHDL'); | |
131 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Vala'); | |
132 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Verilog'); | |
133 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual Basic .NET'); | |
134 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual Basic'); | |
135 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual C#'); | |
136 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual DataFlex'); | |
137 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual DialogScript'); | |
138 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual Fortran'); | |
139 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual FoxPro'); | |
140 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual J#'); | |
141 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual J++'); | |
142 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual LISP'); | |
143 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual Prolog'); | |
144 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Windows PowerShell'); | |
145 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'XQuery'); | |
146 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'XSLT'); | |
147 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'bc'); | |
148 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'csh'); | |
149 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'dBase'); | |
150 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ksh'); | |
151 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'make'); | |
152 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'Apache'); | |
153 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'BSD'); | |
154 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'EPL'); | |
155 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'GPL'); | |
156 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'ISC'); | |
157 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'LGPL'); | |
158 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'MIT'); | |
159 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'MPL v1.1'); | |
160 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'MPL v2.0'); | |
161 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'Public Domain'); | |
162 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'OS', 'Linux'); | |
163 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'OS', 'OSX'); | |
164 | -INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'OS', 'Windows'); | |
165 | - | |
166 | -# --- !Downs | |
167 | - | |
168 | -ALTER TABLE tag DROP CONSTRAINT IF EXISTS uq_tag_name; | |
169 | -UPDATE tag SET name=category || ' - ' || name WHERE category <> 'Tag'; | |
170 | -DELETE FROM tag WHERE id NOT IN (SELECT min(id) FROM tag GROUP BY name); | |
171 | -ALTER TABLE tag DROP CONSTRAINT IF EXISTS uq_tag_category_name; | |
172 | -ALTER TABLE tag DROP COLUMN IF EXISTS category; | |
173 | -ALTER TABLE tag ADD CONSTRAINT uq_tag_name UNIQUE (name); |
--- conf/evolutions/default/12.sql
... | ... | @@ -1,5 +0,0 @@ |
1 | -# --- !Ups | |
2 | -ALTER TABLE project ALTER COLUMN share_option RENAME TO is_public; | |
3 | - | |
4 | -# --- !Downs | |
5 | -ALTER TABLE project ALTER COLUMN is_public RENAME TO share_option; |
--- conf/evolutions/default/13.sql
... | ... | @@ -1,29 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE project ADD COLUMN original_project_id varchar(255); | |
4 | - | |
5 | -create table pull_request ( | |
6 | - id bigint not null, | |
7 | - title varchar(255), | |
8 | - body clob, | |
9 | - to_project_id bigint, | |
10 | - from_project_id bigint, | |
11 | - to_branch varchar(255), | |
12 | - from_branch varchar(255), | |
13 | - contributor_id bigint, | |
14 | - receiver_id bigint, | |
15 | - created timestamp, | |
16 | - updated timestamp, | |
17 | - received timestamp, | |
18 | - state integer, | |
19 | - constraint pk_pull_request primary key (id)); | |
20 | - | |
21 | -create sequence pull_request_seq; | |
22 | - | |
23 | -# --- !Downs | |
24 | - | |
25 | -DROP SEQUENCE IF EXISTS pull_request_seq; | |
26 | - | |
27 | -DROP TABLE IF EXISTS pull_request; | |
28 | - | |
29 | -ALTER TABLE project DROP COLUMN original_project_id; |
--- conf/evolutions/default/14.sql
... | ... | @@ -1,15 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE project ADD COLUMN watching_count BIGINT; | |
4 | -UPDATE project SET watching_count = 0 WHERE watching_count IS NULL; | |
5 | - | |
6 | -create table user_watching_project ( | |
7 | - user_id bigint not null, | |
8 | - project_id bigint not null, | |
9 | - constraint pk_user_watching_project primary key (user_id, project_id)); | |
10 | - | |
11 | -# --- !Downs | |
12 | - | |
13 | -DROP TABLE IF EXISTS user_watching_project; | |
14 | - | |
15 | -ALTER TABLE project DROP COLUMN watching_count; |
--- conf/evolutions/default/15.sql
... | ... | @@ -1,13 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -DROP TABLE IF EXISTS label; | |
4 | - | |
5 | -# --- !Downs | |
6 | - | |
7 | -CREATE TABLE label ( | |
8 | - id bigint not null, | |
9 | - name varchar(255), | |
10 | - color varchar(255), | |
11 | - task_board_id bigint, | |
12 | - constraint pk_label primary key (id)) | |
13 | -; |
--- conf/evolutions/default/16.sql
... | ... | @@ -1,33 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE tag DROP CONSTRAINT IF EXISTS uq_tag_category_name; | |
4 | -ALTER TABLE tag DROP CONSTRAINT IF EXISTS uq_label_category_name; | |
5 | -ALTER TABLE tag ADD CONSTRAINT uq_label_category_name UNIQUE (category, name); | |
6 | -ALTER TABLE tag DROP CONSTRAINT IF EXISTS pk_tag; | |
7 | -ALTER TABLE tag DROP CONSTRAINT IF EXISTS pk_label; | |
8 | -ALTER TABLE tag ADD CONSTRAINT pk_label PRIMARY KEY (ID); | |
9 | -ALTER TABLE tag RENAME TO label; | |
10 | - | |
11 | -ALTER TABLE project_tag ALTER COLUMN tag_id RENAME TO label_id; | |
12 | -ALTER TABLE project_tag RENAME TO project_label; | |
13 | - | |
14 | -DROP SEQUENCE IF EXISTS label_seq; | |
15 | -CREATE SEQUENCE label_seq START WITH tag_seq.nextval; | |
16 | -DROP SEQUENCE IF EXISTS tag_seq; | |
17 | - | |
18 | -# --- !Downs | |
19 | - | |
20 | -ALTER TABLE label DROP CONSTRAINT IF EXISTS uq_label_category_name; | |
21 | -ALTER TABLE label DROP CONSTRAINT IF EXISTS uq_tag_category_name; | |
22 | -ALTER TABLE label ADD CONSTRAINT uq_tag_category_name UNIQUE (category, name); | |
23 | -ALTER TABLE label DROP CONSTRAINT IF EXISTS pk_label; | |
24 | -ALTER TABLE label DROP CONSTRAINT IF EXISTS pk_tag; | |
25 | -ALTER TABLE label ADD CONSTRAINT pk_tag PRIMARY KEY (ID); | |
26 | -ALTER TABLE label RENAME TO tag; | |
27 | - | |
28 | -ALTER TABLE project_label ALTER COLUMN label_id RENAME TO tag_id; | |
29 | -ALTER TABLE project_label RENAME TO project_tag; | |
30 | - | |
31 | -DROP SEQUENCE IF EXISTS tag_seq; | |
32 | -CREATE SEQUENCE tag_seq START WITH label_seq.nextval; | |
33 | -DROP SEQUENCE IF EXISTS label_seq; |
--- conf/evolutions/default/17.sql
... | ... | @@ -1,7 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE project ADD COLUMN last_pushed_date timestamp; | |
4 | - | |
5 | -# --- !Downs | |
6 | - | |
7 | -ALTER TABLE project DROP COLUMN last_pushed_date; |
--- conf/evolutions/default/18.sql
... | ... | @@ -1,28 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -CREATE TABLE ISSUE_EXPLICIT_WATCHER ( | |
4 | - issue_id bigint, | |
5 | - n4user_id bigint, | |
6 | -); | |
7 | - | |
8 | -CREATE TABLE ISSUE_EXPLICIT_UNWATCHER ( | |
9 | - issue_id bigint, | |
10 | - n4user_id bigint, | |
11 | -); | |
12 | - | |
13 | -CREATE TABLE POSTING_EXPLICIT_WATCHER ( | |
14 | - posting_id bigint, | |
15 | - n4user_id bigint, | |
16 | -); | |
17 | - | |
18 | -CREATE TABLE POSTING_EXPLICIT_UNWATCHER ( | |
19 | - posting_id bigint, | |
20 | - n4user_id bigint, | |
21 | -); | |
22 | - | |
23 | -# --- !Downs | |
24 | - | |
25 | -DROP TABLE IF EXISTS ISSUE_EXPLICIT_WATCHER; | |
26 | -DROP TABLE IF EXISTS ISSUE_EXPLICIT_UNWATCHER; | |
27 | -DROP TABLE IF EXISTS POSTING_EXPLICIT_WATCHER; | |
28 | -DROP TABLE IF EXISTS POSTING_EXPLICIT_UNWATCHER; |
--- conf/evolutions/default/19.sql
... | ... | @@ -1,35 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -create table code_comment ( | |
4 | - id bigint not null, | |
5 | - project_id bigint, | |
6 | - commit_id varchar(255), | |
7 | - path varchar(255), | |
8 | - line bigint, | |
9 | - side varchar(255), | |
10 | - contents varchar(4000), | |
11 | - created_date timestamp, | |
12 | - author_id bigint, | |
13 | - author_login_id varchar(255), | |
14 | - author_name varchar(255), | |
15 | - constraint pk_code_comment primary key (id)) | |
16 | -; | |
17 | - | |
18 | -create sequence code_comment_seq; | |
19 | - | |
20 | -alter table code_comment add constraint fk_code_comment_project_3 foreign key (project_id) references project (id) on delete restrict on update restrict; | |
21 | - | |
22 | -create index ix_code_comment_project_3 on code_comment (project_id); | |
23 | - | |
24 | -ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_attachment_container_type; | |
25 | -ALTER TABLE attachment ADD CONSTRAINT ck_attachment_container_type check (container_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','CODE_COMMENT')); | |
26 | - | |
27 | -# --- !Downs | |
28 | - | |
29 | -drop table if exists code_comment; | |
30 | -drop sequence if exists code_comment_seq; | |
31 | - | |
32 | -DELETE FROM attachment WHERE container_type='CODE_COMMENT'; | |
33 | - | |
34 | -ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_attachment_container_type; | |
35 | -ALTER TABLE attachment ADD CONSTRAINT ck_attachment_container_type check (container_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT')); |
--- conf/evolutions/default/2.sql
+++ conf/evolutions/default/2.sql
... | ... | @@ -1,51 +1,20 @@ |
1 | 1 |
# --- !Ups |
2 |
+create index ix_issue_voter_user_id on issue_voter (user_id); |
|
3 |
+create index ix_issue_comment_voter_user_id on issue_comment_voter (user_id); |
|
2 | 4 |
|
3 |
-ALTER TABLE attachment ALTER container_type TYPE varchar(16); |
|
4 |
-ALTER TABLE attachment DROP CONSTRAINT ck_attachment_container_type; |
|
5 |
-ALTER TABLE attachment ADD CONSTRAINT ck_attachment_container_type check (container_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT')); |
|
5 |
+create index ix_original_email_resource_id on original_email (resource_id); |
|
6 | 6 |
|
7 |
-ALTER TABLE comment DROP file_path; |
|
8 |
-ALTER TABLE comment DROP CONSTRAINT pk_comment; |
|
9 |
-ALTER TABLE comment ADD CONSTRAINT pk_posting_comment primary key (id); |
|
10 |
-ALTER TABLE comment ALTER COLUMN post_id RENAME TO posting_id; |
|
11 |
-ALTER TABLE comment RENAME TO posting_comment; |
|
7 |
+CREATE INDEX ix_attachment_container ON attachment (container_type, container_id); |
|
12 | 8 |
|
13 |
-ALTER TABLE issue_comment DROP file_path; |
|
14 |
- |
|
15 |
-ALTER TABLE post DROP file_path; |
|
16 |
-ALTER TABLE post ALTER COLUMN contents RENAME TO body; |
|
17 |
-ALTER TABLE post ALTER COLUMN comment_count RENAME TO num_of_comments; |
|
18 |
-ALTER TABLE post DROP CONSTRAINT pk_post; |
|
19 |
-ALTER TABLE post ADD CONSTRAINT pk_posting primary key (id); |
|
20 |
-ALTER TABLE post RENAME TO posting; |
|
21 |
- |
|
22 |
-CREATE SEQUENCE posting_seq START WITH post_seq.currval; |
|
23 |
-DROP SEQUENCE IF EXISTS post_seq; |
|
24 |
- |
|
25 |
-CREATE SEQUENCE posting_comment_seq START WITH comment_seq.currval; |
|
26 |
-DROP SEQUENCE IF EXISTS comment_seq; |
|
9 |
+create index ix_mention_resource_type on mention (resource_type); |
|
27 | 10 |
|
28 | 11 |
# --- !Downs |
29 | 12 |
|
30 |
-ALTER TABLE attachment ALTER container_type TYPE varchar(15); |
|
31 |
-ALTER TABLE attachment DROP CONSTRAINT ck_attachment_container_type; |
|
32 |
-ALTER TABLE attachment ADD CONSTRAINT ck_attachment_container_type check (container_type in ('ISSUE_POST';'ISSUE_COMMENT';'ISSUE_ASSIGNEE';'ISSUE_STATE';'ISSUE_CATEGORY';'ISSUE_MILESTONE';'ISSUE_NOTICE';'ISSUE_LABEL';'BOARD_POST';'BOARD_COMMENT';'BOARD_CATEGORY';'BOARD_NOTICE';'CODE';'MILESTONE';'WIKI_PAGE';'PROJECT_SETTING';'SITE_SETTING';'USER';'USER_AVATAR';'PROJECT';'ATTACHMENT')); |
|
13 |
+drop index if exists ix_issue_voter_user_id; |
|
14 |
+drop index if exists ix_issue_comment_voter_user_id; |
|
33 | 15 |
|
34 |
-ALTER TABLE posting_comment ADD file_path; |
|
35 |
-ALTER TABLE posting_comment DROP CONSTRAINT pk_posting_comment; |
|
36 |
-ALTER TABLE posting_comment ADD CONSTRAINT pk_comment primary key (id); |
|
37 |
-ALTER TABLE posting_comment RENAME TO comment; |
|
16 |
+drop index if exists ix_original_email_resource_id; |
|
38 | 17 |
|
39 |
-ALTER TABLE issue_comment ADD file_path; |
|
18 |
+drop index if exists ix_attachment_container; |
|
40 | 19 |
|
41 |
-ALTER TABLE posting ALTER COLUMN body RENAME TO contents; |
|
42 |
-ALTER TABLE posting ALTER COLUMN num_of_comments RENAME TO comment_count; |
|
43 |
-ALTER TABLE posting DROP CONSTRAINT pk_posting; |
|
44 |
-ALTER TABLE posting ADD CONSTRAINT pk_post primary key (id)); |
|
45 |
-ALTER TABLE posting RENAME TO post; |
|
46 |
- |
|
47 |
-CREATE SEQUENCE post_seq START WITH posting_seq.currval; |
|
48 |
-DROP SEQUENCE IF EXISTS posting_seq; |
|
49 |
- |
|
50 |
-CREATE SEQUENCE comment_seq START WITH posting_comment_seq.currval; |
|
51 |
-DROP SEQUENCE IF EXISTS posting_comment_seq; |
|
20 |
+drop index if exists ix_mention_resource_type; |
--- conf/evolutions/default/20.sql
... | ... | @@ -1,20 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -CREATE TABLE simple_comment ( | |
4 | - id bigint not null, | |
5 | - contents varchar(4000), | |
6 | - created_date timestamp, | |
7 | - author_id bigint, | |
8 | - author_login_id varchar(255), | |
9 | - author_name varchar(255), | |
10 | - resource_key varchar(255), | |
11 | - constraint pk_simple_comment primary key (id) | |
12 | -); | |
13 | - | |
14 | -CREATE SEQUENCE simple_comment_seq; | |
15 | - | |
16 | -# --- !Downs | |
17 | - | |
18 | -DROP SEQUENCE IF EXISTS simple_comment_seq; | |
19 | - | |
20 | -DROP TABLE IF EXISTS simple_comment; |
--- conf/evolutions/default/21.sql
... | ... | @@ -1,9 +0,0 @@ |
1 | -# --- !Ups | |
2 | -create table user_enrolled_project ( | |
3 | - user_id bigint not null, | |
4 | - project_id bigint not null, | |
5 | - constraint pk_user_enrolled_project primary key (user_id, project_id)); | |
6 | - | |
7 | -# --- !Downs | |
8 | - | |
9 | -drop table if exists user_enrolled_project; |
--- conf/evolutions/default/22.sql
... | ... | @@ -1,51 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -create table notification_event ( | |
4 | - id bigint not null, | |
5 | - title varchar(255), | |
6 | - message clob, | |
7 | - sender_id bigint, | |
8 | - created timestamp, | |
9 | - url_to_view varchar(255), | |
10 | - resource_type varchar(16), | |
11 | - resource_id bigint, | |
12 | - type varchar(255), | |
13 | - old_value clob, | |
14 | - new_value clob, | |
15 | - constraint ck_notification_event_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK')), | |
16 | - constraint pk_notification_event primary key (id)); | |
17 | - | |
18 | -create table notification_event_n4user ( | |
19 | - notification_event_id bigint not null, | |
20 | - n4user_id bigint not null, | |
21 | - constraint pk_notification_event_n4user primary key (notification_event_id, n4user_id)); | |
22 | - | |
23 | -create table notification_mail ( | |
24 | - id bigint not null, | |
25 | - notification_event_id bigint, | |
26 | - constraint pk_notification_mail primary key (id)) | |
27 | -; | |
28 | - | |
29 | -create sequence notification_event_seq; | |
30 | - | |
31 | -alter table notification_event_n4user add constraint fk_notification_event_n4user__01 foreign key (notification_event_id) references notification_event (id) on delete restrict on update restrict; | |
32 | - | |
33 | -alter table notification_event_n4user add constraint fk_notification_event_n4user__02 foreign key (n4user_id) references n4user (id) on delete restrict on update restrict; | |
34 | - | |
35 | -create sequence notification_mail_seq; | |
36 | - | |
37 | -alter table notification_mail add constraint fk_notification_mail_notificat_9 foreign key (notification_event_id) references notification_event (id) on delete restrict on update restrict; | |
38 | - | |
39 | -create index ix_notification_mail_notificat_9 on notification_mail (notification_event_id); | |
40 | - | |
41 | -# --- !Downs | |
42 | - | |
43 | -drop table if exists notification_event; | |
44 | - | |
45 | -drop table if exists notification_event_n4user; | |
46 | - | |
47 | -drop sequence if exists notification_event_seq; | |
48 | - | |
49 | -drop table if exists notification_mail; | |
50 | - | |
51 | -drop sequence if exists notification_mail_seq; |
--- conf/evolutions/default/23.sql
... | ... | @@ -1,52 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -create table commit_explicit_watching ( | |
4 | - id bigint not null, | |
5 | - project_id bigint, | |
6 | - commit_id varchar(255), | |
7 | - constraint pk_commit_explicit_watching primary key (id)) | |
8 | -; | |
9 | - | |
10 | -create table commit_explicit_watcher ( | |
11 | - commit_explicit_watching_id bigint not null, | |
12 | - n4user_id bigint not null, | |
13 | - constraint pk_commit_explicit_watcher primary key (commit_explicit_watching_id, n4user_id)) | |
14 | -; | |
15 | - | |
16 | -create table commit_explicit_unwatcher ( | |
17 | - commit_explicit_watching_id bigint not null, | |
18 | - n4user_id bigint not null, | |
19 | - constraint pk_commit_explicit_unwatcher primary key (commit_explicit_watching_id, n4user_id)) | |
20 | -; | |
21 | - | |
22 | -create sequence commit_explicit_watching_seq; | |
23 | - | |
24 | -alter table commit_explicit_watching add constraint fk_commit_explicit_watching_pr_4 foreign key (project_id) references project (id) on delete restrict on update restrict; | |
25 | - | |
26 | -create index ix_commit_explicit_watching_pr_4 on commit_explicit_watching (project_id); | |
27 | - | |
28 | -alter table commit_explicit_watcher add constraint fk_commit_explicit_watcher_co_01 foreign key (commit_explicit_watching_id) references commit_explicit_watching (id) on delete restrict on update restrict; | |
29 | - | |
30 | -alter table commit_explicit_watcher add constraint fk_commit_explicit_watcher_n4_02 foreign key (n4user_id) references n4user (id) on delete restrict on update restrict; | |
31 | - | |
32 | -alter table commit_explicit_unwatcher add constraint fk_commit_explicit_unwatcher__01 foreign key (commit_explicit_watching_id) references commit_explicit_watching (id) on delete restrict on update restrict; | |
33 | - | |
34 | -alter table commit_explicit_unwatcher add constraint fk_commit_explicit_unwatcher__02 foreign key (n4user_id) references n4user (id) on delete restrict on update restrict; | |
35 | - | |
36 | -ALTER TABLE notification_event DROP CONSTRAINT IF EXISTS ck_notification_event_resource_type; | |
37 | - | |
38 | -ALTER TABLE notification_event ADD CONSTRAINT ck_notification_event_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK', 'CODE_COMMENT')); | |
39 | - | |
40 | -# --- !Downs | |
41 | - | |
42 | -drop table if exists commit_explicit_watching; | |
43 | - | |
44 | -drop table if exists commit_explicit_watcher; | |
45 | - | |
46 | -drop table if exists commit_explicit_unwatcher; | |
47 | - | |
48 | -drop sequence if exists commit_explicit_watching_seq; | |
49 | - | |
50 | -ALTER TABLE notification_event DROP CONSTRAINT IF EXISTS ck_notification_event_resource_type; | |
51 | - | |
52 | -ALTER TABLE notification_event ADD CONSTRAINT ck_notification_event_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK')); |
--- conf/evolutions/default/24.sql
... | ... | @@ -1,9 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_attachment_container_type; | |
4 | -ALTER TABLE attachment ADD CONSTRAINT ck_attachment_container_type check (container_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','CODE_COMMENT', 'PULL_REQUEST')); | |
5 | - | |
6 | -# --- !Downs | |
7 | - | |
8 | -ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_attachment_container_type; | |
9 | -ALTER TABLE attachment ADD CONSTRAINT ck_attachment_container_type check (container_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','CODE_COMMENT')); |
--- conf/evolutions/default/25.sql
... | ... | @@ -1,7 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE pull_request ADD COLUMN last_commit_id varchar(255); | |
4 | - | |
5 | -# --- !Downs | |
6 | - | |
7 | -ALTER TABLE pull_request DROP COLUMN last_commit_id; |
--- conf/evolutions/default/26.sql
... | ... | @@ -1,9 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE pull_request ADD COLUMN merged_commit_id_from varchar(255); | |
4 | -ALTER TABLE pull_request ADD COLUMN merged_commit_id_to varchar(255); | |
5 | - | |
6 | -# --- !Downs | |
7 | - | |
8 | -ALTER TABLE pull_request DROP COLUMN merged_commit_id_from; | |
9 | -ALTER TABLE pull_request DROP COLUMN merged_commit_id_to; |
--- conf/evolutions/default/27.sql
... | ... | @@ -1,55 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -create table watch ( | |
4 | - id bigint not null, | |
5 | - user_id bigint, | |
6 | - resource_type varchar(16), | |
7 | - resource_id varchar(255), | |
8 | - constraint ck_watch_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK','CODE_COMMENT','PULL_REQUEST','SIMPLE_COMMENT', 'COMMIT')), | |
9 | - constraint pk_watch primary key (id)) | |
10 | -; | |
11 | - | |
12 | -create table unwatch ( | |
13 | - id bigint not null, | |
14 | - user_id bigint, | |
15 | - resource_type varchar(16), | |
16 | - resource_id varchar(255), | |
17 | - constraint ck_unwatch_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK','CODE_COMMENT','PULL_REQUEST','SIMPLE_COMMENT', 'COMMIT')), | |
18 | - constraint pk_unwatch primary key (id)) | |
19 | -; | |
20 | - | |
21 | -create sequence watch_seq; | |
22 | - | |
23 | -create sequence unwatch_seq; | |
24 | - | |
25 | -alter table unwatch add constraint fk_unwatch_unwatcher_23 foreign key (user_id) references n4user (id) on delete restrict on update restrict; | |
26 | - | |
27 | -create index ix_unwatch_unwatcher_23 on unwatch (user_id); | |
28 | - | |
29 | -alter table watch add constraint fk_watch_watcher_24 foreign key (user_id) references n4user (id) on delete restrict on update restrict; | |
30 | - | |
31 | -create index ix_watch_watcher_24 on watch (user_id); | |
32 | - | |
33 | -drop table if exists user_watching_project; | |
34 | - | |
35 | -drop table if exists commit_explicit_watching; | |
36 | - | |
37 | -drop table if exists commit_explicit_watcher; | |
38 | - | |
39 | -drop table if exists commit_explicit_unwatcher; | |
40 | - | |
41 | -drop sequence if exists commit_explicit_watching_seq; | |
42 | - | |
43 | -ALTER TABLE attachment ALTER COLUMN container_id TYPE varchar(255); | |
44 | - | |
45 | -# --- !Downs | |
46 | - | |
47 | -drop table if exists unwatch; | |
48 | - | |
49 | -drop table if exists watch; | |
50 | - | |
51 | -drop sequence if exists unwatch_seq; | |
52 | - | |
53 | -drop sequence if exists watch_seq; | |
54 | - | |
55 | -ALTER TABLE attachment ALTER COLUMN container_id TYPE bigint; |
--- conf/evolutions/default/28.sql
... | ... | @@ -1,17 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE n4user ADD COLUMN state VARCHAR(15); | |
4 | -ALTER TABLE n4user ADD COLUMN last_state_modified_date TIMESTAMP; | |
5 | -UPDATE n4user SET state='LOCKED' WHERE is_locked=true; | |
6 | -UPDATE n4user SET state='ACTIVE' WHERE is_locked=false; | |
7 | -ALTER TABLE n4user DROP COLUMN is_locked; | |
8 | -ALTER TABLE n4user ADD CONSTRAINT ck_n4user_state check (state in ('ACTIVE', 'LOCKED', 'DELETED')); | |
9 | - | |
10 | -# --- !Downs | |
11 | - | |
12 | -ALTER TABLE n4user DROP CONSTRAINT IF EXISTS ck_n4user_state; | |
13 | -ALTER TABLE n4user ADD COLUMN is_locked BOOLEAN DEFAULT FALSE; | |
14 | -UPDATE n4user SET is_locked=true WHERE state='LOCKED'; | |
15 | -UPDATE n4user SET is_locked=false WHERE state='ACTIVE'; | |
16 | -ALTER TABLE n4user DROP COLUMN state; | |
17 | -ALTER TABLE n4user DROP COLUMN last_state_modified_date; |
--- conf/evolutions/default/29.sql
... | ... | @@ -1,9 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE notification_event DROP CONSTRAINT IF EXISTS ck_notification_event_resource_type; | |
4 | -ALTER TABLE notification_event ADD constraint ck_notification_event_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK','CODE_COMMENT','PULL_REQUEST','SIMPLE_COMMENT')); | |
5 | - | |
6 | -# --- !Downs | |
7 | - | |
8 | -ALTER TABLE notification_event DROP CONSTRAINT IF EXISTS ck_notification_event_resource_type; | |
9 | -ALTER TABLE notification_event ADD CONSTRAINT ck_notification_event_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK')); |
--- conf/evolutions/default/3.sql
... | ... | @@ -1,17 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE issue ALTER COLUMN date RENAME TO created_date; | |
4 | -ALTER TABLE issue_comment ALTER COLUMN date RENAME TO created_date; | |
5 | -ALTER TABLE posting ALTER COLUMN date RENAME TO created_date; | |
6 | -ALTER TABLE posting_comment ALTER COLUMN date RENAME TO created_date; | |
7 | -ALTER TABLE project ALTER COLUMN date RENAME TO created_date; | |
8 | -ALTER TABLE n4user ALTER COLUMN date RENAME TO created_date; | |
9 | - | |
10 | -# --- !Downs | |
11 | - | |
12 | -ALTER TABLE issue ALTER COLUMN created_date RENAME TO date; | |
13 | -ALTER TABLE issue_comment ALTER COLUMN created_date RENAME TO date; | |
14 | -ALTER TABLE posting ALTER COLUMN created_date RENAME TO date; | |
15 | -ALTER TABLE posting_comment ALTER COLUMN created_date RENAME TO date; | |
16 | -ALTER TABLE project ALTER COLUMN created_date RENAME TO date; | |
17 | -ALTER TABLE n4user ALTER COLUMN created_date RENAME TO date; |
--- conf/evolutions/default/30.sql
... | ... | @@ -1,5 +0,0 @@ |
1 | -# --- !Ups | |
2 | -ALTER TABLE notification_event ALTER COLUMN type RENAME TO notification_type; | |
3 | - | |
4 | -# --- !Downs | |
5 | -ALTER TABLE notification_event ALTER COLUMN notification_type RENAME TO type; |
--- conf/evolutions/default/31.sql
... | ... | @@ -1,9 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE pull_request ADD COLUMN number BIGINT; | |
4 | -ALTER TABLE pull_request ADD CONSTRAINT uq_pull_request_1 UNIQUE (to_project_id,number); | |
5 | - | |
6 | -# --- !Downs | |
7 | - | |
8 | -ALTER TABLE pull_request DROP CONSTRAINT uq_pull_request_1; | |
9 | -ALTER TABLE pull_request DROP COLUMN number; |
--- conf/evolutions/default/32.sql
... | ... | @@ -1,28 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -create table user_project_notification ( | |
4 | - id bigint not null, | |
5 | - user_id bigint, | |
6 | - project_id bigint, | |
7 | - notification_type varchar(255), | |
8 | - allowed boolean, | |
9 | - | |
10 | - constraint pk_user_project_notification primary key (id)) | |
11 | -; | |
12 | - | |
13 | -create sequence user_project_notification_seq; | |
14 | - | |
15 | -alter table user_project_notification add constraint fk_user_project_notification_user_25 foreign key (user_id) references n4user (id) on delete restrict on update restrict; | |
16 | - | |
17 | -create index ix_user_project_notification_user_25 on user_project_notification (user_id); | |
18 | - | |
19 | -alter table user_project_notification add constraint fk_user_project_notification_project_26 foreign key (project_id) references project (id) on delete restrict on update restrict; | |
20 | - | |
21 | -create index ix_user_project_notification_project_26 on user_project_notification (project_id); | |
22 | - | |
23 | - | |
24 | -# --- !Downs | |
25 | - | |
26 | -drop table if exists user_project_notification; | |
27 | - | |
28 | -drop sequence if exists user_project_notification_seq; |
--- conf/evolutions/default/33.sql
... | ... | @@ -1,5 +0,0 @@ |
1 | -# --- !Ups | |
2 | -ALTER TABLE notification_event ALTER COLUMN notification_type RENAME TO event_type; | |
3 | - | |
4 | -# --- !Downs | |
5 | -ALTER TABLE notification_event ALTER COLUMN event_type RENAME TO notification_type; |
--- conf/evolutions/default/34.sql
... | ... | @@ -1,23 +0,0 @@ |
1 | -# --- !Ups | |
2 | -create table issue_event ( | |
3 | - id bigint not null, | |
4 | - created timestamp, | |
5 | - sender_login_id varchar(255), | |
6 | - issue_id bigint, | |
7 | - event_type varchar(26), | |
8 | - old_value varchar(255), | |
9 | - new_value varchar(255), | |
10 | - constraint ck_issue_event_event_type check (event_type in ('NEW_ISSUE','NEW_POSTING','ISSUE_ASSIGNEE_CHANGED','ISSUE_STATE_CHANGED','NEW_COMMENT','NEW_PULL_REQUEST','NEW_SIMPLE_COMMENT','PULL_REQUEST_STATE_CHANGED')), | |
11 | - constraint pk_issue_event primary key (id)) | |
12 | -; | |
13 | - | |
14 | -create sequence issue_event_seq; | |
15 | - | |
16 | -alter table issue_event add constraint fk_issue_event_issue_8 foreign key (issue_id) references issue (id) on delete restrict on update restrict; | |
17 | - | |
18 | -create index ix_issue_event_issue_8 on issue_event (issue_id); | |
19 | - | |
20 | -# --- !Downs | |
21 | -drop table if exists issue_event; | |
22 | - | |
23 | -drop sequence if exists issue_event_seq; |
--- conf/evolutions/default/35.sql
... | ... | @@ -1,11 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE issue ADD COLUMN updated_date TIMESTAMP; | |
4 | -ALTER TABLE posting ADD COLUMN updated_date TIMESTAMP; | |
5 | -UPDATE issue SET updated_date=created_date; | |
6 | -UPDATE posting SET updated_date=created_date; | |
7 | - | |
8 | -# --- !Downs | |
9 | - | |
10 | -ALTER TABLE issue DROP COLUMN updated_date; | |
11 | -ALTER TABLE posting DROP COLUMN updated_date; |
--- conf/evolutions/default/36.sql
... | ... | @@ -1,10 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE issue_event DROP CONSTRAINT IF EXISTS ck_issue_event_event_type; | |
4 | -ALTER TABLE issue_event ADD constraint ck_issue_event_event_type check (event_type in ('NEW_ISSUE','NEW_POSTING','ISSUE_ASSIGNEE_CHANGED','ISSUE_STATE_CHANGED','NEW_COMMENT','NEW_PULL_REQUEST','NEW_SIMPLE_COMMENT','PULL_REQUEST_STATE_CHANGED', 'ISSUE_REFERRED')); | |
5 | - | |
6 | -# --- !Downs | |
7 | - | |
8 | -ALTER TABLE issue_event DROP CONSTRAINT IF EXISTS ck_issue_event_event_type; | |
9 | -ALTER TABLE issue_event ADD CONSTRAINT ck_issue_event_event_type check (event_type in ('NEW_ISSUE','NEW_POSTING','ISSUE_ASSIGNEE_CHANGED','ISSUE_STATE_CHANGED','NEW_COMMENT','NEW_PULL_REQUEST','NEW_SIMPLE_COMMENT','PULL_REQUEST_STATE_CHANGED')); | |
10 | - |
--- conf/evolutions/default/37.sql
... | ... | @@ -1,23 +0,0 @@ |
1 | -# --- !Ups | |
2 | -create table pull_request_commit ( | |
3 | - id bigint not null, | |
4 | - pull_request_id bigint, | |
5 | - commit_id varchar(255), | |
6 | - commit_short_id varchar(7), | |
7 | - commit_message varchar(2000), | |
8 | - created timestamp, | |
9 | - author_date timestamp, | |
10 | - author_email varchar(255), | |
11 | - state varchar(10), | |
12 | - constraint pk_pull_request_commit primary key (id)) | |
13 | -; | |
14 | - | |
15 | -create sequence pull_request_commit_seq; | |
16 | - | |
17 | -alter table pull_request_commit add constraint fk_pull_request_commit_1 foreign key (pull_request_id) references pull_request(id) on delete restrict on update restrict; | |
18 | - | |
19 | -# --- !Downs | |
20 | -drop table if exists pull_request_commit; | |
21 | - | |
22 | -drop sequence if exists pull_request_commit_seq; | |
23 | - |
--- conf/evolutions/default/38.sql
... | ... | @@ -1,33 +0,0 @@ |
1 | -# --- !Ups | |
2 | -create table pull_request_event ( | |
3 | - id bigint not null, | |
4 | - pull_request_id bigint, | |
5 | - created timestamp, | |
6 | - sender_login_id varchar(255), | |
7 | - event_type varchar(255), | |
8 | - new_value varchar(255), | |
9 | - old_value varchar(255), | |
10 | - constraint pk_pull_request_event primary key (id)) | |
11 | -; | |
12 | - | |
13 | -create sequence pull_request_event_seq; | |
14 | - | |
15 | -alter table pull_request_event add constraint fk_pull_request_event_1 foreign key (pull_request_id) references pull_request(id) on delete restrict on update restrict; | |
16 | - | |
17 | -ALTER TABLE pull_request ADD COLUMN is_conflict boolean; | |
18 | -ALTER TABLE pull_request ADD COLUMN patch clob; | |
19 | -ALTER TABLE pull_request ADD COLUMN is_merging boolean; | |
20 | -ALTER TABLE pull_request ADD COLUMN conflict_files varchar(255); | |
21 | -UPDATE pull_request SET is_merging = false; | |
22 | -UPDATE pull_request SET is_conflict = false; | |
23 | - | |
24 | -# --- !Downs | |
25 | -drop table if exists pull_request_event; | |
26 | - | |
27 | -drop sequence if exists pull_request_event_seq; | |
28 | - | |
29 | -ALTER TABLE pull_request DROP COLUMN is_conflict; | |
30 | -ALTER TABLE pull_request DROP COLUMN patch; | |
31 | -ALTER TABLE pull_request DROP COLUMN is_merging; | |
32 | -ALTER TABLE pull_request DROP COLUMN conflict_files; | |
33 | - |
--- conf/evolutions/default/39.sql
... | ... | @@ -1,16 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -UPDATE NOTIFICATION_EVENT | |
4 | -set event_type = 'PULL_REQUEST_MERGED' | |
5 | -, OLD_VALUE = NEW_VALUE | |
6 | -, NEW_VALUE = 'conflict' | |
7 | -WHERE EVENT_TYPE = 'PULL_REQUEST_CONFLICTS' | |
8 | - | |
9 | -# --- !Downs | |
10 | - | |
11 | -UPDATE NOTIFICATION_EVENT | |
12 | -set event_type = 'PULL_REQUEST_CONFLICTS' | |
13 | -, NEW_VALUE = OLD_VALUE | |
14 | -, OLD_VALUE = '' | |
15 | -WHERE EVENT_TYPE = 'PULL_REQUEST_MERGED' | |
16 | -AND NEW_VALUE = 'conflict' |
--- conf/evolutions/default/4.sql
... | ... | @@ -1,63 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -DROP TABLE IF EXISTS task_board; | |
4 | -DROP TABLE IF EXISTS task_comment; | |
5 | -DROP TABLE IF EXISTS card; | |
6 | -DROP TABLE IF EXISTS card_assignee; | |
7 | -DROP TABLE IF EXISTS card_label; | |
8 | -DROP TABLE IF EXISTS checklist; | |
9 | - | |
10 | -DROP SEQUENCE IF EXISTS task_board_seq; | |
11 | -DROP SEQUENCE IF EXISTS task_comment_seq; | |
12 | -DROP SEQUENCE IF EXISTS card_seq; | |
13 | -DROP SEQUENCE IF EXISTS card_assignee_seq; | |
14 | -DROP SEQUENCE IF EXISTS card_label_seq; | |
15 | -DROP SEQUENCE IF EXISTS checklist_seq; | |
16 | - | |
17 | -# --- !Downs | |
18 | - | |
19 | -CREATE TABLE task_board ( | |
20 | - id BIGINT NOT NULL, | |
21 | - project_id BIGINT, | |
22 | - CONSTRAINT pk_task_board PRIMARY KEY (id)) | |
23 | -; | |
24 | - | |
25 | -CREATE TABLE task_comment ( | |
26 | - id BIGINT NOT NULL, | |
27 | - body VARCHAR(255), | |
28 | - card_id BIGINT, | |
29 | - CONSTRAINT pk_task_comment PRIMARY KEY (id)) | |
30 | -; | |
31 | - | |
32 | -CREATE TABLE task_board ( | |
33 | - id BIGINT NOT NULL, | |
34 | - project_id BIGINT, | |
35 | - CONSTRAINT pk_task_board PRIMARY KEY (id)) | |
36 | -; | |
37 | - | |
38 | -CREATE TABLE task_comment ( | |
39 | - id BIGINT NOT NULL, | |
40 | - body VARCHAR(255), | |
41 | - card_id BIGINT, | |
42 | - CONSTRAINT pk_task_comment PRIMARY KEY (id)) | |
43 | -; | |
44 | - | |
45 | -CREATE TABLE checklist ( | |
46 | - id BIGINT NOT NULL, | |
47 | - title VARCHAR(255), | |
48 | - CONSTRAINT pk_checklist PRIMARY KEY (id)) | |
49 | -; | |
50 | - | |
51 | -CREATE TABLE card_assignee ( | |
52 | - id BIGINT NOT NULL, | |
53 | - card_id BIGINT, | |
54 | - project_user_id BIGINT, | |
55 | - CONSTRAINT pk_card_assignee PRIMARY KEY (id)) | |
56 | -; | |
57 | - | |
58 | -CREATE SEQUENCE IF NOT EXISTS task_board_seq; | |
59 | -CREATE SEQUENCE IF NOT EXISTS task_comment_seq; | |
60 | -CREATE SEQUENCE IF NOT EXISTS card_seq; | |
61 | -CREATE SEQUENCE IF NOT EXISTS card_assignee_seq; | |
62 | -CREATE SEQUENCE IF NOT EXISTS card_label_seq; | |
63 | -CREATE SEQUENCE IF NOT EXISTS checklist_seq; |
--- conf/evolutions/default/40.sql
... | ... | @@ -1,10 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE pull_request_event alter column new_value clob; | |
4 | -ALTER TABLE pull_request_event alter column old_value clob; | |
5 | - | |
6 | -# --- !Downs | |
7 | - | |
8 | -ALTER TABLE pull_request_event alter column new_value varchar(255); | |
9 | -ALTER TABLE pull_request_event alter column old_value varchar(255); | |
10 | - |
--- conf/evolutions/default/41.sql
... | ... | @@ -1,101 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE simple_comment RENAME TO pull_request_comment; | |
4 | -DROP SEQUENCE IF EXISTS pull_request_comment_seq; | |
5 | -CREATE SEQUENCE pull_request_comment_seq START WITH simple_comment_seq.nextval; | |
6 | -DROP SEQUENCE IF EXISTS simple_comment_seq; | |
7 | -ALTER TABLE pull_request_comment ADD COLUMN project_id bigint; | |
8 | -ALTER TABLE pull_request_comment ADD COLUMN commit_a varchar(40); | |
9 | -ALTER TABLE pull_request_comment ADD COLUMN commit_b varchar(40); | |
10 | -ALTER TABLE pull_request_comment ADD COLUMN commit_id varchar(40); | |
11 | -ALTER TABLE pull_request_comment ADD COLUMN path varchar(255); | |
12 | -ALTER TABLE pull_request_comment ADD COLUMN line integer; | |
13 | -ALTER TABLE pull_request_comment ADD COLUMN side varchar(16); | |
14 | -ALTER TABLE pull_request_comment ADD COLUMN pull_request_id bigint; | |
15 | - | |
16 | -ALTER TABLE code_comment RENAME TO commit_comment; | |
17 | -DROP SEQUENCE IF EXISTS commit_comment_seq; | |
18 | -CREATE SEQUENCE commit_comment_seq START WITH code_comment_seq.nextval; | |
19 | -DROP SEQUENCE IF EXISTS code_commit_seq; | |
20 | - | |
21 | -ALTER TABLE notification_event DROP CONSTRAINT IF EXISTS ck_notification_event_resource_type; | |
22 | -ALTER TABLE notification_event ALTER COLUMN resource_type TYPE varchar(255); | |
23 | -UPDATE notification_event SET resource_type='COMMIT_COMMENT' WHERE resource_type='CODE_COMMENT'; | |
24 | -UPDATE notification_event SET event_type='NEW_COMMIT_COMMENT' WHERE event_type='NEW_CODE_COMMENT'; | |
25 | -UPDATE notification_event SET resource_type='PULL_REQUEST_COMMENT' WHERE resource_type='SIMPLE_COMMENT'; | |
26 | -UPDATE notification_event SET event_type='NEW_PULL_REQUEST_COMMENT' WHERE event_type='NEW_SIMPLE_COMMENT'; | |
27 | -ALTER TABLE notification_event ADD constraint ck_notification_event_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK','COMMIT_COMMENT','PULL_REQUEST','PULL_REQUEST_COMMENT')); | |
28 | - | |
29 | -ALTER TABLE watch DROP CONSTRAINT IF EXISTS ck_watch_resource_type; | |
30 | -ALTER TABLE watch ALTER COLUMN resource_type TYPE varchar(255); | |
31 | -UPDATE watch SET resource_type='COMMIT_COMMENT' WHERE resource_type='CODE_COMMENT'; | |
32 | -UPDATE watch SET resource_type='PULL_REQUEST_COMMENT' WHERE resource_type='SIMPLE_COMMENT'; | |
33 | -ALTER TABLE watch ADD CONSTRAINT ck_watch_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK','COMMIT_COMMENT','PULL_REQUEST','PULL_REQUEST_COMMENT', 'COMMIT')); | |
34 | - | |
35 | -ALTER TABLE unwatch DROP CONSTRAINT IF EXISTS ck_unwatch_resource_type; | |
36 | -ALTER TABLE unwatch ALTER COLUMN resource_type TYPE varchar(255); | |
37 | -UPDATE unwatch SET resource_type='COMMIT_COMMENT' WHERE resource_type='CODE_COMMENT'; | |
38 | -UPDATE unwatch SET resource_type='PULL_REQUEST_COMMENT' WHERE resource_type='SIMPLE_COMMENT'; | |
39 | -ALTER TABLE unwatch ADD CONSTRAINT ck_unwatch_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK','COMMIT_COMMENT','PULL_REQUEST','PULL_REQUEST_COMMENT', 'COMMIT')); | |
40 | - | |
41 | -ALTER TABLE issue_event DROP CONSTRAINT IF EXISTS ck_issue_event_event_type; | |
42 | -ALTER TABLE issue_event ALTER COLUMN event_type TYPE varchar(255); | |
43 | -UPDATE issue_event SET event_type='NEW_COMMIT_COMMENT' WHERE event_type='NEW_CODE_COMMENT'; | |
44 | -UPDATE issue_event SET event_type='NEW_PULL_REQUEST_COMMENT' WHERE event_type='NEW_SIMPLE_COMMENT'; | |
45 | -ALTER TABLE issue_event ADD CONSTRAINT ck_issue_event_event_type check (event_type in ('NEW_ISSUE','NEW_POSTING','ISSUE_ASSIGNEE_CHANGED','ISSUE_STATE_CHANGED','NEW_COMMENT','NEW_COMMIT_COMMENT','NEW_PULL_REQUEST','NEW_PULL_REQUEST_COMMENT','PULL_REQUEST_STATE_CHANGED','ISSUE_REFERRED')); | |
46 | - | |
47 | -ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_attachment_container_type; | |
48 | -UPDATE attachment SET container_type='COMMIT_COMMENT' WHERE container_type='CODE_COMMENT'; | |
49 | -UPDATE attachment SET container_type='PULL_REQUEST_COMMENT' WHERE container_type='SIMPLE_COMMENT'; | |
50 | -ALTER TABLE attachment ADD CONSTRAINT ck_attachment_container_type check (container_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','COMMIT_COMMENT', 'PULL_REQUEST_COMMENT', 'PULL_REQUEST')); | |
51 | - | |
52 | -# --- !Downs | |
53 | - | |
54 | -ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS project_id; | |
55 | -ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS commit_a; | |
56 | -ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS commit_b; | |
57 | -ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS commit_id; | |
58 | -ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS path; | |
59 | -ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS line; | |
60 | -ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS side; | |
61 | -ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS pull_request_id; | |
62 | -ALTER TABLE pull_request_comment RENAME TO simple_comment; | |
63 | -DROP SEQUENCE IF EXISTS simple_comment_seq; | |
64 | -CREATE SEQUENCE simple_comment_seq START WITH pull_request_comment_seq.nextval; | |
65 | -DROP SEQUENCE IF EXISTS pull_request_comment_seq; | |
66 | - | |
67 | -ALTER TABLE commit_comment RENAME TO code_comment; | |
68 | -DROP SEQUENCE IF EXISTS code_comment_seq; | |
69 | -CREATE SEQUENCE code_comment_seq START WITH commit_comment_seq.nextval; | |
70 | -DROP SEQUENCE IF EXISTS commit_comment_seq; | |
71 | - | |
72 | -ALTER TABLE notification_event DROP CONSTRAINT IF EXISTS ck_notification_event_resource_type; | |
73 | -UPDATE notification_event SET resource_type='CODE_COMMENT' WHERE resource_type='COMMIT_COMMENT'; | |
74 | -UPDATE notification_event SET event_type='NEW_CODE_COMMENT' WHERE event_type='NEW_COMMIT_COMMENT'; | |
75 | -UPDATE notification_event SET resource_type='SIMPLE_COMMENT' WHERE resource_type='PULL_REQUEST_COMMENT'; | |
76 | -UPDATE notification_event SET event_type='NEW_SIMPLE_COMMENT' WHERE event_type='NEW_PULL_REQUEST_COMMENT'; | |
77 | -ALTER TABLE notification_event ADD constraint ck_notification_event_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK','CODE_COMMENT','PULL_REQUEST','SIMPLE_COMMENT')); | |
78 | -ALTER TABLE notification_event ALTER COLUMN resource_type TYPE varchar(16); | |
79 | - | |
80 | -ALTER TABLE watch DROP CONSTRAINT IF EXISTS ck_watch_resource_type; | |
81 | -UPDATE watch SET resource_type='CODE_COMMENT' WHERE resource_type='COMMIT_COMMENT'; | |
82 | -UPDATE watch SET resource_type='SIMPLE_COMMENT' WHERE resource_type='PULL_REQUEST_COMMENT'; | |
83 | -ALTER TABLE watch ADD CONSTRAINT ck_watch_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK','CODE_COMMENT','PULL_REQUEST','SIMPLE_COMMENT', 'COMMIT')); | |
84 | -ALTER TABLE watch ALTER COLUMN resource_type TYPE varchar(16); | |
85 | - | |
86 | -ALTER TABLE unwatch DROP CONSTRAINT IF EXISTS ck_unwatch_resource_type; | |
87 | -UPDATE unwatch SET resource_type='CODE_COMMENT' WHERE resource_type='COMMIT_COMMENT'; | |
88 | -UPDATE unwatch SET resource_type='SIMPLE_COMMENT' WHERE resource_type='PULL_REQUEST_COMMENT'; | |
89 | -ALTER TABLE unwatch ADD CONSTRAINT ck_unwatch_resource_type check (resource_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','LABEL','PROJECT_LABELS','FORK','CODE_COMMENT','PULL_REQUEST','SIMPLE_COMMENT', 'COMMIT')); | |
90 | -ALTER TABLE unwatch ALTER COLUMN resource_type TYPE varchar(16); | |
91 | - | |
92 | -ALTER TABLE issue_event DROP CONSTRAINT IF EXISTS ck_issue_event_event_type; | |
93 | -UPDATE issue_event SET event_type='NEW_CODE_COMMENT' WHERE event_type='NEW_COMMIT_COMMENT'; | |
94 | -UPDATE issue_event SET event_type='NEW_SIMPLE_COMMENT' WHERE event_type='NEW_PULL_REQUEST_COMMENT'; | |
95 | -ALTER TABLE issue_event ADD constraint ck_issue_event_event_type check (event_type in ('NEW_ISSUE','NEW_POSTING','ISSUE_ASSIGNEE_CHANGED','ISSUE_STATE_CHANGED','NEW_COMMENT','NEW_PULL_REQUEST','NEW_SIMPLE_COMMENT','PULL_REQUEST_STATE_CHANGED', 'ISSUE_REFERRED')); | |
96 | -ALTER TABLE issue_event ALTER COLUMN event_type TYPE varchar(16); | |
97 | - | |
98 | -ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_attachment_container_type; | |
99 | -UPDATE attachment SET container_type='CODE_COMMENT' WHERE container_type='COMMIT_COMMENT'; | |
100 | -UPDATE attachment SET container_type='SIMPLE_COMMENT' WHERE container_type='PULL_REQUEST_COMMENT'; | |
101 | -ALTER TABLE attachment ADD CONSTRAINT ck_attachment_container_type check (container_type in ('ISSUE_POST','ISSUE_ASSIGNEE','ISSUE_STATE','ISSUE_CATEGORY','ISSUE_MILESTONE','ISSUE_LABEL','BOARD_POST','BOARD_CATEGORY','BOARD_NOTICE','CODE','MILESTONE','WIKI_PAGE','PROJECT_SETTING','SITE_SETTING','USER','USER_AVATAR','PROJECT','ATTACHMENT','ISSUE_COMMENT','NONISSUE_COMMENT','CODE_COMMENT', 'PULL_REQUEST')); |
--- conf/evolutions/default/42.sql
... | ... | @@ -1,7 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE pull_request DROP COLUMN patch; | |
4 | - | |
5 | -# --- !Downs | |
6 | - | |
7 | -ALTER TABLE pull_request ADD COLUMN patch clob; |
--- conf/evolutions/default/43.sql
... | ... | @@ -1,7 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -ALTER TABLE pull_request ALTER COLUMN conflict_files clob; | |
4 | - | |
5 | -# --- !Downs | |
6 | - | |
7 | -ALTER TABLE pull_request ALTER COLUMN conflict_files varchar(255); |
--- conf/evolutions/default/44.sql
... | ... | @@ -1,23 +0,0 @@ |
1 | -# --- !Ups | |
2 | - | |
3 | -DELETE FROM commit_comment WHERE side<>'context' and side<>'add' and side<>'remove'; | |
4 | -UPDATE commit_comment SET side='A' WHERE side='remove'; | |
5 | -UPDATE commit_comment SET side='B' WHERE side='context' or side='add'; | |
6 | -ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_commit_comment_side; | |
7 | -ALTER TABLE commit_comment ADD constraint ck_commit_comment_side check (side in ('A', 'B')); | |
8 | - | |
9 | -DELETE FROM pull_request_comment WHERE side<>'context' and side<>'add' and side<>'remove'; | |
10 | -UPDATE pull_request_comment SET side='A' WHERE side='remove'; | |
11 | -UPDATE pull_request_comment SET side='B' WHERE side='context' or side='add'; | |
12 | -ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_pull_request_comment_side; | |
13 | -ALTER TABLE pull_request_comment ADD constraint ck_pull_request_comment_side check (side in ('A', 'B')); | |
14 | - | |
15 | -# --- !Downs | |
16 | - | |
17 | -UPDATE commit_comment SET side='remove' WHERE side='A'; | |
18 | -UPDATE commit_comment SET side='add' WHERE side='B'; -- This possibly cause loss of a few comments' location. | |
19 | -ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_commit_comment_side; | |
20 | - | |
21 | -UPDATE pull_request_comment SET side='remove' WHERE side='A'; | |
22 | -UPDATE pull_request_comment SET side='add' WHERE side='B'; -- This possibly cause loss of a few comments' location. | |
23 | -ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_pull_request_comment_side; |
--- conf/evolutions/default/45.sql
... | ... | @@ -1,5 +0,0 @@ |
1 | -# --- !Ups | |
2 | -ALTER TABLE attachment DROP COLUMN project_id; | |
3 | - | |
4 | -# --- !Downs | |
5 | -ALTER TABLE attachment ADD COLUMN project_id bigint; |
--- conf/evolutions/default/46.sql