doortts doortts 2016-01-24
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
+++ conf/evolutions/default/1.sql
@@ -1,413 +1,757 @@
-# --- !Ups
-
+# --- Created by Ebean DDL
+# To stop Ebean DDL generation, remove this comment and start using Evolutions
+
+# --- !Ups
+
 create table assignee (
-  id                        bigint not null,
+  id                        bigint auto_increment not null,
   user_id                   bigint,
   project_id                bigint,
   constraint pk_assignee primary key (id))
 ;
 
 create table attachment (
-  id                        bigint not null,
+  id                        bigint auto_increment not null,
   name                      varchar(255),
   hash                      varchar(255),
-  project_id                bigint,
-  container_type            varchar(15),
+  container_type            varchar(20),
   mime_type                 varchar(255),
   size                      bigint,
-  container_id              bigint,
-  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')),
+  container_id              varchar(255),
+  created_date              datetime,
+  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')),
   constraint pk_attachment primary key (id))
 ;
 
-create table card (
-  id                        bigint not null,
-  title                     varchar(255),
-  checklist_id              bigint,
-  line_id                   bigint,
-  story_point               integer,
-  body                      varchar(255),
-  due_date                  timestamp,
-  constraint pk_card primary key (id))
-;
-
-create table card_assignee (
-  id                        bigint not null,
-  card_id                   bigint,
-  project_user_id           bigint,
-  constraint pk_card_assignee primary key (id))
-;
-
-create table card_label (
-  id                        bigint not null,
-  card_id                   bigint,
-  label_id                  bigint,
-  constraint pk_card_label primary key (id))
-;
-
-create table checklist (
-  id                        bigint not null,
-  title                     varchar(255),
-  constraint pk_checklist primary key (id))
-;
-
-create table comment (
-  id                        bigint not null,
-  contents                  varchar(4000),
-  date                      timestamp,
-  file_path                 varchar(255),
+create table comment_thread (
+  dtype                     varchar(10) not null,
+  id                        bigint auto_increment not null,
   author_id                 bigint,
   author_login_id           varchar(255),
   author_name               varchar(255),
-  post_id                   bigint,
-  constraint pk_comment primary key (id))
+  state                     varchar(6),
+  created_date              datetime,
+  pull_request_id           bigint,
+  project_id                bigint,
+  prev_commit_id            varchar(255),
+  commit_id                 varchar(255),
+  path                      varchar(255),
+  start_side                varchar(1),
+  start_line                integer,
+  start_column              integer,
+  end_side                  varchar(1),
+  end_line                  integer,
+  end_column                integer,
+  constraint ck_comment_thread_state check (state in ('OPEN','CLOSED')),
+  constraint ck_comment_thread_start_side check (start_side in ('A','B')),
+  constraint ck_comment_thread_end_side check (end_side in ('A','B')),
+  constraint pk_comment_thread primary key (id))
+;
+
+create table commit_comment (
+  id                        bigint auto_increment not null,
+  project_id                bigint,
+  path                      varchar(255),
+  line                      integer,
+  side                      varchar(1),
+  contents                  longtext,
+  created_date              datetime,
+  author_id                 bigint,
+  author_login_id           varchar(255),
+  author_name               varchar(255),
+  commit_id                 varchar(255),
+  constraint ck_commit_comment_side check (side in ('A','B')),
+  constraint pk_commit_comment primary key (id))
+;
+
+create table email (
+  id                        bigint auto_increment not null,
+  user_id                   bigint,
+  email                     varchar(255),
+  valid                     tinyint(1) default 0,
+  token                     varchar(255),
+  constraint pk_email primary key (id))
 ;
 
 create table issue (
-  id                        bigint not null,
+  id                        bigint auto_increment not null,
   title                     varchar(255),
-  body                      clob,
-  date                      timestamp,
-  num_of_comments           integer,
-  milestone_id              bigint,
+  body                      longtext,
+  created_date              datetime,
+  updated_date              datetime,
   author_id                 bigint,
   author_login_id           varchar(255),
   author_name               varchar(255),
-  state                     integer,
   project_id                bigint,
+  number                    bigint,
+  num_of_comments           integer,
+  state                     integer,
+  due_date                  datetime,
+  milestone_id              bigint,
   assignee_id               bigint,
-  constraint ck_issue_state check (state in (0,1,2)),
+  constraint ck_issue_state check (state in (0,1,2,3,4,5,6)),
+  constraint uq_issue_1 unique (project_id,number),
   constraint pk_issue primary key (id))
 ;
 
 create table issue_comment (
-  id                        bigint not null,
-  contents                  varchar(4000),
-  date                      timestamp,
+  id                        bigint auto_increment not null,
+  contents                  longtext,
+  created_date              datetime,
   author_id                 bigint,
   author_login_id           varchar(255),
   author_name               varchar(255),
-  file_path                 varchar(255),
   issue_id                  bigint,
   constraint pk_issue_comment primary key (id))
 ;
 
+create table issue_event (
+  id                        bigint auto_increment not null,
+  created                   datetime,
+  sender_login_id           varchar(255),
+  sender_email              varchar(255),
+  issue_id                  bigint,
+  event_type                varchar(34),
+  old_value                 varchar(255),
+  new_value                 varchar(255),
+  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')),
+  constraint pk_issue_event primary key (id))
+;
+
 create table issue_label (
-  id                        bigint not null,
-  category                  varchar(255),
+  id                        bigint auto_increment not null,
+  category_id               bigint,
   color                     varchar(255),
   name                      varchar(255),
   project_id                bigint,
   constraint pk_issue_label primary key (id))
 ;
 
-create table item (
-  id                        bigint not null,
-  state                     boolean,
-  body                      varchar(255),
-  checklist_id              bigint,
-  constraint pk_item primary key (id))
+create table issue_label_category (
+  id                        bigint auto_increment not null,
+  project_id                bigint,
+  name                      varchar(255),
+  is_exclusive              tinyint(1) default 0,
+  constraint pk_issue_label_category primary key (id))
 ;
 
 create table label (
-  id                        bigint not null,
+  id                        bigint auto_increment not null,
+  category                  varchar(255),
   name                      varchar(255),
-  color                     varchar(255),
-  task_board_id             bigint,
+  constraint uq_label_1 unique (category,name),
   constraint pk_label primary key (id))
 ;
 
-create table line (
-  id                        bigint not null,
-  title                     varchar(255),
-  task_board_id             bigint,
-  constraint pk_line primary key (id))
+create table mention (
+  id                        bigint auto_increment not null,
+  resource_type             varchar(20),
+  resource_id               varchar(255),
+  user_id                   bigint,
+  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')),
+  constraint pk_mention primary key (id))
 ;
 
 create table milestone (
-  id                        bigint not null,
+  id                        bigint auto_increment not null,
   title                     varchar(255),
-  due_date                  timestamp,
-  contents                  clob,
+  due_date                  datetime,
+  contents                  longtext,
   state                     integer,
   project_id                bigint,
-  constraint ck_milestone_state check (state in (0,1,2)),
+  constraint ck_milestone_state check (state in (0,1,2,3,4,5,6)),
+  constraint uq_milestone_1 unique (project_id,title),
   constraint pk_milestone primary key (id))
 ;
 
-create table post (
-  id                        bigint not null,
+create table notification_event (
+  id                        bigint auto_increment not null,
   title                     varchar(255),
-  contents                  clob,
-  date                      timestamp,
-  comment_count             integer,
-  file_path                 varchar(255),
+  sender_id                 bigint,
+  created                   datetime,
+  resource_type             varchar(20),
+  resource_id               varchar(255),
+  event_type                varchar(34),
+  old_value                 longtext,
+  new_value                 longtext,
+  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')),
+  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')),
+  constraint pk_notification_event primary key (id))
+;
+
+create table notification_mail (
+  id                        bigint auto_increment not null,
+  notification_event_id     bigint,
+  constraint pk_notification_mail primary key (id))
+;
+
+create table organization (
+  id                        bigint auto_increment not null,
+  name                      varchar(255),
+  created                   datetime,
+  descr                     varchar(255),
+  constraint pk_organization primary key (id))
+;
+
+create table organization_user (
+  id                        bigint auto_increment not null,
+  user_id                   bigint,
+  organization_id           bigint,
+  role_id                   bigint,
+  constraint pk_organization_user primary key (id))
+;
+
+create table original_email (
+  id                        bigint auto_increment not null,
+  message_id                varchar(255),
+  resource_type             varchar(20),
+  resource_id               varchar(255),
+  handled_date              datetime,
+  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')),
+  constraint uq_original_email_message_id unique (message_id),
+  constraint uq_original_email_1 unique (resource_type,resource_id),
+  constraint pk_original_email primary key (id))
+;
+
+create table posting (
+  id                        bigint auto_increment not null,
+  title                     varchar(255),
+  body                      longtext,
+  created_date              datetime,
+  updated_date              datetime,
   author_id                 bigint,
   author_login_id           varchar(255),
   author_name               varchar(255),
   project_id                bigint,
-  constraint pk_post primary key (id))
+  number                    bigint,
+  num_of_comments           integer,
+  notice                    tinyint(1) default 0,
+  readme                    tinyint(1) default 0,
+  constraint uq_posting_1 unique (project_id,number),
+  constraint pk_posting primary key (id))
+;
+
+create table posting_comment (
+  id                        bigint auto_increment not null,
+  contents                  longtext,
+  created_date              datetime,
+  author_id                 bigint,
+  author_login_id           varchar(255),
+  author_name               varchar(255),
+  posting_id                bigint,
+  constraint pk_posting_comment primary key (id))
 ;
 
 create table project (
-  id                        bigint not null,
+  id                        bigint auto_increment not null,
   name                      varchar(255),
   overview                  varchar(255),
   vcs                       varchar(255),
   siteurl                   varchar(255),
-  logo_path                 varchar(255),
   owner                     varchar(255),
-  share_option              boolean,
-  is_author_editable        boolean,
-  date                      timestamp,
+  created_date              datetime,
+  last_issue_number         bigint,
+  last_posting_number       bigint,
+  original_project_id       bigint,
+  last_pushed_date          datetime,
+  default_reviewer_count    integer,
+  is_using_reviewer_count   tinyint(1) default 0,
+  organization_id           bigint,
+  project_scope             varchar(9),
+  previous_owner_login_id   varchar(255),
+  previous_name             varchar(255),
+  previous_name_changed_time bigint,
+  constraint ck_project_project_scope check (project_scope in ('PRIVATE','PROTECTED','PUBLIC')),
   constraint pk_project primary key (id))
 ;
 
