-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathspring_cloud_alibaba_practice.sql
1259 lines (1156 loc) · 61.7 KB
/
spring_cloud_alibaba_practice.sql
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
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**chapterthree start**/
/**multi-tenant-spring-cloud-alibaba**/
CREATE DATABASE IF NOT EXISTS `spring_cloud_alibaba_practice`;
use `spring_cloud_alibaba_practice`;
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` bigint NOT NULL COMMENT '主键ID',
`tenant_id` bigint NOT NULL COMMENT '租户ID',
`name` varchar(30) DEFAULT NULL COMMENT '姓名',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
LOCK TABLES `user` WRITE;
INSERT INTO `user` VALUES (1,1,'张三'),(2,1,'李四'),(3,1,'王五'),(4,0,'胡弦'),(5,0,'胡辰昱');
UNLOCK TABLES;
commit;
use `spring_cloud_alibaba_practice`;
DROP TABLE IF EXISTS `USER_ADDR`;
CREATE TABLE `USER_ADDR` (
`id` bigint NOT NULL COMMENT '主键ID',
`user_id` bigint NOT NULL COMMENT 'user.id',
`name` varchar(30) DEFAULT NULL COMMENT '地址名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
LOCK TABLES `USER_ADDR` WRITE;
INSERT INTO `USER_ADDR` VALUES (1,1,'浙江省杭州市西湖区'),(2,4,'浙江省杭州市滨江区');
UNLOCK TABLES;
commit;
/**multi-tenant-spring-cloud-alibaba**/
/**multidata-source-spring-cloud-alibaba**/
CREATE DATABASE IF NOT EXISTS `spring_cloud_alibaba_practice_master`;
CREATE DATABASE IF NOT EXISTS `spring_cloud_alibaba_practice_slave1`;
CREATE DATABASE IF NOT EXISTS `spring_cloud_alibaba_practice_slave2`;
use `spring_cloud_alibaba_practice_master`;
DROP TABLE IF EXISTS `example2_product`;
CREATE TABLE `example2_product` (
`id` bigint NOT NULL,
`good_id` bigint NOT NULL DEFAULT '0',
`num` bigint DEFAULT '0',
`good_name` varchar(20) NOT NULL,
`version` int NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='第三章商品信息表';
LOCK TABLES `example2_product` WRITE;
INSERT INTO `example2_product` VALUES (7823734,5678,100,'master库测试商品',0);
UNLOCK TABLES;
commit;
use `spring_cloud_alibaba_practice_slave1`;
DROP TABLE IF EXISTS `example2_product`;
CREATE TABLE `example2_product` (
`id` bigint NOT NULL,
`good_id` bigint NOT NULL DEFAULT '0',
`num` bigint DEFAULT '0',
`good_name` varchar(20) NOT NULL,
`version` int NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='第三章商品信息表';
LOCK TABLES `example2_product` WRITE;
INSERT INTO `example2_product` VALUES (3457676,5678,100,'slave1库测试商品',0);
UNLOCK TABLES;
commit;
use `spring_cloud_alibaba_practice_slave2`;
DROP TABLE IF EXISTS `example2_product`;
CREATE TABLE `example2_product` (
`id` bigint NOT NULL,
`good_id` bigint NOT NULL DEFAULT '0',
`num` bigint DEFAULT '0',
`good_name` varchar(20) NOT NULL,
`version` int NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='第三章商品信息表';
LOCK TABLES `example2_product` WRITE;
INSERT INTO `example2_product` VALUES (2334343434,5678,100,'slave2测试商品',0);
UNLOCK TABLES;
commit;
/**multidata-source-spring-cloud-alibaba**/
/**optimistic-locking-spring-cloud-alibaba**/
use `spring_cloud_alibaba_practice`;
DROP TABLE IF EXISTS `example2_product`;
CREATE TABLE `example2_product` (
`id` bigint NOT NULL,
`good_id` bigint NOT NULL DEFAULT '0',
`num` bigint DEFAULT '0',
`good_name` varchar(20) NOT NULL,
`version` int NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='第三章商品信息表';
LOCK TABLES `example2_product` WRITE;
INSERT INTO `example2_product` VALUES (3467374334,6778,983848034626479,'手机',0),(3477374334,7878,120,'苹果笔记本电脑',2);
UNLOCK TABLES;
commit;
/**optimistic-locking-spring-cloud-alibaba**/
/**replace-table-spring-cloud-alibaba**/
use `spring_cloud_alibaba_practice`;
DROP TABLE IF EXISTS `example5_order_6767`;
CREATE TABLE `example5_order_6767` (
`id` bigint NOT NULL,
`order_name` varchar(20) NOT NULL,
`order_id` bigint NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
LOCK TABLES `example5_order_6767` WRITE;
INSERT INTO `example5_order_6767` VALUES (2323233,'租户6767的订单',2388923923);
UNLOCK TABLES;
commit;
use `spring_cloud_alibaba_practice`;
DROP TABLE IF EXISTS `example5_order_7878`;
CREATE TABLE `example5_order_7878` (
`id` bigint NOT NULL,
`order_name` varchar(20) NOT NULL,
`order_id` bigint NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
LOCK TABLES `example5_order_7878` WRITE;
INSERT INTO `example5_order_7878` VALUES (2323231111,'租户7878的订单',232323232323);
UNLOCK TABLES;
commit;
use `spring_cloud_alibaba_practice`;
DROP TABLE IF EXISTS `example5_order_8989`;
CREATE TABLE `example5_order_8989` (
`id` bigint NOT NULL,
`order_name` varchar(20) NOT NULL,
`order_id` bigint NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
LOCK TABLES `example5_order_8989` WRITE;
INSERT INTO `example5_order_8989` VALUES (2233443,'租户8989的订单',34333434343);
UNLOCK TABLES;
commit;
/**replace-table-spring-cloud-alibaba**/
/**chapterthree end**/
/**chapter four start**/
/**idempotent-design-spring-cloud-alibaba中的表在前面已经创建了**/
/**nacos-sync**/
/**搭建Nacos Sync环境的时候需要执行nacosSync.sql语句**/
/******************************************/
/* DB name = nacos_Sync */
/* Table name = cluster */
/******************************************/
CREATE DATABASE IF NOT EXISTS `nacos_sync`;
use `nacos_sync`;
CREATE TABLE `cluster` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`cluster_id` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`cluster_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`cluster_type` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`connect_key_list` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/******************************************/
/* DB name = nacos_Sync */
/* Table name = system_config */
/******************************************/
use `nacos_sync`;
CREATE TABLE `system_config` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`config_desc` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`config_key` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`config_value` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/******************************************/
/* DB name = nacos_Sync */
/* Table name = task */
/******************************************/
use `nacos_sync`;
CREATE TABLE `task` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dest_cluster_id` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`group_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`name_space` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`operation_id` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`service_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`source_cluster_id` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`task_id` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`task_status` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`version` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`worker_ip` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/**chapter four end**/
/**chapter five start**/
/**没有SQL执行**/
/**chapter five end**/
/**chapter six start**/
/**没有SQL执行**/
/**chapter six end**/
/**chapter seven start**/
/**7.3.1搭建Seata Server高可用的环境时需要执行的SQL语句**/
-- -------------------------------- The script used when storeMode is 'db' --------------------------------
-- the table to store GlobalSession data
CREATE DATABASE IF NOT EXISTS `seata_server`;
use `seata_server`;
CREATE TABLE IF NOT EXISTS `global_table`
(
`xid` VARCHAR(128) NOT NULL,
`transaction_id` BIGINT,
`status` TINYINT NOT NULL,
`application_id` VARCHAR(32),
`transaction_service_group` VARCHAR(32),
`transaction_name` VARCHAR(128),
`timeout` INT,
`begin_time` BIGINT,
`application_data` VARCHAR(2000),
`gmt_create` DATETIME,
`gmt_modified` DATETIME,
PRIMARY KEY (`xid`),
KEY `idx_gmt_modified_status` (`gmt_modified`, `status`),
KEY `idx_transaction_id` (`transaction_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8;
-- the table to store BranchSession data
use `seata_server`;
CREATE TABLE IF NOT EXISTS `branch_table`
(
`branch_id` BIGINT NOT NULL,
`xid` VARCHAR(128) NOT NULL,
`transaction_id` BIGINT,
`resource_group_id` VARCHAR(32),
`resource_id` VARCHAR(256),
`branch_type` VARCHAR(8),
`status` TINYINT,
`client_id` VARCHAR(64),
`application_data` VARCHAR(2000),
`gmt_create` DATETIME(6),
`gmt_modified` DATETIME(6),
PRIMARY KEY (`branch_id`),
KEY `idx_xid` (`xid`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8;
-- the table to store lock data
use `seata_server`;
CREATE TABLE IF NOT EXISTS `lock_table`
(
`row_key` VARCHAR(128) NOT NULL,
`xid` VARCHAR(96),
`transaction_id` BIGINT,
`branch_id` BIGINT NOT NULL,
`resource_id` VARCHAR(256),
`table_name` VARCHAR(32),
`pk` VARCHAR(36),
`gmt_create` DATETIME,
`gmt_modified` DATETIME,
PRIMARY KEY (`row_key`),
KEY `idx_branch_id` (`branch_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8;
commit;
/**业务实例需要的SQL语句**/
use `seata_server`;
CREATE TABLE IF NOT EXISTS `at_account` (
`id` bigint NOT NULL,
`account_name` varchar(50) DEFAULT NULL,
`account_id` bigint DEFAULT NULL,
`amount` bigint DEFAULT NULL,
`is_deleted` int NOT NULL,
`gmt_create` timestamp NOT NULL,
`gmt_modified` timestamp NULL DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `seata_server`;
CREATE TABLE IF NOT EXISTS `at_logistics` (
`id` bigint NOT NULL,
`logistics_id` bigint NOT NULL,
`logistics_name` varchar(50) DEFAULT NULL,
`status` int NOT NULL DEFAULT '0',
`order_id` bigint NOT NULL,
`is_deleted` int NOT NULL DEFAULT '0',
`gmt_create` timestamp NULL DEFAULT NULL,
`gmt_modified` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `at_logistics_id_uindex` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `seata_server`;
CREATE TABLE IF NOT EXISTS `at_order` (
`id` bigint NOT NULL,
`order_name` varchar(50) DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`order_amount` bigint DEFAULT NULL,
`is_deleted` int NOT NULL,
`gmt_create` timestamp NULL DEFAULT NULL,
`gmt_modified` timestamp NULL DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`user_id` bigint NOT NULL,
`order_status` int NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `seata_server`;
CREATE TABLE IF NOT EXISTS `at_storage` (
`id` bigint NOT NULL,
`num` bigint NOT NULL,
`good_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` timestamp NULL DEFAULT NULL,
`gmt_modified` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `seata_server`;
CREATE TABLE IF NOT EXISTS `at_warehouse` (
`id` bigint NOT NULL,
`warehouse_name` varchar(50) NOT NULL,
`status` int NOT NULL DEFAULT '0',
`order_id` bigint NOT NULL DEFAULT '0',
`good_id` bigint NOT NULL DEFAULT '0',
`is_deleted` int NOT NULL DEFAULT '0',
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`warehouse_id` bigint DEFAULT NULL,
`num` int NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `at_warehouse_id_uindex` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
commit;
/**Seata 客户端 undo log**/
-- for AT mode you must to init this sql for you business database. the seata server not need it.
use `seata_server`;
CREATE TABLE IF NOT EXISTS `undo_log`
(
`branch_id` BIGINT(20) NOT NULL COMMENT 'branch transaction id',
`xid` VARCHAR(100) NOT NULL COMMENT 'global transaction id',
`context` VARCHAR(128) NOT NULL COMMENT 'undo_log context,such as serialization',
`rollback_info` LONGBLOB NOT NULL COMMENT 'rollback info',
`log_status` INT(11) NOT NULL COMMENT '0:normal status,1:defense status',
`log_created` DATETIME(6) NOT NULL COMMENT 'create datetime',
`log_modified` DATETIME(6) NOT NULL COMMENT 'modify datetime',
UNIQUE KEY `ux_undo_log` (`xid`, `branch_id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8 COMMENT ='AT transaction mode undo table';
commit;
use `seata_server`;
CREATE TABLE `tcc_account` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
`user_id` bigint DEFAULT NULL COMMENT '用户id',
`residue` decimal(11,2) DEFAULT '0.00' COMMENT '剩余可用额度',
`frozen` decimal(11,2) DEFAULT '0.00' COMMENT 'TCC事务锁定的金额',
PRIMARY KEY (`id`),
UNIQUE KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
use `seata_server`;
CREATE TABLE `tcc_order` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
`order_no` varchar(128) NOT NULL COMMENT '订单号',
`user_id` bigint DEFAULT NULL COMMENT '用户id',
`product_id` bigint DEFAULT NULL COMMENT '产品id',
`amount` int DEFAULT NULL COMMENT '数量',
`money` decimal(11,2) DEFAULT NULL COMMENT '金额',
`status` int DEFAULT NULL COMMENT '订单状态:0:创建中;1:已完结',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
use `seata_server`;
CREATE TABLE `tcc_storage` (
`id` bigint NOT NULL AUTO_INCREMENT,
`product_id` bigint DEFAULT NULL COMMENT '产品id',
`residue` int DEFAULT NULL COMMENT '剩余库存',
`frozen` int DEFAULT '0' COMMENT 'TCC事务锁定的库存',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
commit;
/**chapter seven end**/
/**chapter eight start**/
/**没有SQL执行**/
/**chapter eight end**/
/**chapter nine start**/
/**没有SQL执行**/
/**chapter nine end**/
/**chapter ten start**/
/**没有SQL执行**/
/**chapter ten end**/
/**chapter eleven start**/
/**没有SQL执行**/
/**chapter eleven end**/
/**chapter twelve start**/
CREATE DATABASE IF NOT EXISTS `datasource_0`;
use `datasource_0`;
CREATE TABLE `t_address` (
`id` bigint NOT NULL AUTO_INCREMENT,
`address_name` varchar(50) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=701971395235167233 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_0`;
CREATE TABLE `t_order` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_0`;
CREATE TABLE `t_order_0` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_0`;
CREATE TABLE `t_order_1` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_0`;
CREATE TABLE `t_order_2` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_0`;
CREATE TABLE `t_order_item` (
`id` bigint NOT NULL AUTO_INCREMENT,
`order_id` bigint DEFAULT NULL,
`user_id` bigint NOT NULL,
`status` int NOT NULL DEFAULT '0',
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9109275335699899393 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_0`;
CREATE TABLE `t_order_item_0` (
`id` bigint DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_0`;
CREATE TABLE `t_order_item_1` (
`id` bigint DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_0`;
CREATE TABLE `t_order_item_2` (
`id` bigint DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
commit;
CREATE DATABASE IF NOT EXISTS `datasource_1`;
use `datasource_1`;
CREATE TABLE `t_address` (
`id` bigint DEFAULT NULL,
`address_name` varchar(50) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_1`;
CREATE TABLE `t_order` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_1`;
CREATE TABLE `t_order_0` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_1`;
CREATE TABLE `t_order_1` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_1`;
CREATE TABLE `t_order_2` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_1`;
CREATE TABLE `t_order_item` (
`id` bigint DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_1`;
CREATE TABLE `t_order_item_0` (
`id` bigint DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_1`;
CREATE TABLE `t_order_item_1` (
`id` bigint DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_1`;
CREATE TABLE `t_order_item_2` (
`id` bigint DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
commit;
CREATE DATABASE IF NOT EXISTS `datasource_2`;
use `datasource_2`;
CREATE TABLE `t_address` (
`id` bigint DEFAULT NULL,
`address_name` varchar(50) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_2`;
CREATE TABLE `t_order` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_2`;
CREATE TABLE `t_order_0` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_2`;
CREATE TABLE `t_order_1` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_2`;
CREATE TABLE `t_order_2` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_2`;
CREATE TABLE `t_order_item` (
`id` bigint DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_2`;
CREATE TABLE `t_order_item_0` (
`id` bigint DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_2`;
CREATE TABLE `t_order_item_1` (
`id` bigint DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `datasource_2`;
CREATE TABLE `t_order_item_2` (
`id` bigint DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
commit;
CREATE DATABASE IF NOT EXISTS `ds`;
use `ds`;
CREATE TABLE `t_address` (
`id` bigint DEFAULT NULL,
`address_name` varchar(50) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `ds`;
CREATE TABLE `t_order_0` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `ds`;
CREATE TABLE `t_order_1` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `ds`;
CREATE TABLE `t_order_2` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `ds`;
CREATE TABLE `t_order_item` (
`id` bigint DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `ds`;
CREATE TABLE `t_order_item_0` (
`id` bigint DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `ds`;
CREATE TABLE `t_order_item_1` (
`id` bigint DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `ds`;
CREATE TABLE `t_order_item_2` (
`id` bigint DEFAULT NULL,
`order_id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`good_id` bigint DEFAULT NULL,
`order_item_id` bigint DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
commit;
CREATE DATABASE IF NOT EXISTS `primary_ds`;
use `primary_ds`;
CREATE TABLE `t_order` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
commit;
CREATE DATABASE IF NOT EXISTS `replica_ds_0`;
use `replica_ds_0`;
CREATE TABLE `t_order` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
commit;
CREATE DATABASE IF NOT EXISTS `replica_ds_1`;
use `replica_ds_1`;
CREATE TABLE `t_order` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
commit;
CREATE DATABASE IF NOT EXISTS `primary_ds_0`;
use `primary_ds_0`;
CREATE TABLE `t_order` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `primary_ds_0`;
CREATE TABLE `t_order_0` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `primary_ds_0`;
CREATE TABLE `t_order_1` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
commit;
CREATE DATABASE IF NOT EXISTS `primary_ds_0_replica_0`;
use `primary_ds_0_replica_0`;
CREATE TABLE `t_order` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `primary_ds_0_replica_0`;
CREATE TABLE `t_order_0` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
use `primary_ds_0_replica_0`;
CREATE TABLE `t_order_1` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
`order_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
commit;
CREATE DATABASE IF NOT EXISTS `primary_ds_0_replica_1`;
use `primary_ds_0_replica_1`;
CREATE TABLE `t_order` (
`id` bigint DEFAULT NULL,
`user_id` bigint DEFAULT NULL,
`order_name` varchar(30) DEFAULT NULL,
`address_id` bigint DEFAULT NULL,
`status` int DEFAULT NULL,
`is_deleted` int DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,