-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sql
More file actions
144 lines (123 loc) · 4.93 KB
/
Copy pathinit.sql
File metadata and controls
144 lines (123 loc) · 4.93 KB
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
CREATE TABLE `txn_history` (
txn_id BIGINT(20) NOT NULL,
user_id BIGINT(20) NOT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
txn_type VARCHAR(64) NOT NULL,
txn_state VARCHAR(64) NOT NULL DEFAULT 'NONE',
txn_order_amount BIGINT(20) NOT NULL DEFAULT '0',
txn_order_currency VARCHAR(64) NOT NULL DEFAULT 'JPY',
txn_charge_amount BIGINT(20) NOT NULL DEFAULT '0',
txn_charge_currency VARCHAR(64) NOT NULL DEFAULT 'JPY',
txn_exchange_amount BIGINT(20) NOT NULL DEFAULT '0',
txn_exchange_currency VARCHAR(64) NOT NULL DEFAULT 'JPY',
txn_promo_amount BIGINT(20) NOT NULL DEFAULT '0',
txn_promo_currency VARCHAR(64) NOT NULL DEFAULT 'JPY',
disabled INT NOT NULL DEFAULT '0',
version INT NOT NULL DEFAULT '0',
order_id BIGINT(20) NOT NULL,
order_state VARCHAR(64) DEFAULT NULL,
order_error_code VARCHAR(128) DEFAULT NULL,
order_type VARCHAR(64) DEFAULT NULL,
order_created_at DATETIME DEFAULT NULL,
order_updated_at DATETIME DEFAULT NULL,
order_version INT DEFAULT NULL,
order_items JSON DEFAULT NULL,
payment_id BIGINT(20) DEFAULT NULL,
payment_created_at DATETIME DEFAULT NULL,
payment_updated_at DATETIME DEFAULT NULL,
payment_paid_at DATETIME DEFAULT NULL,
payment_version INT DEFAULT NULL,
payment_state VARCHAR(64) DEFAULT NULL,
payment_error_code VARCHAR(128) DEFAULT NULL,
comments JSON DEFAULT NULL,
payment_methods BIT(32) DEFAULT NULL,
sub_payments JSON DEFAULT NULL,
cb_amount BIGINT(20) DEFAULT NULL,
cb_state VARCHAR(64) DEFAULT NULL,
cb_release_date DATETIME DEFAULT NULL,
cb_created_at DATETIME DEFAULT NULL,
cb_updated_at DATETIME DEFAULT NULL,
cb_version INT DEFAULT NULL,
merchant_id BIGINT(20) DEFAULT NULL,
merchant_name VARCHAR(512) DEFAULT NULL,
merchant_cat BIGINT(20) DEFAULT NULL,
merchant_sub_cat BIGINT(20) DEFAULT NULL,
store_id VARCHAR(256) DEFAULT NULL,
store_name VARCHAR(512) DEFAULT NULL,
pos_id VARCHAR(128) DEFAULT NULL,
biller_id BIGINT(20) DEFAULT NULL,
logo_url VARCHAR(2048) DEFAULT NULL,
peer_id BIGINT(20) DEFAULT NULL,
peer_name VARCHAR(512) DEFAULT NULL,
device_id VARCHAR(512) DEFAULT NULL,
extra_info JSON DEFAULT NULL,
PRIMARY KEY (txn_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE INDEX idx_transaction_history ON txn_history (user_id, order_created_at DESC);
CREATE UNIQUE INDEX idx_order_id ON txn_history (user_id, order_id);
CREATE TABLE `WORKER_NODE` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`host_name` VARCHAR(64) NOT NULL,
`port` VARCHAR(64) NOT NULL ,
`type` INT NOT NULL COMMENT 'node type: ACTUAL or CONTAINER',
`launch_date` DATE NOT NULL,
`modified` DATETIME(3) DEFAULT CURRENT_TIMESTAMP(3),
`created` DATETIME(3) DEFAULT CURRENT_TIMESTAMP(3),
PRIMARY KEY(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `txn_history_mock` (
txn_id BIGINT(20) NOT NULL,
user_id BIGINT(20) NOT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
txn_type VARCHAR(64) NOT NULL,
txn_state VARCHAR(64) NOT NULL DEFAULT 'NONE',
txn_order_amount BIGINT(20) NOT NULL DEFAULT '0',
txn_order_currency VARCHAR(64) NOT NULL DEFAULT 'JPY',
txn_charge_amount BIGINT(20) NOT NULL DEFAULT '0',
txn_charge_currency VARCHAR(64) NOT NULL DEFAULT 'JPY',
txn_exchange_amount BIGINT(20) NOT NULL DEFAULT '0',
txn_exchange_currency VARCHAR(64) NOT NULL DEFAULT 'JPY',
txn_promo_amount BIGINT(20) NOT NULL DEFAULT '0',
txn_promo_currency VARCHAR(64) NOT NULL DEFAULT 'JPY',
disabled INT NOT NULL DEFAULT '0',
version INT NOT NULL DEFAULT '0',
order_id BIGINT(20) NOT NULL,
order_state VARCHAR(64) DEFAULT NULL,
order_error_code VARCHAR(128) DEFAULT NULL,
order_type VARCHAR(64) DEFAULT NULL,
order_created_at DATETIME DEFAULT NULL,
order_updated_at DATETIME DEFAULT NULL,
order_version INT DEFAULT NULL,
order_items JSON DEFAULT NULL,
payment_id BIGINT(20) DEFAULT NULL,
payment_created_at DATETIME DEFAULT NULL,
payment_updated_at DATETIME DEFAULT NULL,
payment_paid_at DATETIME DEFAULT NULL,
payment_version INT DEFAULT NULL,
payment_state VARCHAR(64) DEFAULT NULL,
payment_error_code VARCHAR(128) DEFAULT NULL,
comments JSON DEFAULT NULL,
payment_methods BIT(32) DEFAULT NULL,
sub_payments JSON DEFAULT NULL,
cb_amount BIGINT(20) DEFAULT NULL,
cb_state VARCHAR(64) DEFAULT NULL,
cb_release_date DATETIME DEFAULT NULL,
cb_created_at DATETIME DEFAULT NULL,
cb_updated_at DATETIME DEFAULT NULL,
cb_version INT DEFAULT NULL,
merchant_id BIGINT(20) DEFAULT NULL,
merchant_name VARCHAR(512) DEFAULT NULL,
merchant_cat BIGINT(20) DEFAULT NULL,
merchant_sub_cat BIGINT(20) DEFAULT NULL,
store_id VARCHAR(256) DEFAULT NULL,
store_name VARCHAR(512) DEFAULT NULL,
pos_id VARCHAR(128) DEFAULT NULL,
biller_id BIGINT(20) DEFAULT NULL,
logo_url VARCHAR(2048) DEFAULT NULL,
peer_id BIGINT(20) DEFAULT NULL,
peer_name VARCHAR(512) DEFAULT NULL,
device_id VARCHAR(512) DEFAULT NULL,
extra_info JSON DEFAULT NULL
) CHARSET=utf8mb4 SHARD_ROW_ID_BITS = 4;