+create table project_menu_setting (
+  id                        bigint auto_increment not null,
+  project_id                bigint,
+  code                      tinyint(1) default 0,
+  issue                     tinyint(1) default 0,
+  pull_request              tinyint(1) default 0,
+  review                    tinyint(1) default 0,
+  milestone                 tinyint(1) default 0,
+  board                     tinyint(1) default 0,
+  constraint pk_project_menu_setting primary key (id))
+;
+
+create table project_transfer (
+  id                        bigint auto_increment not null,
+  sender_id                 bigint,
+  destination               varchar(255),
+  project_id                bigint,
+  requested                 datetime,
+  confirm_key               varchar(255),
+  accepted                  tinyint(1) default 0,
+  new_project_name          varchar(255),
+  constraint pk_project_transfer primary key (id))
+;
+
 create table project_user (
-  id                        bigint not null,
+  id                        bigint auto_increment not null,
   user_id                   bigint,
   project_id                bigint,
   role_id                   bigint,
   constraint pk_project_user primary key (id))
 ;
 
-create table role (
-  id                        bigint not null,
+create table project_visitation (
+  id                        bigint auto_increment not null,
+  project_id                bigint,
+  recently_visited_projects_id bigint,
+  visited                   datetime,
+  constraint uq_project_visitation_1 unique (project_id,recently_visited_projects_id),
+  constraint pk_project_visitation primary key (id))
+;
+
+create table property (
+  id                        bigint auto_increment not null,
+  name                      varchar(25),
+  value                     varchar(255),
+  constraint ck_property_name check (name in ('MAILBOX_LAST_SEEN_UID','MAILBOX_LAST_UID_VALIDITY')),
+  constraint pk_property primary key (id))
+;
+
+create table pull_request (
+  id                        bigint auto_increment not null,
+  title                     varchar(255),
+  body                      longtext,
+  to_project_id             bigint,
+  from_project_id           bigint,
+  to_branch                 varchar(255),
+  from_branch               varchar(255),
+  contributor_id            bigint,
+  receiver_id               bigint,
+  created                   datetime,
+  updated                   datetime,
+  received                  datetime,
+  state                     integer,
+  is_conflict               tinyint(1) default 0,
+  is_merging                tinyint(1) default 0,
+  last_commit_id            varchar(255),
+  merged_commit_id_from     varchar(255),
+  merged_commit_id_to       varchar(255),
+  number                    bigint,
+  constraint ck_pull_request_state check (state in (0,1,2,3,4,5,6)),
+  constraint pk_pull_request primary key (id))
+;
+
+create table pull_request_commit (
+  id                        bigint auto_increment not null,
+  pull_request_id           bigint,
+  commit_id                 varchar(255),
+  author_date               datetime,
+  created                   datetime,
+  commit_message            longtext,
+  commit_short_id           varchar(255),
+  author_email              varchar(255),
+  state                     varchar(7),
+  constraint ck_pull_request_commit_state check (state in ('PRIOR','CURRENT')),
+  constraint pk_pull_request_commit primary key (id))
+;
+
+create table pull_request_event (
+  id                        bigint auto_increment not null,
+  sender_login_id           varchar(255),
+  pull_request_id           bigint,
+  event_type                varchar(34),
+  created                   datetime,
+  old_value                 longtext,
+  new_value                 longtext,
+  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')),
+  constraint pk_pull_request_event primary key (id))
+;
+
+create table project_pushed_branch (
+  id                        bigint auto_increment not null,
+  pushed_date               datetime,
   name                      varchar(255),
-  active                    boolean,
+  project_id                bigint,
+  constraint pk_project_pushed_branch primary key (id))
+;
+
+create table recently_visited_projects (
+  id                        bigint auto_increment not null,
+  user_id                   bigint,
+  constraint pk_recently_visited_projects primary key (id))
+;
+
+create table review_comment (
+  id                        bigint auto_increment not null,
+  contents                  longtext,
+  created_date              datetime,
+  author_id                 bigint,
+  author_login_id           varchar(255),
+  author_name               varchar(255),
+  thread_id                 bigint,
+  constraint pk_review_comment primary key (id))
+;
+
+create table role (
+  id                        bigint auto_increment not null,
+  name                      varchar(255),
+  active                    tinyint(1) default 0,
   constraint pk_role primary key (id))
 ;
 
 create table site_admin (
-  id                        bigint not null,
+  id                        bigint auto_increment not null,
   admin_id                  bigint,
   constraint pk_site_admin primary key (id))
 ;
 
-create table task_board (
-  id                        bigint not null,
-  project_id                bigint,
-  constraint pk_task_board primary key (id))
-;
-
-create table task_comment (
-  id                        bigint not null,
-  body                      varchar(255),
-  card_id                   bigint,
-  constraint pk_task_comment primary key (id))
+create table unwatch (
+  id                        bigint auto_increment not null,
+  user_id                   bigint,
+  resource_type             varchar(20),
+  resource_id               varchar(255),
+  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')),
+  constraint pk_unwatch primary key (id))
 ;
 
 create table n4user (
-  id                        bigint not null,
+  id                        bigint auto_increment not null,
   name                      varchar(255),
   login_id                  varchar(255),
   password                  varchar(255),
   password_salt             varchar(255),
   email                     varchar(255),
-  avatar_url                varchar(255),
-  remember_me               boolean,
-  date                      timestamp,
+  remember_me               tinyint(1) default 0,
+  state                     varchar(7),
+  last_state_modified_date  datetime,
+  created_date              datetime,
+  lang                      varchar(255),
+  constraint ck_n4user_state check (state in ('ACTIVE','LOCKED','DELETED')),
   constraint pk_n4user primary key (id))
 ;
 
+create table user_project_notification (
+  id                        bigint auto_increment not null,
+  user_id                   bigint,
+  project_id                bigint,
+  notification_type         varchar(34),
+  allowed                   tinyint(1) default 0,
+  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')),
+  constraint uq_user_project_notification_1 unique (project_id,user_id,notification_type),
+  constraint pk_user_project_notification primary key (id))
+;
+
+create table watch (
+  id                        bigint auto_increment not null,
+  user_id                   bigint,
+  resource_type             varchar(20),
+  resource_id               varchar(255),
+  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')),
+  constraint pk_watch primary key (id))
+;
+
+create table webhook (
+  id                        bigint auto_increment not null,
+  project_id                bigint,
+  payload_url               varchar(2000),
+  secret                    varchar(250),
+  created_at                datetime,
+  constraint pk_webhook primary key (id))
+;
+
+
+create table comment_thread_n4user (
+  comment_thread_id              bigint not null,
+  n4user_id                      bigint not null,
+  constraint pk_comment_thread_n4user primary key (comment_thread_id, n4user_id))
+;
 
 create table issue_issue_label (
   issue_id                       bigint not null,
   issue_label_id                 bigint not null,
   constraint pk_issue_issue_label primary key (issue_id, issue_label_id))
 ;
-create sequence assignee_seq;
 
-create sequence attachment_seq;
+create table issue_voter (
+  issue_id                       bigint not null,
+  user_id                        bigint not null,
+  constraint pk_issue_voter primary key (issue_id, user_id))
+;
 
-create sequence card_seq;
+create table issue_comment_voter (
+  issue_comment_id               bigint not null,
+  user_id                        bigint not null,
+  constraint pk_issue_comment_voter primary key (issue_comment_id, user_id))
+;
 
-create sequence card_assignee_seq;
+create table notification_event_n4user (
+  notification_event_id          bigint not null,
+  n4user_id                      bigint not null,
+  constraint pk_notification_event_n4user primary key (notification_event_id, n4user_id))
+;
 
-create sequence card_label_seq;
+create table posting_issue_label (
+  posting_id                     bigint not null,
+  issue_label_id                 bigint not null,
+  constraint pk_posting_issue_label primary key (posting_id, issue_label_id))
+;
 
-create sequence checklist_seq;
+create table project_label (
+  project_id                     bigint not null,
+  label_id                       bigint not null,
+  constraint pk_project_label primary key (project_id, label_id))
+;
 
-create sequence comment_seq;
+create table pull_request_reviewers (
+  pull_request_id                bigint not null,
+  user_id                        bigint not null,
+  constraint pk_pull_request_reviewers primary key (pull_request_id, user_id))
+;
 
-create sequence issue_seq;
+create table user_enrolled_project (
+  user_id                        bigint not null,
+  project_id                     bigint not null,
+  constraint pk_user_enrolled_project primary key (user_id, project_id))
+;
 
-create sequence issue_comment_seq;
-
-create sequence issue_label_seq;
-
-create sequence item_seq;
-
-create sequence label_seq;
-
-create sequence line_seq;
-
-create sequence milestone_seq;
-
-create sequence post_seq;
-
-create sequence project_seq;
-
-create sequence project_user_seq;
-
-create sequence role_seq;
-
-create sequence site_admin_seq;
-
-create sequence task_board_seq;
-
-create sequence task_comment_seq;
-
-create sequence n4user_seq;
-
+create table user_enrolled_organization (
+  user_id                        bigint not null,
+  organization_id                bigint not null,
+  constraint pk_user_enrolled_organization primary key (user_id, organization_id))
+;
 alter table assignee add constraint fk_assignee_user_1 foreign key (user_id) references n4user (id) on delete restrict on update restrict;
 create index ix_assignee_user_1 on assignee (user_id);
 alter table assignee add constraint fk_assignee_project_2 foreign key (project_id) references project (id) on delete restrict on update restrict;
 create index ix_assignee_project_2 on assignee (project_id);
-alter table card add constraint fk_card_checklist_3 foreign key (checklist_id) references checklist (id) on delete restrict on update restrict;
-create index ix_card_checklist_3 on card (checklist_id);
-alter table card add constraint fk_card_line_4 foreign key (line_id) references line (id) on delete restrict on update restrict;
-create index ix_card_line_4 on card (line_id);
-alter table card_assignee add constraint fk_card_assignee_card_5 foreign key (card_id) references card (id) on delete restrict on update restrict;
-create index ix_card_assignee_card_5 on card_assignee (card_id);
-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;
-create index ix_card_assignee_projectUser_6 on card_assignee (project_user_id);
-alter table card_label add constraint fk_card_label_card_7 foreign key (card_id) references card (id) on delete restrict on update restrict;
-create index ix_card_label_card_7 on card_label (card_id);
-alter table card_label add constraint fk_card_label_label_8 foreign key (label_id) references label (id) on delete restrict on update restrict;
-create index ix_card_label_label_8 on card_label (label_id);
-alter table comment add constraint fk_comment_post_9 foreign key (post_id) references post (id) on delete restrict on update restrict;
-create index ix_comment_post_9 on comment (post_id);
-alter table issue add constraint fk_issue_project_10 foreign key (project_id) references project (id) on delete restrict on update restrict;
-create index ix_issue_project_10 on issue (project_id);
-alter table issue add constraint fk_issue_assignee_11 foreign key (assignee_id) references assignee (id) on delete restrict on update restrict;
-create index ix_issue_assignee_11 on issue (assignee_id);
-alter table issue_comment add constraint fk_issue_comment_issue_12 foreign key (issue_id) references issue (id) on delete restrict on update restrict;
-create index ix_issue_comment_issue_12 on issue_comment (issue_id);
+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;
+create index ix_comment_thread_pullRequest_3 on comment_thread (pull_request_id);
+alter table comment_thread add constraint fk_comment_thread_project_4 foreign key (project_id) references project (id) on delete restrict on update restrict;
+create index ix_comment_thread_project_4 on comment_thread (project_id);
+alter table commit_comment add constraint fk_commit_comment_project_5 foreign key (project_id) references project (id) on delete restrict on update restrict;
+create index ix_commit_comment_project_5 on commit_comment (project_id);
+alter table email add constraint fk_email_user_6 foreign key (user_id) references n4user (id) on delete restrict on update restrict;
+create index ix_email_user_6 on email (user_id);
+alter table issue add constraint fk_issue_project_7 foreign key (project_id) references project (id) on delete restrict on update restrict;
+create index ix_issue_project_7 on issue (project_id);
+alter table issue add constraint fk_issue_milestone_8 foreign key (milestone_id) references milestone (id) on delete restrict on update restrict;
+create index ix_issue_milestone_8 on issue (milestone_id);
+alter table issue add constraint fk_issue_assignee_9 foreign key (assignee_id) references assignee (id) on delete restrict on update restrict;
+create index ix_issue_assignee_9 on issue (assignee_id);
+alter table issue_comment add constraint fk_issue_comment_issue_10 foreign key (issue_id) references issue (id) on delete restrict on update restrict;
+create index ix_issue_comment_issue_10 on issue_comment (issue_id);
+alter table issue_event add constraint fk_issue_event_issue_11 foreign key (issue_id) references issue (id) on delete restrict on update restrict;
+create index ix_issue_event_issue_11 on issue_event (issue_id);
+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;
+create index ix_issue_label_category_12 on issue_label (category_id);
 alter table issue_label add constraint fk_issue_label_project_13 foreign key (project_id) references project (id) on delete restrict on update restrict;
 create index ix_issue_label_project_13 on issue_label (project_id);
-alter table item add constraint fk_item_checklist_14 foreign key (checklist_id) references checklist (id) on delete restrict on update restrict;
-create index ix_item_checklist_14 on item (checklist_id);
-alter table label add constraint fk_label_taskBoard_15 foreign key (task_board_id) references task_board (id) on delete restrict on update restrict;
-create index ix_label_taskBoard_15 on label (task_board_id);
-alter table line add constraint fk_line_taskBoard_16 foreign key (task_board_id) references task_board (id) on delete restrict on update restrict;
-create index ix_line_taskBoard_16 on line (task_board_id);
-alter table milestone add constraint fk_milestone_project_17 foreign key (project_id) references project (id) on delete restrict on update restrict;
-create index ix_milestone_project_17 on milestone (project_id);
-alter table post add constraint fk_post_project_18 foreign key (project_id) references project (id) on delete restrict on update restrict;
-create index ix_post_project_18 on post (project_id);
-alter table project_user add constraint fk_project_user_user_19 foreign key (user_id) references n4user (id) on delete restrict on update restrict;
-create index ix_project_user_user_19 on project_user (user_id);
-alter table project_user add constraint fk_project_user_project_20 foreign key (project_id) references project (id) on delete restrict on update restrict;
-create index ix_project_user_project_20 on project_user (project_id);
-alter table project_user add constraint fk_project_user_role_21 foreign key (role_id) references role (id) on delete restrict on update restrict;
-create index ix_project_user_role_21 on project_user (role_id);
-alter table site_admin add constraint fk_site_admin_admin_22 foreign key (admin_id) references n4user (id) on delete restrict on update restrict;
-create index ix_site_admin_admin_22 on site_admin (admin_id);
-alter table task_board add constraint fk_task_board_project_23 foreign key (project_id) references project (id) on delete restrict on update restrict;
-create index ix_task_board_project_23 on task_board (project_id);
-alter table task_comment add constraint fk_task_comment_card_24 foreign key (card_id) references card (id) on delete restrict on update restrict;
-create index ix_task_comment_card_24 on task_comment (card_id);
+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;
+create index ix_issue_label_category_project_14 on issue_label_category (project_id);
+alter table mention add constraint fk_mention_user_15 foreign key (user_id) references n4user (id) on delete restrict on update restrict;
+create index ix_mention_user_15 on mention (user_id);
+alter table milestone add constraint fk_milestone_project_16 foreign key (project_id) references project (id) on delete restrict on update restrict;
+create index ix_milestone_project_16 on milestone (project_id);
+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;
+create index ix_notification_mail_notificationEvent_17 on notification_mail (notification_event_id);
+alter table organization_user add constraint fk_organization_user_user_18 foreign key (user_id) references n4user (id) on delete restrict on update restrict;
+create index ix_organization_user_user_18 on organization_user (user_id);
+alter table organization_user add constraint fk_organization_user_organization_19 foreign key (organization_id) references organization (id) on delete restrict on update restrict;
+create index ix_organization_user_organization_19 on organization_user (organization_id);
+alter table organization_user add constraint fk_organization_user_role_20 foreign key (role_id) references role (id) on delete restrict on update restrict;
+create index ix_organization_user_role_20 on organization_user (role_id);
+alter table posting add constraint fk_posting_project_21 foreign key (project_id) references project (id) on delete restrict on update restrict;
+create index ix_posting_project_21 on posting (project_id);
+alter table posting_comment add constraint fk_posting_comment_posting_22 foreign key (posting_id) references posting (id) on delete restrict on update restrict;
+create index ix_posting_comment_posting_22 on posting_comment (posting_id);
+alter table project add constraint fk_project_originalProject_23 foreign key (original_project_id) references project (id) on delete restrict on update restrict;
+create index ix_project_originalProject_23 on project (original_project_id);
+alter table project add constraint fk_project_organization_24 foreign key (organization_id) references organization (id) on delete restrict on update restrict;
+create index ix_project_organization_24 on project (organization_id);
+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;
+create index ix_project_menu_setting_project_25 on project_menu_setting (project_id);
+alter table project_transfer add constraint fk_project_transfer_sender_26 foreign key (sender_id) references n4user (id) on delete restrict on update restrict;
+create index ix_project_transfer_sender_26 on project_transfer (sender_id);
+alter table project_transfer add constraint fk_project_transfer_project_27 foreign key (project_id) references project (id) on delete restrict on update restrict;
+create index ix_project_transfer_project_27 on project_transfer (project_id);
+alter table project_user add constraint fk_project_user_user_28 foreign key (user_id) references n4user (id) on delete restrict on update restrict;
+create index ix_project_user_user_28 on project_user (user_id);
+alter table project_user add constraint fk_project_user_project_29 foreign key (project_id) references project (id) on delete restrict on update restrict;
+create index ix_project_user_project_29 on project_user (project_id);
+alter table project_user add constraint fk_project_user_role_30 foreign key (role_id) references role (id) on delete restrict on update restrict;
+create index ix_project_user_role_30 on project_user (role_id);
+alter table project_visitation add constraint fk_project_visitation_project_31 foreign key (project_id) references project (id) on delete restrict on update restrict;
+create index ix_project_visitation_project_31 on project_visitation (project_id);
+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;
+create index ix_project_visitation_recentlyVisitedProjects_32 on project_visitation (recently_visited_projects_id);
+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;
+create index ix_pull_request_toProject_33 on pull_request (to_project_id);
+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;
+create index ix_pull_request_fromProject_34 on pull_request (from_project_id);
+alter table pull_request add constraint fk_pull_request_contributor_35 foreign key (contributor_id) references n4user (id) on delete restrict on update restrict;
+create index ix_pull_request_contributor_35 on pull_request (contributor_id);
+alter table pull_request add constraint fk_pull_request_receiver_36 foreign key (receiver_id) references n4user (id) on delete restrict on update restrict;
+create index ix_pull_request_receiver_36 on pull_request (receiver_id);
+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;
+create index ix_pull_request_commit_pullRequest_37 on pull_request_commit (pull_request_id);
+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;
+create index ix_pull_request_event_pullRequest_38 on pull_request_event (pull_request_id);
+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;
+create index ix_project_pushed_branch_project_39 on project_pushed_branch (project_id);
+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;
+create index ix_recently_visited_projects_user_40 on recently_visited_projects (user_id);
+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;
+create index ix_review_comment_thread_41 on review_comment (thread_id);
+alter table site_admin add constraint fk_site_admin_admin_42 foreign key (admin_id) references n4user (id) on delete restrict on update restrict;
+create index ix_site_admin_admin_42 on site_admin (admin_id);
+alter table unwatch add constraint fk_unwatch_user_43 foreign key (user_id) references n4user (id) on delete restrict on update restrict;
+create index ix_unwatch_user_43 on unwatch (user_id);
+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;
+create index ix_user_project_notification_user_44 on user_project_notification (user_id);
+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;
+create index ix_user_project_notification_project_45 on user_project_notification (project_id);
+alter table watch add constraint fk_watch_user_46 foreign key (user_id) references n4user (id) on delete restrict on update restrict;
+create index ix_watch_user_46 on watch (user_id);
+alter table webhook add constraint fk_webhook_project_47 foreign key (project_id) references project (id) on delete restrict on update restrict;
+create index ix_webhook_project_47 on webhook (project_id);
 
 
+
+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;
+
+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;
 
 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;
 
-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;
+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;
 
-# --- !Downs
+alter table issue_voter add constraint fk_issue_voter_issue_01 foreign key (issue_id) references issue (id) on delete restrict on update restrict;
 
-SET REFERENTIAL_INTEGRITY FALSE;
+alter table issue_voter add constraint fk_issue_voter_n4user_02 foreign key (user_id) references n4user (id) on delete restrict on update restrict;
 
-drop table if exists assignee;
+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;
 
-drop table if exists attachment;
+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;
 
-drop table if exists card;
+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;
 
-drop table if exists card_assignee;
+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;
 
-drop table if exists card_label;
+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;
 
-drop table if exists checklist;
+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;
 
-drop table if exists comment;
+alter table project_label add constraint fk_project_label_project_01 foreign key (project_id) references project (id) on delete restrict on update restrict;
 
-drop table if exists issue;
+alter table project_label add constraint fk_project_label_label_02 foreign key (label_id) references label (id) on delete restrict on update restrict;
 
-drop table if exists issue_issue_label;
+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;
 
-drop table if exists issue_comment;
+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;
 
-drop table if exists issue_label;
+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;
 
-drop table if exists item;
+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;
 
-drop table if exists label;
+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;
 
-drop table if exists line;
+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;
+
+# --- !Downs
+
+SET FOREIGN_KEY_CHECKS=0;
 
-drop table if exists milestone;
+drop table assignee;
 
-drop table if exists post;
+drop table attachment;
 
-drop table if exists project;
+drop table comment_thread;
 
-drop table if exists project_user;
+drop table commit_comment;
 
-drop table if exists role;
+drop table email;
 
-drop table if exists site_admin;
+drop table issue;
 
-drop table if exists task_board;
+drop table issue_issue_label;
 
-drop table if exists task_comment;
+drop table issue_voter;
 
-drop table if exists n4user;
+drop table issue_comment;
 
-SET REFERENTIAL_INTEGRITY TRUE;
+drop table issue_comment_voter;
 
-drop sequence if exists assignee_seq;
+drop table issue_event;
 
-drop sequence if exists attachment_seq;
+drop table issue_label;
 
-drop sequence if exists card_seq;
+drop table posting_issue_label;
 
-drop sequence if exists card_assignee_seq;
+drop table issue_label_category;
 
-drop sequence if exists card_label_seq;
+drop table label;
 
-drop sequence if exists checklist_seq;
+drop table project_label;
 
-drop sequence if exists comment_seq;
+drop table mention;
 
-drop sequence if exists issue_seq;
+drop table milestone;
 
-drop sequence if exists issue_comment_seq;
+drop table notification_event;
 
-drop sequence if exists issue_label_seq;
+drop table notification_event_n4user;
 
-drop sequence if exists item_seq;
+drop table notification_mail;
 
-drop sequence if exists label_seq;
+drop table organization;
 
-drop sequence if exists line_seq;
+drop table user_enrolled_organization;
 
-drop sequence if exists milestone_seq;
+drop table organization_user;
 
-drop sequence if exists post_seq;
+drop table original_email;
 
-drop sequence if exists project_seq;
+drop table posting;
 
-drop sequence if exists project_user_seq;
+drop table posting_comment;
 
-drop sequence if exists role_seq;
+drop table project;
 
-drop sequence if exists site_admin_seq;
+drop table user_enrolled_project;
 
-drop sequence if exists task_board_seq;
+drop table project_menu_setting;
 
-drop sequence if exists task_comment_seq;
+drop table project_transfer;
 
-drop sequence if exists n4user_seq;
+drop table project_user;
+
+drop table project_visitation;
+
+drop table property;
+
+drop table pull_request;
+
+drop table pull_request_reviewers;
+
+drop table pull_request_commit;
+
+drop table pull_request_event;
+
+drop table project_pushed_branch;
+
+drop table recently_visited_projects;
+
+drop table review_comment;
+
+drop table role;
+
+drop table site_admin;
+
+drop table unwatch;
+
+drop table n4user;
+
+drop table user_project_notification;
+
+drop table watch;
+
+drop table webhook;
+
+SET FOREIGN_KEY_CHECKS=1;
 
 
conf/evolutions/default/10.sql (deleted)
--- conf/evolutions/default/10.sql
@@ -1,6 +0,0 @@
-# --- !Ups
-ALTER TABLE N4USER ADD COLUMN is_locked boolean default false;
-
-
-# --- !Downs
-ALTER TABLE N4USER DROP COLUMN is_locked;
 
conf/evolutions/default/100.sql (deleted)
--- conf/evolutions/default/100.sql
@@ -1,13 +0,0 @@
-# --- !Ups
-
-alter table notification_event add column tmp_resource_id varchar(255);
-update notification_event set tmp_resource_id = cast(resource_id as varchar(255));
-alter table notification_event drop column if exists resource_id;
-alter table notification_event alter column tmp_resource_id rename to resource_id;
-
-# --- !Downs
-
--- Drop all records whose resource_id is not a number then restore the type of
--- resource_id to bigint.
-delete from notification_event where resource_id regexp '[^0-9]';
-alter table notification_event alter column resource_id bigint;
 
conf/evolutions/default/101.sql (deleted)
--- conf/evolutions/default/101.sql
@@ -1,13 +0,0 @@
-# --- !Ups
--- remove duplicated rows in pull_request_reviewers table
-create table prr_tmp (pull_request_id bigint, user_id bigint);
-
-insert into prr_tmp (pull_request_id, user_id) select distinct pull_request_id, user_id from pull_request_reviewers;
-
-truncate table pull_request_reviewers;
-
-insert into pull_request_reviewers (pull_request_id, user_id) select pull_request_id, user_id from prr_tmp;
-
-drop table prr_tmp;
-
-# --- !Downs
 
conf/evolutions/default/102.sql (deleted)
--- conf/evolutions/default/102.sql
@@ -1,7 +0,0 @@
-# --- !Ups
-
-alter table pull_request_reviewers add constraint uq_pull_request_reviewer unique (pull_request_id, user_id);
-
-# --- !Downs
-
-alter table pull_request_reviewers drop constraint if exists uq_pull_request_reviewer;
 
conf/evolutions/default/103.sql (deleted)
--- conf/evolutions/default/103.sql
@@ -1,6 +0,0 @@
-# --- !Ups
-
-update project_user set role_id = (select id from role where name = 'sitemanager')
-where role_id = 0 and user_id = (select admin_id from site_admin);
-
-# --- !Downs
 
conf/evolutions/default/104.sql (deleted)
--- conf/evolutions/default/104.sql
@@ -1,15 +0,0 @@
-# --- !Ups
-
-ALTER TABLE PROJECT ADD previous_name VARCHAR(255);
-ALTER TABLE PROJECT ADD previous_owner_login_id VARCHAR(255);
-ALTER TABLE PROJECT ADD previous_name_changed_time BIGINT;
-
-CREATE INDEX ix_project_previous_01 ON project(previous_owner_login_id, previous_name);
-
-# --- !Downs
-
-DROP INDEX IF EXISTS ix_project_previous_01;
-
-ALTER TABLE project DROP COLUMN IF EXISTS previous_name;
-ALTER TABLE project DROP COLUMN IF EXISTS previous_owner_login_id;
-ALTER TABLE project DROP COLUMN IF EXISTS previous_name_changed_time;
 
conf/evolutions/default/105.sql (deleted)
--- conf/evolutions/default/105.sql
@@ -1,19 +0,0 @@
-# --- !Ups
-
-create table webhook (
-  id                        bigint not null,
-  project_id                bigint not null,
-  payload_url               varchar(2048) not null,
-  secret                    varchar(256),
-  created_at                timestamp,
-  constraint pk_webhook primary key (id))
-;
-
-create sequence webhook_seq;
-alter table webhook add constraint fk_project_webhook foreign key (project_id) references project (id) on delete restrict on update restrict;
-
-# --- !Downs
-
-drop table if exists webhook;
-
-drop sequence if exists webhook_seq;
 
conf/evolutions/default/106.sql (deleted)
--- conf/evolutions/default/106.sql
@@ -1,14 +0,0 @@
-# --- !Ups
-create table posting_issue_label (
-  posting_id                     bigint not null,
-  issue_label_id                 bigint not null,
-  constraint pk_posting_issue_label primary key (posting_id, issue_label_id))
-;
-
-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;
-
-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;
-
-# --- !Downs
-drop table if exists POSTING_ISSUE_LABEL;
-
 
conf/evolutions/default/11.sql (deleted)
--- conf/evolutions/default/11.sql
@@ -1,173 +0,0 @@
-# --- !Ups
-
-ALTER TABLE tag DROP COLUMN IF EXISTS category;
-ALTER TABLE tag ADD COLUMN category VARCHAR(255);
-UPDATE tag SET category='Tag';
-ALTER TABLE tag ALTER COLUMN category SET NOT NULL;
-ALTER TABLE tag DROP CONSTRAINT IF EXISTS uq_tag_name;
-ALTER TABLE tag DROP CONSTRAINT IF EXISTS uq_tag_category_name;
-ALTER TABLE tag ADD CONSTRAINT uq_tag_category_name UNIQUE (category, name);
-
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ALGOL 58');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ALGOL 60');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ALGOL 68');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'APL');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ASP.NET');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'AWK');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ActionScript');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Ada');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'AppleScript');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'AspectJ');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Assembly language');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'AutoLISP / Visual LISP');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'B');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'BASIC');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'BCPL');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'BREW');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Bash');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Batch (Windows/Dos)');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Bourne shell');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'C#');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'C');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'C++');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'COBOL');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Clipper');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Clojure');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'CobolScript');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'CoffeeScript');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ColdFusion');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Common Lisp');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Component Pascal');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Curl');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'D');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Dart');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Delphi');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ECMAScript');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Eiffel');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Emacs Lisp');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Erlang');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'F#');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'F');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Forth');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Fortran');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'FoxBase');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'FoxPro');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Go!');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Go');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Groovy');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Haskell');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Io');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'J');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'JScript');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Java');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'JavaFX Script');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'JavaScript');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'LaTeX');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Lisp');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Logo');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Lua');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'MATLAB');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'MDL');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ML');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Machine code');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Mathematica');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Maya');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Microcode');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Microsoft Visual C++');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Modula');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Modula-2');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Modula-3');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'OCaml');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Object Lisp');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Object Pascal');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Objective-C');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Opa');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Orc');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PHP');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL-11');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL/0');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL/B');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL/C');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL/I');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL/M');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL/P');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PL/SQL');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'POP-11');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Pascal');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Perl');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PostScript');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PowerBuilder');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'PowerShell');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Processing.js');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Prolog');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Python');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'QBasic');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'QuakeC');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'R');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'R++');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'REXX');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Ruby');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Rust');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Scala');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Scheme');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Script.NET');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Sed');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Self');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Simula');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Simulink');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Small Basic');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Smalltalk');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Snowball');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Squeak');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'TEX');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Tcl');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'TeX');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'UNITY');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Unix shell');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'UnrealScript');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'VBA');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'VBScript');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'VHDL');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Vala');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Verilog');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual Basic .NET');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual Basic');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual C#');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual DataFlex');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual DialogScript');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual Fortran');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual FoxPro');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual J#');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual J++');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual LISP');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Visual Prolog');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'Windows PowerShell');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'XQuery');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'XSLT');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'bc');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'csh');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'dBase');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'ksh');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'Language', 'make');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'Apache');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'BSD');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'EPL');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'GPL');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'ISC');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'LGPL');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'MIT');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'MPL v1.1');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'MPL v2.0');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'License', 'Public Domain');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'OS', 'Linux');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'OS', 'OSX');
-INSERT INTO tag (id, category, name) VALUES (nextval('tag_seq'), 'OS', 'Windows');
-
-# --- !Downs
-
-ALTER TABLE tag DROP CONSTRAINT IF EXISTS uq_tag_name;
-UPDATE tag SET name=category || ' - ' || name WHERE category <> 'Tag';
-DELETE FROM tag WHERE id NOT IN (SELECT min(id) FROM tag GROUP BY name);
-ALTER TABLE tag DROP CONSTRAINT IF EXISTS uq_tag_category_name;
-ALTER TABLE tag DROP COLUMN IF EXISTS category;
-ALTER TABLE tag ADD CONSTRAINT uq_tag_name UNIQUE (name);
 
