for create table statement dont use txn

This commit is contained in:
c9s 2024-01-19 15:27:06 +08:00
parent 611b2a9247
commit cfa0468867
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
20 changed files with 30 additions and 13 deletions

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
CREATE TABLE `trades` CREATE TABLE `trades`
( (

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
CREATE TABLE `orders` CREATE TABLE `orders`
( (

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
CREATE TABLE `trades` CREATE TABLE `trades`
( (

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
CREATE INDEX trades_symbol ON trades(symbol); CREATE INDEX trades_symbol ON trades(symbol);
CREATE INDEX trades_symbol_fee_currency ON trades(symbol, fee_currency, traded_at); CREATE INDEX trades_symbol_fee_currency ON trades(symbol, fee_currency, traded_at);

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
CREATE TABLE `orders` CREATE TABLE `orders`
( (

View File

@ -1,5 +1,9 @@
-- +up -- +up
-- +begin
ALTER TABLE `trades` ADD COLUMN `order_id` INTEGER; ALTER TABLE `trades` ADD COLUMN `order_id` INTEGER;
-- +end
-- +down -- +down
-- +begin
ALTER TABLE `trades` RENAME COLUMN `order_id` TO `order_id_deleted`; ALTER TABLE `trades` RENAME COLUMN `order_id` TO `order_id_deleted`;
-- +end

View File

@ -1,11 +1,12 @@
-- !txn
-- +up -- +up
-- +begin -- +begin
CREATE TABLE `klines` CREATE TABLE `klines`
( (
`gid` INTEGER PRIMARY KEY AUTOINCREMENT, `gid` INTEGER PRIMARY KEY AUTOINCREMENT,
`exchange` VARCHAR(10) NOT NULL, `exchange` VARCHAR(10) NOT NULL,
`start_time` DATETIME(3) NOT NULL, `start_time` DATETIME(3) NOT NULL,
`end_time` DATETIME(3) NOT NULL, `end_time` DATETIME(3) NOT NULL,
`interval` VARCHAR(3) NOT NULL, `interval` VARCHAR(3) NOT NULL,
`symbol` VARCHAR(7) NOT NULL, `symbol` VARCHAR(7) NOT NULL,
`open` DECIMAL(16, 8) NOT NULL, `open` DECIMAL(16, 8) NOT NULL,
@ -25,8 +26,8 @@ CREATE TABLE `okex_klines`
( (
`gid` INTEGER PRIMARY KEY AUTOINCREMENT, `gid` INTEGER PRIMARY KEY AUTOINCREMENT,
`exchange` VARCHAR(10) NOT NULL, `exchange` VARCHAR(10) NOT NULL,
`start_time` DATETIME(3) NOT NULL, `start_time` DATETIME(3) NOT NULL,
`end_time` DATETIME(3) NOT NULL, `end_time` DATETIME(3) NOT NULL,
`interval` VARCHAR(3) NOT NULL, `interval` VARCHAR(3) NOT NULL,
`symbol` VARCHAR(7) NOT NULL, `symbol` VARCHAR(7) NOT NULL,
`open` DECIMAL(16, 8) NOT NULL, `open` DECIMAL(16, 8) NOT NULL,
@ -45,8 +46,8 @@ CREATE TABLE `binance_klines`
( (
`gid` INTEGER PRIMARY KEY AUTOINCREMENT, `gid` INTEGER PRIMARY KEY AUTOINCREMENT,
`exchange` VARCHAR(10) NOT NULL, `exchange` VARCHAR(10) NOT NULL,
`start_time` DATETIME(3) NOT NULL, `start_time` DATETIME(3) NOT NULL,
`end_time` DATETIME(3) NOT NULL, `end_time` DATETIME(3) NOT NULL,
`interval` VARCHAR(3) NOT NULL, `interval` VARCHAR(3) NOT NULL,
`symbol` VARCHAR(7) NOT NULL, `symbol` VARCHAR(7) NOT NULL,
`open` DECIMAL(16, 8) NOT NULL, `open` DECIMAL(16, 8) NOT NULL,
@ -65,8 +66,8 @@ CREATE TABLE `max_klines`
( (
`gid` INTEGER PRIMARY KEY AUTOINCREMENT, `gid` INTEGER PRIMARY KEY AUTOINCREMENT,
`exchange` VARCHAR(10) NOT NULL, `exchange` VARCHAR(10) NOT NULL,
`start_time` DATETIME(3) NOT NULL, `start_time` DATETIME(3) NOT NULL,
`end_time` DATETIME(3) NOT NULL, `end_time` DATETIME(3) NOT NULL,
`interval` VARCHAR(3) NOT NULL, `interval` VARCHAR(3) NOT NULL,
`symbol` VARCHAR(7) NOT NULL, `symbol` VARCHAR(7) NOT NULL,
`open` DECIMAL(16, 8) NOT NULL, `open` DECIMAL(16, 8) NOT NULL,

View File

@ -1,5 +0,0 @@
-- +up
SELECT 1;
-- +down
SELECT 1;

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
CREATE TABLE `rewards` CREATE TABLE `rewards`
( (

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
-- +begin -- +begin
CREATE TABLE `withdraws` CREATE TABLE `withdraws`

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
-- +begin -- +begin
CREATE TABLE `deposits` CREATE TABLE `deposits`

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
-- +begin -- +begin

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
-- +begin -- +begin
CREATE TABLE `nav_history_details` CREATE TABLE `nav_history_details`

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
-- +begin -- +begin
CREATE TABLE `kucoin_klines` CREATE TABLE `kucoin_klines`

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
CREATE TABLE `profits` CREATE TABLE `profits`
( (

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
CREATE TABLE `margin_loans` CREATE TABLE `margin_loans`
( (

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
CREATE TABLE `margin_repays` CREATE TABLE `margin_repays`
( (

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
CREATE TABLE `margin_interests` CREATE TABLE `margin_interests`
( (

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
CREATE TABLE `margin_liquidations` CREATE TABLE `margin_liquidations`
( (

View File

@ -1,3 +1,4 @@
-- !txn
-- +up -- +up
-- +begin -- +begin
CREATE TABLE `bybit_klines` CREATE TABLE `bybit_klines`