1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
##----system_constant_dat create
DROP TABLE IF EXISTS system_constant_dat;
CREATE TABLE IF NOT EXISTS system_constant_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
name varchar(64) NOT NULL,
title varchar(128) NOT NULL,
constant_value text NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX system_constant_dat_name_idx ON system_constant_dat(name);
##----government_mst create
DROP TABLE IF EXISTS government_mst;
CREATE TABLE IF NOT EXISTS government_mst(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
province varchar(64) NOT NULL,
city varchar(64),
district varchar(64),
title text NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX government_mst_province_idx ON government_mst(province);
Create INDEX government_mst_city_idx ON government_mst(city);
Create INDEX government_mst_district_idx ON government_mst(district);
##----government_qr_dat create
DROP TABLE IF EXISTS government_qr_dat;
CREATE TABLE IF NOT EXISTS government_qr_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
government_id int8 NOT NULL,
province varchar(64) NOT NULL,
city varchar(64),
district varchar(64),
qr_image text NOT NULL,
use_count int8 NOT NULL DEFAULT '0',
max_count int8 NOT NULL DEFAULT '0',
limit_date varchar(10) NOT NULL,
title text NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX government_qr_dat_id_idx ON government_qr_dat(id);
Create INDEX government_qr_dat_province_idx ON government_qr_dat(province);
Create INDEX government_qr_dat_city_idx ON government_qr_dat(city);
Create INDEX government_qr_dat_district_idx ON government_qr_dat(district);
##----account_mst create
DROP TABLE IF EXISTS account_mst;
CREATE TABLE IF NOT EXISTS account_mst(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
login text NOT NULL,
password text NOT NULL,
name varchar(64) NOT NULL,
contact text,
role varchar(128) NOT NULL,
user_id int8 NOT NULL DEFAULT '0',
school_id int8 NOT NULL DEFAULT '0',
government_id int8 NOT NULL DEFAULT '0',
modules text NOT NULL,
comment text,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX account_mst_login_idx ON account_mst(login(255));
Create INDEX account_mst_password_idx ON account_mst(password(255));
Create INDEX account_mst_name_idx ON account_mst(name);
##----school_mst create
DROP TABLE IF EXISTS school_mst;
CREATE TABLE IF NOT EXISTS school_mst(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
school_no varchar(64) NOT NULL,
original_source int8 NOT NULL DEFAULT '0',
title text NOT NULL,
school_type varchar(64) NOT NULL,
front_image text,
comment text,
address text,
province varchar(64),
city varchar(64),
district varchar(64),
street text,
longitude text,
latitude text,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX school_mst_id_idx ON school_mst(id);
Create INDEX school_mst_school_type_idx ON school_mst(school_type);
Create INDEX school_mst_province_idx ON school_mst(province);
Create INDEX school_mst_city_idx ON school_mst(city);
##----grade_mst create
DROP TABLE IF EXISTS grade_mst;
CREATE TABLE IF NOT EXISTS grade_mst(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
school_id int8 NOT NULL,
school_no varchar(64) NOT NULL,
original_source int8 NOT NULL DEFAULT '0',
title text NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX grade_mst_school_id_idx ON grade_mst(school_id);
##----class_mst create
DROP TABLE IF EXISTS class_mst;
CREATE TABLE IF NOT EXISTS class_mst(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
school_id int8 NOT NULL,
school_no varchar(64) NOT NULL,
class_no varchar(64) NOT NULL,
original_source int8 NOT NULL DEFAULT '0',
grade_id int8 NOT NULL,
title text NOT NULL,
member_count int8 NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX class_mst_school_id_idx ON class_mst(school_id);
Create INDEX class_mst_grade_id_idx ON class_mst(grade_id);
Create INDEX class_mst_class_no_idx ON class_mst(class_no);
##----circle_dat create
DROP TABLE IF EXISTS circle_dat;
CREATE TABLE IF NOT EXISTS circle_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
title varchar(64) NOT NULL,
member_count int8 NOT NULL DEFAULT '0',
need_check tinyint(1) NOT NULL DEFAULT '0',
front_image text,
images text,
comment text,
longitude text NOT NULL,
latitude text NOT NULL,
province varchar(64) NOT NULL,
city varchar(64) NOT NULL,
district varchar(64) NOT NULL,
owner_id int8 NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX circle_dat_title_idx ON circle_dat(title);
Create INDEX circle_dat_owner_id_idx ON circle_dat(owner_id);
##----circle_notice_dat create
DROP TABLE IF EXISTS circle_notice_dat;
CREATE TABLE IF NOT EXISTS circle_notice_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
circle_id int8 NOT NULL DEFAULT '0',
title varchar(128) NOT NULL,
comment text,
image text,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX circle_notice_dat_circle_id_idx ON circle_notice_dat(circle_id);
##----circle_member_dat create
DROP TABLE IF EXISTS circle_member_dat;
CREATE TABLE IF NOT EXISTS circle_member_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
circle_id int8 NOT NULL DEFAULT '0',
user_id int8 NOT NULL DEFAULT '0',
name varchar(64),
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX circle_member_dat_circle_id_idx ON circle_member_dat(circle_id);
Create INDEX circle_member_dat_user_id_idx ON circle_member_dat(user_id);
##----user_mst create
DROP TABLE IF EXISTS user_mst;
CREATE TABLE IF NOT EXISTS user_mst(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
school_no varchar(64) NOT NULL DEFAULT '0',
class_no varchar(64) NOT NULL DEFAULT '0',
original_source int8 NOT NULL DEFAULT '0',
openid varchar(64) NOT NULL,
unionid varchar(64) NOT NULL,
name varchar(64),
header_img text,
mobile varchar(32),
account_id int8 NOT NULL DEFAULT '0',
child_age int8 NOT NULL DEFAULT '1',
role int8 NOT NULL DEFAULT '0',
school_owner tinyint(1) NOT NULL DEFAULT '0',
class_owner tinyint(1) NOT NULL DEFAULT '0',
longitude text,
latitude text,
government_id int8 NOT NULL DEFAULT '0',
province varchar(64),
city varchar(64),
district varchar(64),
organization_submit_date timestamp,
organization_no varchar(255),
organization_title text,
legal_person varchar(255),
organization_contact text,
legal_person_imgage1 text,
legal_person_imgage2 text,
licensen_imgage text,
other_imgage text,
organization_status varchar(64) NOT NULL DEFAULT 'NEW',
is_member tinyint(1) NOT NULL DEFAULT '0'
ability_point int8 NOT NULL DEFAULT '0',
service_point int8 NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX user_mst_school_no_idx ON user_mst(school_no);
Create INDEX user_mst_class_no_idx ON user_mst(class_no);
Create INDEX user_mst_openid_idx ON user_mst(openid);
Create INDEX user_mst_unionid_idx ON user_mst(unionid);
##----user_message_dat create
DROP TABLE IF EXISTS user_message_dat;
CREATE TABLE IF NOT EXISTS user_message_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
user_id int8 NOT NULL DEFAULT '0',
title varchar(128) NOT NULL,
comment text,
attach_dat_type text,
attach_dat_id int8 NOT NULL DEFAULT '0',
attach_dat_path text,
is_read tinyint(1) NOT NULL DEFAULT '0',
is_operated tinyint(1) NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX user_message_dat_user_id_idx ON user_message_dat(user_id);
##----social_event_dat create
DROP TABLE IF EXISTS social_event_dat;
CREATE TABLE IF NOT EXISTS social_event_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
school_no varchar(64) NOT NULL,
class_no varchar(64) NOT NULL,
event_id int8 NOT NULL,
original_source int8 NOT NULL DEFAULT '0',
title text NOT NULL,
author text NOT NULL,
publish_time timestamp NOT NULL,
front_image text,
images text,
content text NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX social_event_dat_school_no_idx ON social_event_dat(school_no);
Create INDEX social_event_dat_class_no_idx ON social_event_dat(class_no);
Create INDEX social_event_dat_original_source_idx ON social_event_dat(original_source);
##----social_event_member_dat create
DROP TABLE IF EXISTS social_event_member_dat;
CREATE TABLE IF NOT EXISTS social_event_member_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
social_event_id int8 NOT NULL,
user_id int8 NOT NULL,
comment text NOT NULL,
front_image text,
images text,
status varchar(64) NOT NULL DEFAULT '0',
point int8 NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX social_event_member_dat_user_id_idx ON social_event_member_dat(user_id);
Create INDEX social_event_member_dat_social_event_id_idx ON social_event_member_dat(social_event_id);
##----family_event_dat create
DROP TABLE IF EXISTS family_event_dat;
CREATE TABLE IF NOT EXISTS family_event_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
school_no varchar(64) NOT NULL,
class_no varchar(64) NOT NULL,
event_id int8 NOT NULL,
original_source int8 NOT NULL DEFAULT '0',
title text NOT NULL,
author text NOT NULL,
publish_time timestamp NOT NULL,
images text,
content text NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX family_event_dat_school_no_idx ON family_event_dat(school_no);
Create INDEX family_event_dat_class_no_idx ON family_event_dat(class_no);
Create INDEX family_event_dat_original_source_idx ON family_event_dat(original_source);
##----family_event_member_dat create
DROP TABLE IF EXISTS family_event_member_dat;
CREATE TABLE IF NOT EXISTS family_event_member_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
family_event_id int8 NOT NULL,
user_id int8 NOT NULL,
comment text NOT NULL,
images text,
status varchar(64) NOT NULL DEFAULT '0',
point int8 NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX family_event_member_dat_user_id_idx ON family_event_member_dat(user_id);
Create INDEX family_event_member_dat_family_event_id_idx ON family_event_member_dat(family_event_id);
##----volunteer_event_member_dat create
DROP TABLE IF EXISTS volunteer_event_member_dat;
CREATE TABLE IF NOT EXISTS volunteer_event_member_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
volunteer_event_id int8 NOT NULL,
index_no varchar(5) NOT NULL,
user_id int8 NOT NULL,
circle_id int8 NOT NULL DEFAULT '0',
is_owner tinyint(1) NOT NULL DEFAULT '0',
mobile varchar(32) NOT NULL,
comment text,
images text,
position text,
position_longitude text,
position_latitude text,
role int8 NOT NULL DEFAULT '0',
time_length float(6,2) NOT NULL DEFAULT '0.00',
finish_time timestamp,
status varchar(64) NOT NULL DEFAULT 'NEW',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX volunteer_event_member_dat_volunteer_event_id_idx ON volunteer_event_member_dat(volunteer_event_id);
Create INDEX volunteer_event_member_dat_user_id_idx ON volunteer_event_member_dat(user_id);
Create INDEX volunteer_event_member_dat_circle_id_idx ON volunteer_event_member_dat(circle_id);
##----volunteer_event_dat create
DROP TABLE IF EXISTS volunteer_event_dat;
CREATE TABLE IF NOT EXISTS volunteer_event_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
title text NOT NULL,
comment text NOT NULL,
start_time timestamp NOT NULL,
finish_time timestamp NOT NULL,
enroll_time timestamp NOT NULL,
front_image text NOT NULL,
position text NOT NULL,
position_longitude text NOT NULL,
position_latitude text NOT NULL,
account_id int8 NOT NULL DEFAULT '0',
circle_id int8 NOT NULL DEFAULT '0',
author varchar(64) NOT NULL,
author_role int8 NOT NULL DEFAULT '0',
auditor_id int8,
auditor_name varchar(64),
school_no varchar(64) NOT NULL DEFAULT '0',
original_source int8 NOT NULL DEFAULT '0',
province varchar(64),
city varchar(64),
district varchar(64),
include_social_user tinyint(1) NOT NULL DEFAULT '0',
max_member int8 NOT NULL DEFAULT '0',
member_count int8 NOT NULL DEFAULT '0',
time_length varchar(64) NOT NULL,
leader_name varchar(64) NOT NULL,
leader_contact varchar(128) NOT NULL,
venue text NOT NULL,
venue_time timestamp NOT NULL,
status varchar(64) NOT NULL DEFAULT 'NEW',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX volunteer_event_dat_id_idx ON volunteer_event_dat(id);
##----user_certificate_dat create
DROP TABLE IF EXISTS user_certificate_dat;
CREATE TABLE IF NOT EXISTS user_certificate_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
user_id int8 NOT NULL,
certificate_id int8 NOT NULL,
name varchar(64) NOT NULL,
mobile varchar(32) NOT NULL,
address varchar(128) NOT NULL,
status varchar(64) NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX user_certificate_dat_user_id_idx ON user_certificate_dat(user_id);
Create INDEX user_certificate_dat_certificate_id_idx ON user_certificate_dat(certificate_id);
##----certificate_mst create
DROP TABLE IF EXISTS certificate_mst;
CREATE TABLE IF NOT EXISTS certificate_mst(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
title varchar(128) NOT NULL,
front_image text NOT NULL,
display_order int8 NOT NULL DEFAULT '1',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX certificate_mst_id_idx ON certificate_mst(id);
##----user_pay_log create
DROP TABLE IF EXISTS user_pay_log;
CREATE TABLE IF NOT EXISTS user_pay_log(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
user_id int8 NOT NULL,
user_name varchar(64) NOT NULL,
action_type varchar(32) NOT NULL,
money float(5,2) NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX user_pay_log_user_id_idx ON user_pay_log(user_id);
Create INDEX user_pay_log_action_type_idx ON user_pay_log(action_type);
##----course_media_dat create
DROP TABLE IF EXISTS course_media_dat;
CREATE TABLE IF NOT EXISTS course_media_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
course_id int8 NOT NULL DEFAULT '0',
parent_category_id int8 NOT NULL EFAULT '0',
sub_category_id int8 NOT NULL EFAULT '0',
title varchar(128) NOT NULL,
comment text NOT NULL,
tags text NOT NULL,
front_image text NOT NULL,
media text NOT NULL,
size int8 NOT NULL DEFAULT '0',
teacher varchar(128),
teacher_profile text,
is_free tinyint(1) NOT NULL DEFAULT '0',
price float(5,2) NOT NULL DEFAULT '0',
view_count int8 NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX course_media_dat_course_id_idx ON course_media_dat(course_id);
##----media_tag_dat create
DROP TABLE IF EXISTS media_tag_dat;
CREATE TABLE IF NOT EXISTS media_tag_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
tag varchar(128) NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX media_tag_dat_tag_idx ON media_tag_dat(tag);
##----course_category_dat create
DROP TABLE IF EXISTS course_category_dat;
CREATE TABLE IF NOT EXISTS course_category_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
parent_id int4 NOT NULL,
title varchar(128) NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX course_category_dat_id_idx ON course_category_dat(id);
Create INDEX course_category_dat_parent_id_idx ON course_category_dat(parent_id);
##----course_mst create
DROP TABLE IF EXISTS course_mst;
CREATE TABLE IF NOT EXISTS course_mst(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
parent_category_id int8 NOT NULL,
sub_category_id int8 NOT NULL,
title varchar(128) NOT NULL,
comment text NOT NULL,
front_image text NOT NULL,
teacher_name varchar(128) NOT NULL,
teacher_profile text,
media_count int4 NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX course_mst_id_idx ON course_mst(id);
Create INDEX course_mst_title_idx ON course_mst(title);
##----user_buy_member_dat create
DROP TABLE IF EXISTS user_buy_member_dat;
CREATE TABLE IF NOT EXISTS user_buy_member_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
user_id int8 NOT NULL,
money float(5,2) NOT NULL DEFAULT '0',
order_no varchar(128),
mchid_order_no varchar(255),
status varchar(64),
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX user_buy_member_dat_user_id_idx ON user_buy_member_dat(user_id);
Create INDEX user_buy_member_dat_order_no_idx ON user_buy_member_dat(order_no);
##----user_media_dat create
DROP TABLE IF EXISTS user_media_dat;
CREATE TABLE IF NOT EXISTS user_media_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
user_id int8 NOT NULL,
course_id int8 NOT NULL,
media_id int8 NOT NULL,
is_free tinyint(1) NOT NULL DEFAULT '0',
money float(5,2) NOT NULL DEFAULT '0',
order_no varchar(255),
mchid_order_no varchar(255),
status varchar(64),
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX user_media_dat_user_id_idx ON user_media_dat(user_id);
Create INDEX user_media_dat_course_id_idx ON user_media_dat(course_id);
Create INDEX user_media_dat_media_id_idx ON user_media_dat(media_id);
##----donations_event_dat create
DROP TABLE IF EXISTS donations_event_dat;
CREATE TABLE IF NOT EXISTS donations_event_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
title text NOT NULL,
comment text NOT NULL,
start_time timestamp NOT NULL,
finish_time timestamp NOT NULL,
front_image text NOT NULL,
author varchar(64) NOT NULL,
author_role int8 NOT NULL DEFAULT '0',
auditor_id int8,
auditor_name varchar(64),
max_money float(10,2) NOT NULL DEFAULT '0',
money float(10,2) NOT NULL DEFAULT '0',
status varchar(64) NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX donations_event_dat_id_idx ON donations_event_dat(id);
##----user_donation_dat create
DROP TABLE IF EXISTS user_donation_dat;
CREATE TABLE IF NOT EXISTS user_donation_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
user_id int8 NOT NULL,
donation_id int8 NOT NULL,
comment text,
money float(5,2) NOT NULL DEFAULT '0',
order_no varchar(255),
mchid_order_no varchar(255),
status varchar(64),
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX user_donation_dat_user_id_idx ON user_donation_dat(user_id);
Create INDEX user_donation_dat_donation_id_idx ON user_donation_dat(donation_id);