conf/evolutions/default/12.sql (deleted)
--- conf/evolutions/default/12.sql
@@ -1,5 +0,0 @@
-# --- !Ups
-ALTER TABLE project ALTER COLUMN share_option RENAME TO is_public;
-
-# --- !Downs
-ALTER TABLE project ALTER COLUMN is_public RENAME TO share_option;
 
conf/evolutions/default/13.sql (deleted)
--- conf/evolutions/default/13.sql
@@ -1,29 +0,0 @@
-# --- !Ups
-
-ALTER TABLE project ADD COLUMN original_project_id varchar(255);
-
-create table pull_request (
-  id                        bigint not null,
-  title                     varchar(255),
-  body                      clob,
-  to_project_id             bigint,
-  from_project_id           bigint,
-  to_branch                 varchar(255),
-  from_branch               varchar(255),
-  contributor_id            bigint,
-  receiver_id               bigint,
-  created                   timestamp,
-  updated                   timestamp,
-  received                  timestamp,
-  state                     integer,
-  constraint pk_pull_request primary key (id));
-
-create sequence pull_request_seq;
-
-# --- !Downs
-
-DROP SEQUENCE IF EXISTS pull_request_seq;
-
-DROP TABLE IF EXISTS pull_request;
-
-ALTER TABLE project DROP COLUMN original_project_id;
 
