|
| 1 | +create table account ( |
| 2 | + discount_rate float(23), |
| 3 | + height float(23), |
| 4 | + is_deleted boolean default false not null, |
| 5 | + service_fee_rate float(23), |
| 6 | + total_sales integer default 0, |
| 7 | + weight float(23), |
| 8 | + account_id bigint not null auto_increment, |
| 9 | + birthdate datetime(6), |
| 10 | + created_at datetime(6), |
| 11 | + oauth2_id bigint, |
| 12 | + updated_at datetime(6), |
| 13 | + account_role varchar(255), |
| 14 | + career_certificate_url varchar(255), |
| 15 | + email varchar(255), |
| 16 | + expertise varchar(255), |
| 17 | + gender varchar(255), |
| 18 | + identification_code varchar(255), |
| 19 | + introduce varchar(255), |
| 20 | + name varchar(255), |
| 21 | + nickname varchar(255), |
| 22 | + oauth_access_token varchar(255), |
| 23 | + password varchar(255), |
| 24 | + phone_number varchar(255), |
| 25 | + profile_picture_url varchar(255), |
| 26 | + provider varchar(255), |
| 27 | + recommender_code varchar(255), |
| 28 | + primary key (account_id) |
| 29 | +) engine=InnoDB |
| 30 | + |
| 31 | +create table career ( |
| 32 | + is_deleted boolean default false not null, |
| 33 | + account_id bigint, |
| 34 | + career_id bigint not null auto_increment, |
| 35 | + created_at datetime(6), |
| 36 | + updated_at datetime(6), |
| 37 | + date varchar(255), |
| 38 | + title varchar(255), |
| 39 | + type varchar(255), |
| 40 | + primary key (career_id) |
| 41 | +) engine=InnoDB |
| 42 | + |
| 43 | +create table chatting_message ( |
| 44 | + is_deleted boolean default false not null, |
| 45 | + is_edited bit not null, |
| 46 | + not_view_count integer not null, |
| 47 | + account bigint, |
| 48 | + chatting_message_id bigint not null auto_increment, |
| 49 | + chatting_room bigint, |
| 50 | + created_at datetime(6), |
| 51 | + updated_at datetime(6), |
| 52 | + content varchar(255), |
| 53 | + file_url TEXT, |
| 54 | + primary key (chatting_message_id) |
| 55 | +) engine=InnoDB |
| 56 | + |
| 57 | +create table chatting_message_bookmark ( |
| 58 | + is_deleted boolean default false not null, |
| 59 | + account_id bigint not null, |
| 60 | + chatting_message_id bigint not null, |
| 61 | + chatting_room_id bigint not null, |
| 62 | + created_at datetime(6), |
| 63 | + updated_at datetime(6), |
| 64 | + primary key (account_id, chatting_message_id, chatting_room_id) |
| 65 | +) engine=InnoDB |
| 66 | + |
| 67 | +create table chatting_participant ( |
| 68 | + is_deleted boolean default false not null, |
| 69 | + is_host bit not null, |
| 70 | + not_view_count integer not null, |
| 71 | + account_id bigint not null, |
| 72 | + chatting_room_entry_time datetime(6), |
| 73 | + chatting_room_exit_time datetime(6), |
| 74 | + chatting_room_id bigint not null, |
| 75 | + created_at datetime(6), |
| 76 | + updated_at datetime(6), |
| 77 | + simp_session_id varchar(255), |
| 78 | + primary key (account_id, chatting_room_id) |
| 79 | +) engine=InnoDB |
| 80 | + |
| 81 | +create table chatting_room ( |
| 82 | + is_deleted boolean default false not null, |
| 83 | + number_of_participant integer not null, |
| 84 | + status tinyint not null, |
| 85 | + chatting_room_id bigint not null auto_increment, |
| 86 | + created_at datetime(6), |
| 87 | + host_id bigint not null, |
| 88 | + updated_at datetime(6), |
| 89 | + room_name varchar(255), |
| 90 | + primary key (chatting_room_id) |
| 91 | +) engine=InnoDB |
| 92 | + |
| 93 | +create table historical_data ( |
| 94 | + is_deleted boolean default false not null, |
| 95 | + account_id bigint not null, |
| 96 | + created_at datetime(6), |
| 97 | + date datetime(6), |
| 98 | + historical_data_id bigint not null auto_increment, |
| 99 | + updated_at datetime(6), |
| 100 | + description varchar(255), |
| 101 | + scope varchar(255), |
| 102 | + title varchar(255), |
| 103 | + primary key (historical_data_id) |
| 104 | +) engine=InnoDB |
| 105 | + |
| 106 | +create table historical_data_file ( |
| 107 | + is_deleted boolean default false not null, |
| 108 | + created_at datetime(6), |
| 109 | + historical_data_file_id bigint not null auto_increment, |
| 110 | + historical_data_id bigint not null, |
| 111 | + updated_at datetime(6), |
| 112 | + file_url varchar(255), |
| 113 | + scope varchar(255), |
| 114 | + primary key (historical_data_file_id) |
| 115 | +) engine=InnoDB |
| 116 | + |
| 117 | +create table monthly_pt_price ( |
| 118 | + is_deleted boolean default false not null, |
| 119 | + period integer, |
| 120 | + price integer, |
| 121 | + account_id bigint, |
| 122 | + created_at datetime(6), |
| 123 | + monthly_pt_price_id bigint not null auto_increment, |
| 124 | + updated_at datetime(6), |
| 125 | + primary key (monthly_pt_price_id) |
| 126 | +) engine=InnoDB |
| 127 | + |
| 128 | +create table pt_matching ( |
| 129 | + is_deleted boolean default false not null, |
| 130 | + is_new_subscription bit, |
| 131 | + payment_amount integer, |
| 132 | + subscription_period integer, |
| 133 | + created_at datetime(6), |
| 134 | + expired_date datetime(6), |
| 135 | + pt_matching_id bigint not null auto_increment, |
| 136 | + start_date datetime(6), |
| 137 | + trainee_account_id bigint, |
| 138 | + trainer_account_id bigint, |
| 139 | + updated_at datetime(6), |
| 140 | + contact_type varchar(255), |
| 141 | + precaution varchar(255), |
| 142 | + reject_reason varchar(255), |
| 143 | + status varchar(255), |
| 144 | + primary key (pt_matching_id) |
| 145 | +) engine=InnoDB |
| 146 | + |
| 147 | +create table purpose ( |
| 148 | + is_deleted boolean default false not null, |
| 149 | + target_date date, |
| 150 | + account_id bigint, |
| 151 | + created_at datetime(6), |
| 152 | + purpose_id bigint not null auto_increment, |
| 153 | + updated_at datetime(6), |
| 154 | + content varchar(255), |
| 155 | + title varchar(255), |
| 156 | + primary key (purpose_id) |
| 157 | +) engine=InnoDB |
| 158 | + |
| 159 | +create table top_chatting_room ( |
| 160 | + is_deleted boolean default false not null, |
| 161 | + account_id bigint not null, |
| 162 | + chatting_room_id bigint not null, |
| 163 | + created_at datetime(6), |
| 164 | + updated_at datetime(6), |
| 165 | + primary key (account_id, chatting_room_id) |
| 166 | +) engine=InnoDB |
| 167 | + |
| 168 | +alter table account |
| 169 | + add constraint UK_83mc3wdw5cs7otc48exl2g9oa unique (identification_code) |
| 170 | + |
| 171 | +alter table career |
| 172 | + add constraint FKjsolsxeh4qap0ga7sidb5ol70 |
| 173 | + foreign key (account_id) |
| 174 | + references account (account_id) |
| 175 | + |
| 176 | +alter table chatting_message_bookmark |
| 177 | + add constraint FK401m1640clwl9coknhu8utwms |
| 178 | + foreign key (account_id) |
| 179 | + references account (account_id) |
| 180 | + |
| 181 | +alter table chatting_message_bookmark |
| 182 | + add constraint FK2xr546hkhv3nt4tvm8qx9ais9 |
| 183 | + foreign key (chatting_message_id) |
| 184 | + references chatting_message (chatting_message_id) |
| 185 | + |
| 186 | +alter table chatting_message_bookmark |
| 187 | + add constraint FKf2pp5gljs27gb65ry9g5cn8as |
| 188 | + foreign key (chatting_room_id) |
| 189 | + references chatting_room (chatting_room_id) |
| 190 | + |
| 191 | +alter table chatting_participant |
| 192 | + add constraint FKo72wxi8iuobqia3ib16l7wngw |
| 193 | + foreign key (account_id) |
| 194 | + references account (account_id) |
| 195 | + |
| 196 | +alter table chatting_participant |
| 197 | + add constraint FK7qrx8qm8j9udnlvryi0obyy02 |
| 198 | + foreign key (chatting_room_id) |
| 199 | + references chatting_room (chatting_room_id) |
| 200 | + |
| 201 | +alter table historical_data |
| 202 | + add constraint FKa9y3h19bvcclpixx3ogr3c7nb |
| 203 | + foreign key (account_id) |
| 204 | + references account (account_id) |
| 205 | + |
| 206 | +alter table historical_data_file |
| 207 | + add constraint FKeara218058068op1wpf8err2t |
| 208 | + foreign key (historical_data_id) |
| 209 | + references historical_data (historical_data_id) |
| 210 | + |
| 211 | +alter table monthly_pt_price |
| 212 | + add constraint FKlgvwurtxja3r9bsxf5b9bflwd |
| 213 | + foreign key (account_id) |
| 214 | + references account (account_id) |
| 215 | + |
| 216 | +alter table pt_matching |
| 217 | + add constraint FK2uqsyc1k5sfhxs2wekbqppmgg |
| 218 | + foreign key (trainee_account_id) |
| 219 | + references account (account_id) |
| 220 | + |
| 221 | +alter table pt_matching |
| 222 | + add constraint FKeohpalxemt7bjhd7jurrxprxi |
| 223 | + foreign key (trainer_account_id) |
| 224 | + references account (account_id) |
| 225 | + |
| 226 | +alter table purpose |
| 227 | + add constraint FKj3p0cuhk14r0u44okaiyqdw7g |
| 228 | + foreign key (account_id) |
| 229 | + references account (account_id) |
| 230 | + |
| 231 | +alter table top_chatting_room |
| 232 | + add constraint FKnvm80wb2hv5eed2f5soafe73q |
| 233 | + foreign key (account_id) |
| 234 | + references account (account_id) |
| 235 | + |
| 236 | +alter table top_chatting_room |
| 237 | + add constraint FK50uww0n32n3cce3myx4g27lib |
| 238 | + foreign key (chatting_room_id) |
| 239 | + references chatting_room (chatting_room_id) |
0 commit comments