Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
loit-shardingsphere-seata-nacos-feign-provider
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
loit-Infrastructure-example
loit-shardingsphere-seata-nacos-feign-provider
Commits
232a8c01
提交
232a8c01
authored
2月 17, 2020
作者:
陈世营
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
分表分库 多线程性能测试
上级
e6b0d8e1
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
282 行增加
和
122 行删除
+282
-122
ThreadPoolTaskConfig.java
...sphere/seata/nacos/feign/config/ThreadPoolTaskConfig.java
+69
-0
DemoController.java
...ngsphere/seata/nacos/feign/controller/DemoController.java
+13
-1
BusinessServiceImpl.java
...nacos/feign/modules/service/impl/BusinessServiceImpl.java
+18
-21
application-dev.yml
...eign-provider-main/src/main/resources/application-dev.yml
+9
-35
application-master-slave.yml
...ider-main/src/main/resources/application-master-slave.yml
+1
-1
application-sharding-tables.yml
...r-main/src/main/resources/application-sharding-tables.yml
+5
-5
file.conf
...ta-nacos-feign-provider-main/src/main/resources/file.conf
+2
-2
logback.xml
...-nacos-feign-provider-main/src/main/resources/logback.xml
+1
-1
demo_ds.sql
...os-feign-provider-main/src/main/resources/sql/demo_ds.sql
+164
-56
没有找到文件。
loit-shardingsphere-seata-nacos-feign-provider-main/src/main/java/com/loit/shardingsphere/seata/nacos/feign/config/ThreadPoolTaskConfig.java
0 → 100644
浏览文件 @
232a8c01
package
com
.
loit
.
shardingsphere
.
seata
.
nacos
.
feign
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.AsyncConfigurer
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
java.lang.reflect.Method
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.ThreadPoolExecutor
;
/**
* 1. 当一个任务被提交到线程池时,首先查看线程池的核心线程是否都在执行任务,否就选择一条线程执行任务,是就执行第二步。
* 2. 查看核心线程池是否已满,不满就创建一条线程执行任务,否则执行第三步。
* 3. 查看任务队列是否已满,不满就将任务存储在任务队列中(SynchronousQueue同步队直接执行第四步),否则执行第四步。
* 4. 查看线程池是否已满,不满就创建一条线程执行任务,否则就按照策略处理无法执行的任务。
*/
@Configuration
@EnableAsync
@Slf4j
public
class
ThreadPoolTaskConfig
implements
AsyncConfigurer
{
//配置类实现AsyncConfigurer接口并重写AsyncConfigurer方法,并返回一个ThreadPoolTaskExecutor
//这样我们就得到了一个基于线程池的TaskExecutor
@Override
public
Executor
getAsyncExecutor
()
{
ThreadPoolTaskExecutor
taskExecutor
=
new
ThreadPoolTaskExecutor
();
//如果池中的实际线程数小于corePoolSize,无论是否其中有空闲的线程,都会给新的任务产生新的线程
taskExecutor
.
setCorePoolSize
(
5
);
//连接池中保留的最大连接数。Default: 15 maxPoolSize
taskExecutor
.
setMaxPoolSize
(
200
);
//queueCapacity 线程池所使用的缓冲队列
taskExecutor
.
setQueueCapacity
(
500
);
//除核心线程外的线程存活时间
taskExecutor
.
setKeepAliveSeconds
(
10
);
//线程名称前缀
taskExecutor
.
setThreadNamePrefix
(
"thread-sharding-execute"
);
//设置拒绝策略
taskExecutor
.
setRejectedExecutionHandler
(
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
taskExecutor
.
initialize
();
return
taskExecutor
;
}
@Override
public
AsyncUncaughtExceptionHandler
getAsyncUncaughtExceptionHandler
()
{
return
new
SplcCxtjAsyncExceptionHandler
();
}
class
SplcCxtjAsyncExceptionHandler
implements
AsyncUncaughtExceptionHandler
{
@Override
public
void
handleUncaughtException
(
Throwable
throwable
,
Method
method
,
Object
...
objects
)
{
log
.
error
(
"-------------------------->> thread-sharding-execute-"
);
log
.
error
(
"-------------------------->>>> Exception message - "
+
throwable
.
getMessage
());
log
.
error
(
"-------------------------->>>> Method name - "
+
method
.
getName
());
for
(
Object
param
:
objects
)
{
log
.
error
(
"-------------------------->>>> Parameter value - "
+
String
.
valueOf
(
param
));
}
}
}
}
loit-shardingsphere-seata-nacos-feign-provider-main/src/main/java/com/loit/shardingsphere/seata/nacos/feign/controller/DemoController.java
浏览文件 @
232a8c01
...
...
@@ -28,20 +28,32 @@ public class DemoController {
@GetMapping
(
"purchase"
)
public
void
purchase
()
{
for
(
long
i
=
1
;
i
<
20
;
i
++)
{
long
startTime
=
System
.
currentTimeMillis
();
//获取开始时间
for
(
long
i
=
3920570
;
i
<=
10000000
;
i
++)
{
try
{
businessService
.
purchase
(
i
);
}
catch
(
Exception
e
)
{
log
.
info
(
e
.
getMessage
(),
e
);
}
}
long
endTime
=
System
.
currentTimeMillis
();
//获取结束时间
log
.
error
(
"程序运行时间:"
+
(
endTime
-
startTime
)
+
"ms"
);
//输出程序运行时间
log
.
info
(
"success"
);
}
@GetMapping
(
"findPage"
)
public
void
findPage
()
{
long
startTime
=
System
.
currentTimeMillis
();
//获取开始时间
List
<
OrderEntity
>
pageList
=
orderService
.
findPage
(
0
l
,
5
l
);
log
.
info
(
pageList
.
toString
());
long
endTime
=
System
.
currentTimeMillis
();
//获取结束时间
log
.
error
(
"程序运行时间:"
+
(
endTime
-
startTime
)
+
"ms"
);
//输出程序运行时间
log
.
info
(
"success"
);
}
...
...
loit-shardingsphere-seata-nacos-feign-provider-main/src/main/java/com/loit/shardingsphere/seata/nacos/feign/modules/service/impl/BusinessServiceImpl.java
浏览文件 @
232a8c01
...
...
@@ -3,11 +3,8 @@ package com.loit.shardingsphere.seata.nacos.feign.modules.service.impl;
import
com.loit.shardingsphere.seata.nacos.feign.modules.entity.OrderEntity
;
import
com.loit.shardingsphere.seata.nacos.feign.modules.service.IBusinessService
;
import
com.loit.shardingsphere.seata.nacos.feign.modules.service.IOrderService
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
org.apache.shardingsphere.transaction.annotation.ShardingTransactionType
;
import
org.apache.shardingsphere.transaction.core.TransactionType
;
import
org.apache.shardingsphere.transaction.core.TransactionTypeHolder
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -22,7 +19,7 @@ public class BusinessServiceImpl implements IBusinessService {
*
* @param userId
*/
@Override
/*
@Override
@ShardingTransactionType(TransactionType.BASE)
@GlobalTransactional
public void purchase(Long userId) {
...
...
@@ -36,26 +33,26 @@ public class BusinessServiceImpl implements IBusinessService {
orderEntity.setUserId(userId.intValue());
orderService.insertOrder(orderEntity);
//throw new RuntimeException("回滚测试");
}
}
*/
/**
* 分表 使用本地事务
*
* @param userId
*/
// @Override
// @ShardingTransactionType(TransactionType.LOCAL)
// @Transactional
// public void purchase(Long userId) {
// if (userId == null) {
// return;
// }
// TransactionTypeHolder.set(TransactionType.LOCAL);
// OrderEntity orderEntity = new OrderEntity();
// orderEntity.setOrderId(userId);
// orderEntity.setStatus("seata");
// orderEntity.setUserId(userId.intValue());
// orderService.insertOrder(orderEntity);
// throw new RuntimeException("回滚测试");
// }
@Override
@Transactional
@Async
public
void
purchase
(
Long
userId
)
{
if
(
userId
==
null
)
{
return
;
}
OrderEntity
orderEntity
=
new
OrderEntity
();
orderEntity
.
setOrderId
(
userId
);
orderEntity
.
setStatus
(
"seata"
);
orderEntity
.
setUserId
(
userId
.
intValue
());
orderService
.
insertOrder
(
orderEntity
);
//throw new RuntimeException("回滚测试");
}
}
loit-shardingsphere-seata-nacos-feign-provider-main/src/main/resources/application-dev.yml
浏览文件 @
232a8c01
...
...
@@ -18,37 +18,15 @@ spring:
proxy-target-class
:
true
shardingsphere
:
datasource
:
names
:
ds
0,ds1
ds
0
:
names
:
ds
ds
:
type
:
com.alibaba.druid.pool.DruidDataSource
# type: com.zaxxer.hikari.HikariDataSource
driver-class-name
:
com.mysql.jdbc.Driver
username
:
root
password
:
loit2019ABC
jdbc-url
:
jdbc:mysql://192.168.66.40:3321/demo_ds_0?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
url
:
jdbc:mysql://192.168.66.40:3321/demo_ds_0?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
filters
:
stat,wall,log4j
maxActive
:
20
initialSize
:
1
maxWait
:
60000
minIdle
:
1
timeBetweenEvictionRunsMillis
:
60000
minEvictableIdleTimeMillis
:
300000
validationQuery
:
select 'x'
testWhileIdle
:
true
testOnBorrow
:
false
testOnReturn
:
false
poolPreparedStatements
:
true
maxOpenPreparedStatements
:
20
connection-properties
:
druid.stat.merggSql=ture;druid.stat.slowSqlMillis=5000
ds1
:
type
:
com.alibaba.druid.pool.DruidDataSource
# type: com.zaxxer.hikari.HikariDataSource
driver-class-name
:
com.mysql.jdbc.Driver
username
:
root
password
:
loit2019ABC
jdbc-url
:
jdbc:mysql://192.168.66.40:3321/demo_ds_1?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
url
:
jdbc:mysql://192.168.66.40:3321/demo_ds_1?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
jdbc-url
:
jdbc:mysql://192.168.66.40:3321/demo_ds?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
url
:
jdbc:mysql://192.168.66.40:3321/demo_ds?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
filters
:
stat,wall,log4j
maxActive
:
20
initialSize
:
1
...
...
@@ -64,28 +42,24 @@ spring:
maxOpenPreparedStatements
:
20
connection-properties
:
druid.stat.merggSql=ture;druid.stat.slowSqlMillis=5000
sharding
:
default-database-strategy
:
inline
:
sharding-column
:
user_id
algorithm-expression
:
ds$->{user_id % 2}
tables
:
t_order
:
actual-data-nodes
:
ds
$->{0..1}.t_order_$->{0..1
}
actual-data-nodes
:
ds
.t_order_$->{0..9
}
table-strategy
:
inline
:
sharding-column
:
order_id
algorithm-expression
:
t_order_$->{order_id %
2
}
algorithm-expression
:
t_order_$->{order_id %
10
}
key-generator
:
column
:
order_id
type
:
SNOWFLAKE
props
:
worker.id
:
123
t_order_item
:
actual-data-nodes
:
ds
$->{0..1}.t_order_item_$->{0..1
}
actual-data-nodes
:
ds
.t_order_item_$->{0..9
}
table-strategy
:
inline
:
sharding-column
:
order_id
algorithm-expression
:
t_order_item_$->{order_id %
2
}
algorithm-expression
:
t_order_item_$->{order_id %
10
}
key-generator
:
column
:
order_item_id
type
:
SNOWFLAKE
...
...
@@ -96,7 +70,7 @@ mybatis-plus:
# datasource: dataSource
mapper-locations
:
classpath:/mapper/**/*.xml
#实体扫描,多个package用逗号或者分号分隔
type-aliases-package
:
com.loit.shardingsphere.seata
.nacos.feign.modules
type-aliases-package
:
com.loit.shardingsphere.seata
#typeEnumsPackage: com.baomidou.springboot.entity.enums
global-config
:
#主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID", 4:"该类型为未设置主键类型", 5:"字符串全局唯一ID";
...
...
loit-shardingsphere-seata-nacos-feign-provider-main/src/main/resources/application-master-slave.yml
浏览文件 @
232a8c01
...
...
@@ -74,7 +74,7 @@ mybatis-plus:
# datasource: dataSource
mapper-locations
:
classpath:/mapper/**/*.xml
#实体扫描,多个package用逗号或者分号分隔
type-aliases-package
:
com.loit.shardingsphere.seata
.modules.entity
type-aliases-package
:
com.loit.shardingsphere.seata
#typeEnumsPackage: com.baomidou.springboot.entity.enums
global-config
:
#主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID", 4:"该类型为未设置主键类型", 5:"字符串全局唯一ID";
...
...
loit-shardingsphere-seata-nacos-feign-provider-main/src/main/resources/application-sharding-tables.yml
浏览文件 @
232a8c01
...
...
@@ -44,22 +44,22 @@ spring:
sharding
:
tables
:
t_order
:
actual-data-nodes
:
ds.t_order_$->{0..
1
}
actual-data-nodes
:
ds.t_order_$->{0..
9
}
table-strategy
:
inline
:
sharding-column
:
order_id
algorithm-expression
:
t_order_$->{order_id %
2
}
algorithm-expression
:
t_order_$->{order_id %
10
}
key-generator
:
column
:
order_id
type
:
SNOWFLAKE
props
:
worker.id
:
123
t_order_item
:
actual-data-nodes
:
ds.t_order_item_$->{0..
1
}
actual-data-nodes
:
ds.t_order_item_$->{0..
9
}
table-strategy
:
inline
:
sharding-column
:
order_id
algorithm-expression
:
t_order_item_$->{order_id %
2
}
algorithm-expression
:
t_order_item_$->{order_id %
10
}
key-generator
:
column
:
order_item_id
type
:
SNOWFLAKE
...
...
@@ -70,7 +70,7 @@ mybatis-plus:
# datasource: dataSource
mapper-locations
:
classpath:/mapper/**/*.xml
#实体扫描,多个package用逗号或者分号分隔
type-aliases-package
:
com.loit.shardingsphere.seata
.modules.entity
type-aliases-package
:
com.loit.shardingsphere.seata
#typeEnumsPackage: com.baomidou.springboot.entity.enums
global-config
:
#主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID", 4:"该类型为未设置主键类型", 5:"字符串全局唯一ID";
...
...
loit-shardingsphere-seata-nacos-feign-provider-main/src/main/resources/file.conf
浏览文件 @
232a8c01
...
...
@@ -94,9 +94,9 @@ store {
## mysql/oracle/h2/oceanbase etc.
db
-
type
=
"mysql"
driver
-
class
-
name
=
"com.mysql.jdbc.Driver"
url
=
"jdbc:mysql://
39.98.202.173:3306
/seata_server"
url
=
"jdbc:mysql://
192.168.66.40:3321
/seata_server"
user
=
"root"
password
=
"
abcd1234A!
"
password
=
"
loit2019ABC
"
min
-
conn
=
1
max
-
conn
=
10
global
.
table
=
"global_table"
...
...
loit-shardingsphere-seata-nacos-feign-provider-main/src/main/resources/logback.xml
浏览文件 @
232a8c01
...
...
@@ -26,7 +26,7 @@
</encoder>
</appender>
<root
level=
"
DEBUG
"
>
<root
level=
"
ERROR
"
>
<appender-ref
ref=
"seata-default"
/>
<appender-ref
ref=
"stdout"
/>
</root>
...
...
loit-shardingsphere-seata-nacos-feign-provider-main/src/main/resources/sql/demo_ds.sql
浏览文件 @
232a8c01
/*
Navicat MySQL Data Transfer
Source Server :
39.98.202.173seata
Source Server Version : 5072
5
Source Host :
39.98.202.173:3306
Source Server :
192.168.66.40.7
Source Server Version : 5072
2
Source Host :
192.168.66.40:3321
Source Database : demo_ds
Target Server Type : MYSQL
Target Server Version : 5072
5
Target Server Version : 5072
2
File Encoding : 65001
Date: 2020-02-1
3 22:37:45
Date: 2020-02-1
7 16:51:00
*/
SET
FOREIGN_KEY_CHECKS
=
0
;
...
...
@@ -19,90 +19,198 @@ SET FOREIGN_KEY_CHECKS=0;
-- Table structure for t_order
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_order`
;
CREATE
TABLE
"t_order"
(
"id"
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
"order_id"
bigint
(
20
)
NOT
NULL
,
"user_id"
int
(
11
)
NOT
NULL
,
"status"
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
"id"
)
CREATE
TABLE
`t_order`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
`order_id`
bigint
(
20
)
NOT
NULL
,
`user_id`
int
(
11
)
NOT
NULL
,
`status`
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Table structure for t_order_0
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_order_0`
;
CREATE
TABLE
"t_order_0"
(
"id"
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
"order_id"
bigint
(
20
)
NOT
NULL
,
"user_id"
int
(
11
)
NOT
NULL
,
"status"
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
"id"
)
CREATE
TABLE
`t_order_0`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
`order_id`
bigint
(
20
)
NOT
NULL
,
`user_id`
int
(
11
)
NOT
NULL
,
`status`
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Table structure for t_order_1
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_order_1`
;
CREATE
TABLE
"t_order_1"
(
"id"
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
"order_id"
bigint
(
20
)
NOT
NULL
,
"user_id"
int
(
11
)
NOT
NULL
,
"status"
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
"id"
)
CREATE
TABLE
`t_order_1`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
`order_id`
bigint
(
20
)
NOT
NULL
,
`user_id`
int
(
11
)
NOT
NULL
,
`status`
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Table structure for t_order_10
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_order_10`
;
CREATE
TABLE
`t_order_10`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
`order_id`
bigint
(
20
)
NOT
NULL
,
`user_id`
int
(
11
)
NOT
NULL
,
`status`
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Table structure for t_order_2
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_order_2`
;
CREATE
TABLE
`t_order_2`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
`order_id`
bigint
(
20
)
NOT
NULL
,
`user_id`
int
(
11
)
NOT
NULL
,
`status`
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Table structure for t_order_3
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_order_3`
;
CREATE
TABLE
`t_order_3`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
`order_id`
bigint
(
20
)
NOT
NULL
,
`user_id`
int
(
11
)
NOT
NULL
,
`status`
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Table structure for t_order_4
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_order_4`
;
CREATE
TABLE
`t_order_4`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
`order_id`
bigint
(
20
)
NOT
NULL
,
`user_id`
int
(
11
)
NOT
NULL
,
`status`
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Table structure for t_order_5
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_order_5`
;
CREATE
TABLE
`t_order_5`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
`order_id`
bigint
(
20
)
NOT
NULL
,
`user_id`
int
(
11
)
NOT
NULL
,
`status`
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Table structure for t_order_6
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_order_6`
;
CREATE
TABLE
`t_order_6`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
`order_id`
bigint
(
20
)
NOT
NULL
,
`user_id`
int
(
11
)
NOT
NULL
,
`status`
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Table structure for t_order_7
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_order_7`
;
CREATE
TABLE
`t_order_7`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
`order_id`
bigint
(
20
)
NOT
NULL
,
`user_id`
int
(
11
)
NOT
NULL
,
`status`
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Table structure for t_order_8
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_order_8`
;
CREATE
TABLE
`t_order_8`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
`order_id`
bigint
(
20
)
NOT
NULL
,
`user_id`
int
(
11
)
NOT
NULL
,
`status`
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Table structure for t_order_9
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_order_9`
;
CREATE
TABLE
`t_order_9`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
`order_id`
bigint
(
20
)
NOT
NULL
,
`user_id`
int
(
11
)
NOT
NULL
,
`status`
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Table structure for t_order_item
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_order_item`
;
CREATE
TABLE
"t_order_item"
(
"id"
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
"order_item_id"
bigint
(
20
)
NOT
NULL
,
"order_id"
bigint
(
20
)
NOT
NULL
,
"user_id"
int
(
11
)
NOT
NULL
,
"status"
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
"id"
)
CREATE
TABLE
`t_order_item`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
`order_item_id`
bigint
(
20
)
NOT
NULL
,
`order_id`
bigint
(
20
)
NOT
NULL
,
`user_id`
int
(
11
)
NOT
NULL
,
`status`
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Table structure for t_order_item_0
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_order_item_0`
;
CREATE
TABLE
"t_order_item_0"
(
"id"
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
"order_item_id"
bigint
(
20
)
NOT
NULL
,
"order_id"
bigint
(
20
)
NOT
NULL
,
"user_id"
int
(
11
)
NOT
NULL
,
"status"
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
"id"
)
CREATE
TABLE
`t_order_item_0`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
`order_item_id`
bigint
(
20
)
NOT
NULL
,
`order_id`
bigint
(
20
)
NOT
NULL
,
`user_id`
int
(
11
)
NOT
NULL
,
`status`
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Table structure for t_order_item_1
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_order_item_1`
;
CREATE
TABLE
"t_order_item_1"
(
"id"
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
"order_item_id"
bigint
(
20
)
NOT
NULL
,
"order_id"
bigint
(
20
)
NOT
NULL
,
"user_id"
int
(
11
)
NOT
NULL
,
"status"
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
"id"
)
CREATE
TABLE
`t_order_item_1`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'主键'
,
`order_item_id`
bigint
(
20
)
NOT
NULL
,
`order_id`
bigint
(
20
)
NOT
NULL
,
`user_id`
int
(
11
)
NOT
NULL
,
`status`
varchar
(
50
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Table structure for undo_log
-- ----------------------------
DROP
TABLE
IF
EXISTS
`undo_log`
;
CREATE
TABLE
"undo_log"
(
"id"
bigint
(
20
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'increment id'
,
"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
NOT
NULL
COMMENT
'create datetime'
,
"log_modified"
datetime
NOT
NULL
COMMENT
'modify datetime'
,
PRIMARY
KEY
(
"id"
),
UNIQUE
KEY
"ux_undo_log"
(
"xid"
,
"branch_id"
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
306
DEFAULT
CHARSET
=
utf8
COMMENT
=
'AT transaction mode undo table'
;
CREATE
TABLE
`undo_log`
(
`id`
bigint
(
20
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'increment id'
,
`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
NOT
NULL
COMMENT
'create datetime'
,
`log_modified`
datetime
NOT
NULL
COMMENT
'modify datetime'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`ux_undo_log`
(
`xid`
,
`branch_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'AT transaction mode undo table'
;
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论