conf/evolutions/default/14.sql (deleted)
--- conf/evolutions/default/14.sql
@@ -1,15 +0,0 @@
-# --- !Ups
-
-ALTER TABLE project ADD COLUMN watching_count BIGINT;
-UPDATE project SET watching_count = 0 WHERE watching_count IS NULL;
-
-create table user_watching_project (
-  user_id                        bigint not null,
-  project_id                bigint not null,
-  constraint pk_user_watching_project primary key (user_id, project_id));
-
-# --- !Downs
-
-DROP TABLE IF EXISTS user_watching_project;
-
-ALTER TABLE project DROP COLUMN watching_count;
 
conf/evolutions/default/15.sql (deleted)
--- conf/evolutions/default/15.sql
@@ -1,13 +0,0 @@
-# --- !Ups
-
-DROP TABLE IF EXISTS label;
-
-# --- !Downs
-
-CREATE TABLE label (
-  id                        bigint not null,
-  name                      varchar(255),
-  color                     varchar(255),
-  task_board_id             bigint,
-  constraint pk_label primary key (id))
-;
 
conf/evolutions/default/16.sql (deleted)
--- conf/evolutions/default/16.sql
@@ -1,33 +0,0 @@
-# --- !Ups
-
-ALTER TABLE tag DROP CONSTRAINT IF EXISTS uq_tag_category_name;
-ALTER TABLE tag DROP CONSTRAINT IF EXISTS uq_label_category_name;
-ALTER TABLE tag ADD CONSTRAINT uq_label_category_name UNIQUE (category, name);
-ALTER TABLE tag DROP CONSTRAINT IF EXISTS pk_tag;
-ALTER TABLE tag DROP CONSTRAINT IF EXISTS pk_label;
-ALTER TABLE tag ADD CONSTRAINT pk_label PRIMARY KEY (ID);
-ALTER TABLE tag RENAME TO label;
-
-ALTER TABLE project_tag ALTER COLUMN tag_id RENAME TO label_id;
-ALTER TABLE project_tag RENAME TO project_label;
-
-DROP SEQUENCE IF EXISTS label_seq;
-CREATE SEQUENCE label_seq START WITH tag_seq.nextval;
-DROP SEQUENCE IF EXISTS tag_seq;
-
-# --- !Downs
-
-ALTER TABLE label DROP CONSTRAINT IF EXISTS uq_label_category_name;
-ALTER TABLE label DROP CONSTRAINT IF EXISTS uq_tag_category_name;
-ALTER TABLE label ADD CONSTRAINT uq_tag_category_name UNIQUE (category, name);
-ALTER TABLE label DROP CONSTRAINT IF EXISTS pk_label;
-ALTER TABLE label DROP CONSTRAINT IF EXISTS pk_tag;
-ALTER TABLE label ADD CONSTRAINT pk_tag PRIMARY KEY (ID);
-ALTER TABLE label RENAME TO tag;
-
-ALTER TABLE project_label ALTER COLUMN label_id RENAME TO tag_id;
-ALTER TABLE project_label RENAME TO project_tag;
-
-DROP SEQUENCE IF EXISTS tag_seq;
-CREATE SEQUENCE tag_seq START WITH label_seq.nextval;
-DROP SEQUENCE IF EXISTS label_seq;
 
conf/evolutions/default/17.sql (deleted)
--- conf/evolutions/default/17.sql
@@ -1,7 +0,0 @@
-# --- !Ups
-
-ALTER TABLE project ADD COLUMN last_pushed_date timestamp;
-
-# --- !Downs
-
-ALTER TABLE project DROP COLUMN last_pushed_date;
 
conf/evolutions/default/18.sql (deleted)
--- conf/evolutions/default/18.sql
@@ -1,28 +0,0 @@
-# --- !Ups
-
-CREATE TABLE ISSUE_EXPLICIT_WATCHER (
-  issue_id                  bigint,
-  n4user_id                 bigint,
-);
-
-CREATE TABLE ISSUE_EXPLICIT_UNWATCHER (
-  issue_id                  bigint,
-  n4user_id                 bigint,
-);
-
-CREATE TABLE POSTING_EXPLICIT_WATCHER (
-  posting_id                bigint,
-  n4user_id                 bigint,
-);
-
-CREATE TABLE POSTING_EXPLICIT_UNWATCHER (
-  posting_id                bigint,
-  n4user_id                 bigint,
-);
-
-# --- !Downs
-
-DROP TABLE IF EXISTS ISSUE_EXPLICIT_WATCHER;
-DROP TABLE IF EXISTS ISSUE_EXPLICIT_UNWATCHER;
-DROP TABLE IF EXISTS POSTING_EXPLICIT_WATCHER;
-DROP TABLE IF EXISTS POSTING_EXPLICIT_UNWATCHER;
 
conf/evolutions/default/19.sql (deleted)
--- conf/evolutions/default/19.sql
@@ -1,35 +0,0 @@
-# --- !Ups
-
-create table code_comment (
-  id                        bigint not null,
-  project_id                bigint,
-  commit_id                 varchar(255),
-  path                      varchar(255),
-  line                      bigint,
-  side                      varchar(255),
-  contents                  varchar(4000),
-  created_date              timestamp,
-  author_id                 bigint,
-  author_login_id           varchar(255),
-  author_name               varchar(255),
-  constraint pk_code_comment primary key (id))
-;
-
-create sequence code_comment_seq;
-
-alter table code_comment add constraint fk_code_comment_project_3 foreign key (project_id) references project (id) on delete restrict on update restrict;
-
-create index ix_code_comment_project_3 on code_comment (project_id);
-
-ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_attachment_container_type;
-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'));
-
-# --- !Downs
-
-drop table if exists code_comment;
-drop sequence if exists code_comment_seq;
-
-DELETE FROM attachment WHERE container_type='CODE_COMMENT';
-
-ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_attachment_container_type;
-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
+++ conf/evolutions/default/2.sql
@@ -1,51 +1,20 @@
 # --- !Ups
+create index ix_issue_voter_user_id on issue_voter (user_id);
+create index ix_issue_comment_voter_user_id on issue_comment_voter (user_id);
 
-ALTER TABLE attachment ALTER container_type TYPE varchar(16);
-ALTER TABLE attachment DROP CONSTRAINT ck_attachment_container_type;
-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'));
+create index ix_original_email_resource_id on original_email (resource_id);
 
-ALTER TABLE comment DROP file_path;
-ALTER TABLE comment DROP CONSTRAINT pk_comment;
-ALTER TABLE comment ADD CONSTRAINT pk_posting_comment primary key (id);
-ALTER TABLE comment ALTER COLUMN post_id RENAME TO posting_id;
-ALTER TABLE comment RENAME TO posting_comment;
+CREATE INDEX ix_attachment_container ON attachment (container_type, container_id);
 
-ALTER TABLE issue_comment DROP file_path;
-
-ALTER TABLE post DROP file_path;
-ALTER TABLE post ALTER COLUMN contents RENAME TO body;
-ALTER TABLE post ALTER COLUMN comment_count RENAME TO num_of_comments;
-ALTER TABLE post DROP CONSTRAINT pk_post;
-ALTER TABLE post ADD CONSTRAINT pk_posting primary key (id);
-ALTER TABLE post RENAME TO posting;
-
-CREATE SEQUENCE posting_seq START WITH post_seq.currval;
-DROP SEQUENCE IF EXISTS post_seq;
-
-CREATE SEQUENCE posting_comment_seq START WITH comment_seq.currval;
-DROP SEQUENCE IF EXISTS comment_seq;
+create index ix_mention_resource_type on mention (resource_type);
 
 # --- !Downs
 
-ALTER TABLE attachment ALTER container_type TYPE varchar(15);
-ALTER TABLE attachment DROP CONSTRAINT ck_attachment_container_type;
-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'));
+drop index if exists ix_issue_voter_user_id;
+drop index if exists ix_issue_comment_voter_user_id;
 
-ALTER TABLE posting_comment ADD file_path;
-ALTER TABLE posting_comment DROP CONSTRAINT pk_posting_comment;
-ALTER TABLE posting_comment ADD CONSTRAINT pk_comment primary key (id);
-ALTER TABLE posting_comment RENAME TO comment;
+drop index if exists ix_original_email_resource_id;
 
-ALTER TABLE issue_comment ADD file_path;
+drop index if exists ix_attachment_container;
 
-ALTER TABLE posting ALTER COLUMN body RENAME TO contents;
-ALTER TABLE posting ALTER COLUMN num_of_comments RENAME TO comment_count;
-ALTER TABLE posting DROP CONSTRAINT pk_posting;
-ALTER TABLE posting ADD CONSTRAINT pk_post primary key (id));
-ALTER TABLE posting RENAME TO post;
-
-CREATE SEQUENCE post_seq START WITH posting_seq.currval;
-DROP SEQUENCE IF EXISTS posting_seq;
-
-CREATE SEQUENCE comment_seq START WITH posting_comment_seq.currval;
-DROP SEQUENCE IF EXISTS posting_comment_seq;
+drop index if exists ix_mention_resource_type;
 
conf/evolutions/default/20.sql (deleted)
--- conf/evolutions/default/20.sql
@@ -1,20 +0,0 @@
-# --- !Ups
-
-CREATE TABLE simple_comment (
-  id                        bigint not null,
-  contents                  varchar(4000),
-  created_date              timestamp,
-  author_id                 bigint,
-  author_login_id           varchar(255),
-  author_name               varchar(255),
-  resource_key              varchar(255),
-  constraint pk_simple_comment primary key (id)
-);
-
-CREATE SEQUENCE simple_comment_seq;
-
-# --- !Downs
-
-DROP SEQUENCE IF EXISTS simple_comment_seq;
-
-DROP TABLE IF EXISTS simple_comment;
 
conf/evolutions/default/21.sql (deleted)
--- conf/evolutions/default/21.sql
@@ -1,9 +0,0 @@
-# --- !Ups
-create table user_enrolled_project (
-  user_id                        bigint not null,
-  project_id                bigint not null,
-  constraint pk_user_enrolled_project primary key (user_id, project_id));
-
-# --- !Downs
-
-drop table if exists user_enrolled_project;
 
conf/evolutions/default/22.sql (deleted)
--- conf/evolutions/default/22.sql
@@ -1,51 +0,0 @@
-# --- !Ups
-
-create table notification_event (
-  id                        bigint not null,
-  title                     varchar(255),
-  message                   clob,
-  sender_id                 bigint,
-  created                   timestamp,
-  url_to_view               varchar(255),
-  resource_type             varchar(16),
-  resource_id               bigint,
-  type                      varchar(255),
-  old_value                 clob,
-  new_value                 clob,
-  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')),
-  constraint pk_notification_event primary key (id));
-
-create table notification_event_n4user (
-  notification_event_id          bigint not null,
-  n4user_id                      bigint not null,
-  constraint pk_notification_event_n4user primary key (notification_event_id, n4user_id));
-
-create table notification_mail (
-  id                        bigint not null,
-  notification_event_id     bigint,
-  constraint pk_notification_mail primary key (id))
-;
-
-create sequence notification_event_seq;
-
-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;
-
-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;
-
-create sequence notification_mail_seq;
-
-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;
-
-create index ix_notification_mail_notificat_9 on notification_mail (notification_event_id);
-
-# --- !Downs
-
-drop table if exists notification_event;
-
-drop table if exists notification_event_n4user;
-
-drop sequence if exists notification_event_seq;
-
-drop table if exists notification_mail;
-
-drop sequence if exists notification_mail_seq;
 
conf/evolutions/default/23.sql (deleted)
--- conf/evolutions/default/23.sql
@@ -1,52 +0,0 @@
-# --- !Ups
-
-create table commit_explicit_watching (
-  id                        bigint not null,
-  project_id                bigint,
-  commit_id                 varchar(255),
-  constraint pk_commit_explicit_watching primary key (id))
-;
-
-create table commit_explicit_watcher (
-  commit_explicit_watching_id    bigint not null,
-  n4user_id                      bigint not null,
-  constraint pk_commit_explicit_watcher primary key (commit_explicit_watching_id, n4user_id))
-;
-
-create table commit_explicit_unwatcher (
-  commit_explicit_watching_id    bigint not null,
-  n4user_id                      bigint not null,
-  constraint pk_commit_explicit_unwatcher primary key (commit_explicit_watching_id, n4user_id))
-;
-
-create sequence commit_explicit_watching_seq;
-
-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;
-
-create index ix_commit_explicit_watching_pr_4 on commit_explicit_watching (project_id);
-
-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;
-
-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;
-
-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;
-
-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;
-
-ALTER TABLE notification_event DROP CONSTRAINT IF EXISTS ck_notification_event_resource_type;
-
-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'));
-
-# --- !Downs
-
-drop table if exists commit_explicit_watching;
-
-drop table if exists commit_explicit_watcher;
-
-drop table if exists commit_explicit_unwatcher;
-
-drop sequence if exists commit_explicit_watching_seq;
-
-ALTER TABLE notification_event DROP CONSTRAINT IF EXISTS ck_notification_event_resource_type;
-
-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 (deleted)
--- conf/evolutions/default/24.sql
@@ -1,9 +0,0 @@
-# --- !Ups
-
-ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_attachment_container_type;
-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'));
-
-# --- !Downs
-
-ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_attachment_container_type;
-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 (deleted)
--- conf/evolutions/default/25.sql
@@ -1,7 +0,0 @@
-# --- !Ups
-
-ALTER TABLE pull_request ADD COLUMN last_commit_id varchar(255);
-
-# --- !Downs
-
-ALTER TABLE pull_request DROP COLUMN last_commit_id;
 
conf/evolutions/default/26.sql (deleted)
--- conf/evolutions/default/26.sql
@@ -1,9 +0,0 @@
-# --- !Ups
-
-ALTER TABLE pull_request ADD COLUMN merged_commit_id_from varchar(255);
-ALTER TABLE pull_request ADD COLUMN merged_commit_id_to varchar(255);
-
-# --- !Downs
-
-ALTER TABLE pull_request DROP COLUMN merged_commit_id_from;
-ALTER TABLE pull_request DROP COLUMN merged_commit_id_to;
 
conf/evolutions/default/27.sql (deleted)
--- conf/evolutions/default/27.sql
@@ -1,55 +0,0 @@
-# --- !Ups
-
-create table watch (
-  id                        bigint not null,
-  user_id                   bigint,
-  resource_type             varchar(16),
-  resource_id               varchar(255),
-  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')),
-  constraint pk_watch primary key (id))
-;
-
-create table unwatch (
-  id                        bigint not null,
-  user_id                   bigint,
-  resource_type             varchar(16),
-  resource_id               varchar(255),
-  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')),
-  constraint pk_unwatch primary key (id))
-;
-
-create sequence watch_seq;
-
-create sequence unwatch_seq;
-
-alter table unwatch add constraint fk_unwatch_unwatcher_23 foreign key (user_id) references n4user (id) on delete restrict on update restrict;
-
-create index ix_unwatch_unwatcher_23 on unwatch (user_id);
-
-alter table watch add constraint fk_watch_watcher_24 foreign key (user_id) references n4user (id) on delete restrict on update restrict;
-
-create index ix_watch_watcher_24 on watch (user_id);
-
-drop table if exists user_watching_project;
-
-drop table if exists commit_explicit_watching;
-
-drop table if exists commit_explicit_watcher;
-
-drop table if exists commit_explicit_unwatcher;
-
-drop sequence if exists commit_explicit_watching_seq;
-
-ALTER TABLE attachment ALTER COLUMN container_id TYPE varchar(255);
-
-# --- !Downs
-
-drop table if exists unwatch;
-
-drop table if exists watch;
-
-drop sequence if exists unwatch_seq;
-
-drop sequence if exists watch_seq;
-
-ALTER TABLE attachment ALTER COLUMN container_id TYPE bigint;
 
conf/evolutions/default/28.sql (deleted)
--- conf/evolutions/default/28.sql
@@ -1,17 +0,0 @@
-# --- !Ups
-
-ALTER TABLE n4user ADD COLUMN state VARCHAR(15);
-ALTER TABLE n4user ADD COLUMN last_state_modified_date TIMESTAMP;
-UPDATE n4user SET state='LOCKED' WHERE is_locked=true;
-UPDATE n4user SET state='ACTIVE' WHERE is_locked=false;
-ALTER TABLE n4user DROP COLUMN is_locked;
-ALTER TABLE n4user ADD CONSTRAINT ck_n4user_state check (state in ('ACTIVE', 'LOCKED', 'DELETED'));
-
-# --- !Downs
-
-ALTER TABLE n4user DROP CONSTRAINT IF EXISTS ck_n4user_state;
-ALTER TABLE n4user ADD COLUMN is_locked BOOLEAN DEFAULT FALSE;
-UPDATE n4user SET is_locked=true WHERE state='LOCKED';
-UPDATE n4user SET is_locked=false WHERE state='ACTIVE';
-ALTER TABLE n4user DROP COLUMN state;
-ALTER TABLE n4user DROP COLUMN last_state_modified_date;
 
conf/evolutions/default/29.sql (deleted)
--- conf/evolutions/default/29.sql
@@ -1,9 +0,0 @@
-# --- !Ups
-
-ALTER TABLE notification_event DROP CONSTRAINT IF EXISTS ck_notification_event_resource_type;
-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'));
-
-# --- !Downs
-
-ALTER TABLE notification_event DROP CONSTRAINT IF EXISTS ck_notification_event_resource_type;
-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 (deleted)
--- conf/evolutions/default/3.sql
@@ -1,17 +0,0 @@
-# --- !Ups
-
-ALTER TABLE issue ALTER COLUMN date RENAME TO created_date;
-ALTER TABLE issue_comment ALTER COLUMN date RENAME TO created_date;
-ALTER TABLE posting ALTER COLUMN date RENAME TO created_date;
-ALTER TABLE posting_comment ALTER COLUMN date RENAME TO created_date;
-ALTER TABLE project ALTER COLUMN date RENAME TO created_date;
-ALTER TABLE n4user ALTER COLUMN date RENAME TO created_date;
-
-# --- !Downs
-
-ALTER TABLE issue ALTER COLUMN created_date RENAME TO date;
-ALTER TABLE issue_comment ALTER COLUMN created_date RENAME TO date;
-ALTER TABLE posting ALTER COLUMN created_date RENAME TO date;
-ALTER TABLE posting_comment ALTER COLUMN created_date RENAME TO date;
-ALTER TABLE project ALTER COLUMN created_date RENAME TO date;
-ALTER TABLE n4user ALTER COLUMN created_date RENAME TO date;
 
conf/evolutions/default/30.sql (deleted)
--- conf/evolutions/default/30.sql
@@ -1,5 +0,0 @@
-# --- !Ups
-ALTER TABLE notification_event ALTER COLUMN type RENAME TO notification_type;
-
-# --- !Downs
-ALTER TABLE notification_event ALTER COLUMN notification_type RENAME TO type;
 
conf/evolutions/default/31.sql (deleted)
--- conf/evolutions/default/31.sql
@@ -1,9 +0,0 @@
-# --- !Ups
-
-ALTER TABLE pull_request ADD COLUMN number BIGINT;
-ALTER TABLE pull_request ADD CONSTRAINT uq_pull_request_1 UNIQUE (to_project_id,number);
-
-# --- !Downs
-
-ALTER TABLE pull_request DROP CONSTRAINT uq_pull_request_1;
-ALTER TABLE pull_request DROP COLUMN number;
 
conf/evolutions/default/32.sql (deleted)
--- conf/evolutions/default/32.sql
@@ -1,28 +0,0 @@
-# --- !Ups
-
-create table user_project_notification (
-  id                        bigint not null,
-  user_id                   bigint,
-  project_id                bigint,
-  notification_type         varchar(255),
-  allowed                   boolean,
-
-  constraint pk_user_project_notification primary key (id))
-;
-
-create sequence user_project_notification_seq;
-
-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;
-
-create index ix_user_project_notification_user_25 on user_project_notification (user_id);
-
-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;
-
-create index ix_user_project_notification_project_26 on user_project_notification (project_id);
-
-
-# --- !Downs
-
-drop table if exists user_project_notification;
-
-drop sequence if exists user_project_notification_seq;
 
conf/evolutions/default/33.sql (deleted)
--- conf/evolutions/default/33.sql
@@ -1,5 +0,0 @@
-# --- !Ups
-ALTER TABLE notification_event ALTER COLUMN notification_type RENAME TO event_type;
-
-# --- !Downs
-ALTER TABLE notification_event ALTER COLUMN event_type RENAME TO notification_type;
 
conf/evolutions/default/34.sql (deleted)
--- conf/evolutions/default/34.sql
@@ -1,23 +0,0 @@
-# --- !Ups
-create table issue_event (
-  id                        bigint not null,
-  created                   timestamp,
-  sender_login_id           varchar(255),
-  issue_id                  bigint,
-  event_type         varchar(26),
-  old_value                 varchar(255),
-  new_value                 varchar(255),
-  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')),
-  constraint pk_issue_event primary key (id))
-;
-
-create sequence issue_event_seq;
-
-alter table issue_event add constraint fk_issue_event_issue_8 foreign key (issue_id) references issue (id) on delete restrict on update restrict;
-
-create index ix_issue_event_issue_8 on issue_event (issue_id);
-
-# --- !Downs
-drop table if exists issue_event;
-
-drop sequence if exists issue_event_seq;
 
conf/evolutions/default/35.sql (deleted)
--- conf/evolutions/default/35.sql
@@ -1,11 +0,0 @@
-# --- !Ups
-
-ALTER TABLE issue ADD COLUMN updated_date TIMESTAMP;
-ALTER TABLE posting ADD COLUMN updated_date TIMESTAMP;
-UPDATE issue SET updated_date=created_date;
-UPDATE posting SET updated_date=created_date;
-
-# --- !Downs
-
-ALTER TABLE issue DROP COLUMN updated_date;
-ALTER TABLE posting DROP COLUMN updated_date;
 
conf/evolutions/default/36.sql (deleted)
--- conf/evolutions/default/36.sql
@@ -1,10 +0,0 @@
-# --- !Ups
-
-ALTER TABLE issue_event DROP CONSTRAINT IF EXISTS ck_issue_event_event_type;
-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'));
-
-# --- !Downs
-
-ALTER TABLE issue_event DROP CONSTRAINT IF EXISTS ck_issue_event_event_type;
-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'));
-
 
conf/evolutions/default/37.sql (deleted)
--- conf/evolutions/default/37.sql
@@ -1,23 +0,0 @@
-# --- !Ups
-create table pull_request_commit (
-  id                        bigint not null,
-  pull_request_id			bigint,
-  commit_id					varchar(255),
-  commit_short_id			varchar(7),
-  commit_message			varchar(2000),
-  created					timestamp,
-  author_date				timestamp,
-  author_email				varchar(255),
-  state						varchar(10),
-  constraint pk_pull_request_commit primary key (id))
-;
-
-create sequence pull_request_commit_seq;
-
-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;
-
-# --- !Downs
-drop table if exists pull_request_commit;
-
-drop sequence if exists pull_request_commit_seq;
-
 
conf/evolutions/default/38.sql (deleted)
--- conf/evolutions/default/38.sql
@@ -1,33 +0,0 @@
-# --- !Ups
-create table pull_request_event (
-  id                        bigint not null,
-  pull_request_id			bigint,
-  created				timestamp,
-  sender_login_id			varchar(255),
-  event_type				varchar(255),
-  new_value					varchar(255),
-  old_value					varchar(255),
-  constraint pk_pull_request_event primary key (id))
-;
-
-create sequence pull_request_event_seq;
-
-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;
-
-ALTER TABLE pull_request ADD COLUMN is_conflict boolean;
-ALTER TABLE pull_request ADD COLUMN patch clob;
-ALTER TABLE pull_request ADD COLUMN is_merging boolean;
-ALTER TABLE pull_request ADD COLUMN conflict_files varchar(255);
-UPDATE pull_request SET is_merging = false;
-UPDATE pull_request SET is_conflict = false;
-
-# --- !Downs
-drop table if exists pull_request_event;
-
-drop sequence if exists pull_request_event_seq;
-
-ALTER TABLE pull_request DROP COLUMN is_conflict;
-ALTER TABLE pull_request DROP COLUMN patch;
-ALTER TABLE pull_request DROP COLUMN is_merging;
-ALTER TABLE pull_request DROP COLUMN conflict_files;
-
 
conf/evolutions/default/39.sql (deleted)
--- conf/evolutions/default/39.sql
@@ -1,16 +0,0 @@
-# --- !Ups
-
-UPDATE NOTIFICATION_EVENT
-set event_type = 'PULL_REQUEST_MERGED'
-, OLD_VALUE = NEW_VALUE
-, NEW_VALUE = 'conflict'
-WHERE EVENT_TYPE = 'PULL_REQUEST_CONFLICTS'
-
-# --- !Downs
-
-UPDATE NOTIFICATION_EVENT
-set event_type = 'PULL_REQUEST_CONFLICTS'
-, NEW_VALUE = OLD_VALUE
-, OLD_VALUE = ''
-WHERE EVENT_TYPE = 'PULL_REQUEST_MERGED'
-AND NEW_VALUE = 'conflict'
 
conf/evolutions/default/4.sql (deleted)
--- conf/evolutions/default/4.sql
@@ -1,63 +0,0 @@
-# --- !Ups
-
-DROP TABLE IF EXISTS task_board;
-DROP TABLE IF EXISTS task_comment;
-DROP TABLE IF EXISTS card;
-DROP TABLE IF EXISTS card_assignee;
-DROP TABLE IF EXISTS card_label;
-DROP TABLE IF EXISTS checklist;
-
-DROP SEQUENCE IF EXISTS task_board_seq;
-DROP SEQUENCE IF EXISTS task_comment_seq;
-DROP SEQUENCE IF EXISTS card_seq;
-DROP SEQUENCE IF EXISTS card_assignee_seq;
-DROP SEQUENCE IF EXISTS card_label_seq;
-DROP SEQUENCE IF EXISTS checklist_seq;
-
-# --- !Downs
-
-CREATE TABLE task_board (
-  id                        BIGINT NOT NULL,
-  project_id                BIGINT,
-  CONSTRAINT pk_task_board PRIMARY KEY (id))
-;
-
-CREATE TABLE task_comment (
-  id                        BIGINT NOT NULL,
-  body                      VARCHAR(255),
-  card_id                   BIGINT,
-  CONSTRAINT pk_task_comment PRIMARY KEY (id))
-;
-
-CREATE TABLE task_board (
-  id                        BIGINT NOT NULL,
-  project_id                BIGINT,
-  CONSTRAINT pk_task_board PRIMARY KEY (id))
-;
-
-CREATE TABLE task_comment (
-  id                        BIGINT NOT NULL,
-  body                      VARCHAR(255),
-  card_id                   BIGINT,
-  CONSTRAINT pk_task_comment PRIMARY KEY (id))
-;
-
-CREATE TABLE checklist (
-  id                        BIGINT NOT NULL,
-  title                     VARCHAR(255),
-  CONSTRAINT pk_checklist PRIMARY KEY (id))
-;
-
-CREATE TABLE card_assignee (
-  id                        BIGINT NOT NULL,
-  card_id                   BIGINT,
-  project_user_id           BIGINT,
-  CONSTRAINT pk_card_assignee PRIMARY KEY (id))
-;
-
-CREATE SEQUENCE IF NOT EXISTS task_board_seq;
-CREATE SEQUENCE IF NOT EXISTS task_comment_seq;
-CREATE SEQUENCE IF NOT EXISTS card_seq;
-CREATE SEQUENCE IF NOT EXISTS card_assignee_seq;
-CREATE SEQUENCE IF NOT EXISTS card_label_seq;
-CREATE SEQUENCE IF NOT EXISTS checklist_seq;
 
conf/evolutions/default/40.sql (deleted)
--- conf/evolutions/default/40.sql
@@ -1,10 +0,0 @@
-# --- !Ups
-
-ALTER TABLE pull_request_event alter column new_value clob;
-ALTER TABLE pull_request_event alter column old_value clob;
-
-# --- !Downs
-
-ALTER TABLE pull_request_event alter column new_value varchar(255);
-ALTER TABLE pull_request_event alter column old_value varchar(255);
-
 
conf/evolutions/default/41.sql (deleted)
--- conf/evolutions/default/41.sql
@@ -1,101 +0,0 @@
-# --- !Ups
-
-ALTER TABLE simple_comment RENAME TO pull_request_comment;
-DROP SEQUENCE IF EXISTS pull_request_comment_seq;
-CREATE SEQUENCE pull_request_comment_seq START WITH simple_comment_seq.nextval;
-DROP SEQUENCE IF EXISTS simple_comment_seq;
-ALTER TABLE pull_request_comment ADD COLUMN project_id bigint;
-ALTER TABLE pull_request_comment ADD COLUMN commit_a varchar(40);
-ALTER TABLE pull_request_comment ADD COLUMN commit_b varchar(40);
-ALTER TABLE pull_request_comment ADD COLUMN commit_id varchar(40);
-ALTER TABLE pull_request_comment ADD COLUMN path varchar(255);
-ALTER TABLE pull_request_comment ADD COLUMN line integer;
-ALTER TABLE pull_request_comment ADD COLUMN side varchar(16);
-ALTER TABLE pull_request_comment ADD COLUMN pull_request_id bigint;
-
-ALTER TABLE code_comment RENAME TO commit_comment;
-DROP SEQUENCE IF EXISTS commit_comment_seq;
-CREATE SEQUENCE commit_comment_seq START WITH code_comment_seq.nextval;
-DROP SEQUENCE IF EXISTS code_commit_seq;
-
-ALTER TABLE notification_event DROP CONSTRAINT IF EXISTS ck_notification_event_resource_type;
-ALTER TABLE notification_event ALTER COLUMN resource_type TYPE varchar(255);
-UPDATE notification_event SET resource_type='COMMIT_COMMENT' WHERE resource_type='CODE_COMMENT';
-UPDATE notification_event SET event_type='NEW_COMMIT_COMMENT' WHERE event_type='NEW_CODE_COMMENT';
-UPDATE notification_event SET resource_type='PULL_REQUEST_COMMENT' WHERE resource_type='SIMPLE_COMMENT';
-UPDATE notification_event SET event_type='NEW_PULL_REQUEST_COMMENT' WHERE event_type='NEW_SIMPLE_COMMENT';
-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'));
-
-ALTER TABLE watch DROP CONSTRAINT IF EXISTS ck_watch_resource_type;
-ALTER TABLE watch ALTER COLUMN resource_type TYPE varchar(255);
-UPDATE watch SET resource_type='COMMIT_COMMENT' WHERE resource_type='CODE_COMMENT';
-UPDATE watch SET resource_type='PULL_REQUEST_COMMENT' WHERE resource_type='SIMPLE_COMMENT';
-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'));
-
-ALTER TABLE unwatch DROP CONSTRAINT IF EXISTS ck_unwatch_resource_type;
-ALTER TABLE unwatch ALTER COLUMN resource_type TYPE varchar(255);
-UPDATE unwatch SET resource_type='COMMIT_COMMENT' WHERE resource_type='CODE_COMMENT';
-UPDATE unwatch SET resource_type='PULL_REQUEST_COMMENT' WHERE resource_type='SIMPLE_COMMENT';
-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'));
-
-ALTER TABLE issue_event DROP CONSTRAINT IF EXISTS ck_issue_event_event_type;
-ALTER TABLE issue_event ALTER COLUMN event_type TYPE varchar(255);
-UPDATE issue_event SET event_type='NEW_COMMIT_COMMENT' WHERE event_type='NEW_CODE_COMMENT';
-UPDATE issue_event SET event_type='NEW_PULL_REQUEST_COMMENT' WHERE event_type='NEW_SIMPLE_COMMENT';
-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'));
-
-ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_attachment_container_type;
-UPDATE attachment SET container_type='COMMIT_COMMENT' WHERE container_type='CODE_COMMENT';
-UPDATE attachment SET container_type='PULL_REQUEST_COMMENT' WHERE container_type='SIMPLE_COMMENT';
-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'));
-
-# --- !Downs
-
-ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS project_id;
-ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS commit_a;
-ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS commit_b;
-ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS commit_id;
-ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS path;
-ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS line;
-ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS side;
-ALTER TABLE pull_request_comment DROP COLUMN IF EXISTS pull_request_id;
-ALTER TABLE pull_request_comment RENAME TO simple_comment;
-DROP SEQUENCE IF EXISTS simple_comment_seq;
-CREATE SEQUENCE simple_comment_seq START WITH pull_request_comment_seq.nextval;
-DROP SEQUENCE IF EXISTS pull_request_comment_seq;
-
-ALTER TABLE commit_comment RENAME TO code_comment;
-DROP SEQUENCE IF EXISTS code_comment_seq;
-CREATE SEQUENCE code_comment_seq START WITH commit_comment_seq.nextval;
-DROP SEQUENCE IF EXISTS commit_comment_seq;
-
-ALTER TABLE notification_event DROP CONSTRAINT IF EXISTS ck_notification_event_resource_type;
-UPDATE notification_event SET resource_type='CODE_COMMENT' WHERE resource_type='COMMIT_COMMENT';
-UPDATE notification_event SET event_type='NEW_CODE_COMMENT' WHERE event_type='NEW_COMMIT_COMMENT';
-UPDATE notification_event SET resource_type='SIMPLE_COMMENT' WHERE resource_type='PULL_REQUEST_COMMENT';
-UPDATE notification_event SET event_type='NEW_SIMPLE_COMMENT' WHERE event_type='NEW_PULL_REQUEST_COMMENT';
-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'));
-ALTER TABLE notification_event ALTER COLUMN resource_type TYPE varchar(16);
-
-ALTER TABLE watch DROP CONSTRAINT IF EXISTS ck_watch_resource_type;
-UPDATE watch SET resource_type='CODE_COMMENT' WHERE resource_type='COMMIT_COMMENT';
-UPDATE watch SET resource_type='SIMPLE_COMMENT' WHERE resource_type='PULL_REQUEST_COMMENT';
-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'));
-ALTER TABLE watch ALTER COLUMN resource_type TYPE varchar(16);
-
-ALTER TABLE unwatch DROP CONSTRAINT IF EXISTS ck_unwatch_resource_type;
-UPDATE unwatch SET resource_type='CODE_COMMENT' WHERE resource_type='COMMIT_COMMENT';
-UPDATE unwatch SET resource_type='SIMPLE_COMMENT' WHERE resource_type='PULL_REQUEST_COMMENT';
-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'));
-ALTER TABLE unwatch ALTER COLUMN resource_type TYPE varchar(16);
-
-ALTER TABLE issue_event DROP CONSTRAINT IF EXISTS ck_issue_event_event_type;
-UPDATE issue_event SET event_type='NEW_CODE_COMMENT' WHERE event_type='NEW_COMMIT_COMMENT';
-UPDATE issue_event SET event_type='NEW_SIMPLE_COMMENT' WHERE event_type='NEW_PULL_REQUEST_COMMENT';
-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'));
-ALTER TABLE issue_event ALTER COLUMN event_type TYPE varchar(16);
-
-ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_attachment_container_type;
-UPDATE attachment SET container_type='CODE_COMMENT' WHERE container_type='COMMIT_COMMENT';
-UPDATE attachment SET container_type='SIMPLE_COMMENT' WHERE container_type='PULL_REQUEST_COMMENT';
-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 (deleted)
--- conf/evolutions/default/42.sql
@@ -1,7 +0,0 @@
-# --- !Ups
-
-ALTER TABLE pull_request DROP COLUMN patch;
-
-# --- !Downs
-
-ALTER TABLE pull_request ADD COLUMN patch clob;
 
conf/evolutions/default/43.sql (deleted)
--- conf/evolutions/default/43.sql
@@ -1,7 +0,0 @@
-# --- !Ups
-
-ALTER TABLE pull_request ALTER COLUMN conflict_files clob;
-
-# --- !Downs
-
-ALTER TABLE pull_request ALTER COLUMN conflict_files varchar(255);
 
conf/evolutions/default/44.sql (deleted)
--- conf/evolutions/default/44.sql
@@ -1,23 +0,0 @@
-# --- !Ups
-
-DELETE FROM commit_comment WHERE side<>'context' and side<>'add' and side<>'remove';
-UPDATE commit_comment SET side='A' WHERE side='remove';
-UPDATE commit_comment SET side='B' WHERE side='context' or side='add';
-ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_commit_comment_side;
-ALTER TABLE commit_comment ADD constraint ck_commit_comment_side check (side in ('A', 'B'));
-
-DELETE FROM pull_request_comment WHERE side<>'context' and side<>'add' and side<>'remove';
-UPDATE pull_request_comment SET side='A' WHERE side='remove';
-UPDATE pull_request_comment SET side='B' WHERE side='context' or side='add';
-ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_pull_request_comment_side;
-ALTER TABLE pull_request_comment ADD constraint ck_pull_request_comment_side check (side in ('A', 'B'));
-
-# --- !Downs
-
-UPDATE commit_comment SET side='remove' WHERE side='A';
-UPDATE commit_comment SET side='add' WHERE side='B'; -- This possibly cause loss of a few comments' location.
-ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_commit_comment_side;
-
-UPDATE pull_request_comment SET side='remove' WHERE side='A';
-UPDATE pull_request_comment SET side='add' WHERE side='B'; -- This possibly cause loss of a few comments' location.
-ALTER TABLE attachment DROP CONSTRAINT IF EXISTS ck_pull_request_comment_side;
 
conf/evolutions/default/45.sql (deleted)
--- conf/evolutions/default/45.sql
@@ -1,5 +0,0 @@
-# --- !Ups
-ALTER TABLE attachment DROP COLUMN project_id;
-
-# --- !Downs
-ALTER TABLE attachment ADD COLUMN project_id bigint;
 
conf/evolutions/default/46.sql (deleted)
--- conf/evolutions/default/46.sql