mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 08:11:08 +00:00
migration: extend tx id and address size
This commit is contained in:
parent
8e85274876
commit
ccbb78ce4d
|
@ -8,11 +8,11 @@ CREATE TABLE `withdraws`
|
||||||
-- asset is the asset name (currency)
|
-- asset is the asset name (currency)
|
||||||
`asset` VARCHAR(10) NOT NULL,
|
`asset` VARCHAR(10) NOT NULL,
|
||||||
|
|
||||||
`address` VARCHAR(64) NOT NULL,
|
`address` VARCHAR(128) NOT NULL,
|
||||||
`network` VARCHAR(32) NOT NULL DEFAULT '',
|
`network` VARCHAR(32) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
`amount` DECIMAL(16, 8) NOT NULL,
|
`amount` DECIMAL(16, 8) NOT NULL,
|
||||||
`txn_id` VARCHAR(64) NOT NULL,
|
`txn_id` VARCHAR(256) NOT NULL,
|
||||||
`txn_fee` DECIMAL(16, 8) NOT NULL DEFAULT 0,
|
`txn_fee` DECIMAL(16, 8) NOT NULL DEFAULT 0,
|
||||||
`txn_fee_currency` VARCHAR(32) NOT NULL DEFAULT '',
|
`txn_fee_currency` VARCHAR(32) NOT NULL DEFAULT '',
|
||||||
`time` DATETIME(3) NOT NULL,
|
`time` DATETIME(3) NOT NULL,
|
||||||
|
|
|
@ -8,9 +8,9 @@ CREATE TABLE `deposits`
|
||||||
-- asset is the asset name (currency)
|
-- asset is the asset name (currency)
|
||||||
`asset` VARCHAR(10) NOT NULL,
|
`asset` VARCHAR(10) NOT NULL,
|
||||||
|
|
||||||
`address` VARCHAR(64) NOT NULL DEFAULT '',
|
`address` VARCHAR(128) NOT NULL DEFAULT '',
|
||||||
`amount` DECIMAL(16, 8) NOT NULL,
|
`amount` DECIMAL(16, 8) NOT NULL,
|
||||||
`txn_id` VARCHAR(64) NOT NULL,
|
`txn_id` VARCHAR(256) NOT NULL,
|
||||||
`time` DATETIME(3) NOT NULL,
|
`time` DATETIME(3) NOT NULL,
|
||||||
|
|
||||||
PRIMARY KEY (`gid`),
|
PRIMARY KEY (`gid`),
|
||||||
|
|
|
@ -8,11 +8,11 @@ CREATE TABLE `withdraws`
|
||||||
-- asset is the asset name (currency)
|
-- asset is the asset name (currency)
|
||||||
`asset` VARCHAR(10) NOT NULL,
|
`asset` VARCHAR(10) NOT NULL,
|
||||||
|
|
||||||
`address` VARCHAR(64) NOT NULL,
|
`address` VARCHAR(128) NOT NULL,
|
||||||
`network` VARCHAR(32) NOT NULL DEFAULT '',
|
`network` VARCHAR(32) NOT NULL DEFAULT '',
|
||||||
`amount` DECIMAL(16, 8) NOT NULL,
|
`amount` DECIMAL(16, 8) NOT NULL,
|
||||||
|
|
||||||
`txn_id` VARCHAR(64) NOT NULL,
|
`txn_id` VARCHAR(256) NOT NULL,
|
||||||
`txn_fee` DECIMAL(16, 8) NOT NULL DEFAULT 0,
|
`txn_fee` DECIMAL(16, 8) NOT NULL DEFAULT 0,
|
||||||
`txn_fee_currency` VARCHAR(32) NOT NULL DEFAULT '',
|
`txn_fee_currency` VARCHAR(32) NOT NULL DEFAULT '',
|
||||||
`time` DATETIME(3) NOT NULL
|
`time` DATETIME(3) NOT NULL
|
||||||
|
|
|
@ -8,9 +8,9 @@ CREATE TABLE `deposits`
|
||||||
-- asset is the asset name (currency)
|
-- asset is the asset name (currency)
|
||||||
`asset` VARCHAR(10) NOT NULL,
|
`asset` VARCHAR(10) NOT NULL,
|
||||||
|
|
||||||
`address` VARCHAR(64) NOT NULL DEFAULT '',
|
`address` VARCHAR(128) NOT NULL DEFAULT '',
|
||||||
`amount` DECIMAL(16, 8) NOT NULL,
|
`amount` DECIMAL(16, 8) NOT NULL,
|
||||||
`txn_id` VARCHAR(64) NOT NULL,
|
`txn_id` VARCHAR(256) NOT NULL,
|
||||||
`time` DATETIME(3) NOT NULL
|
`time` DATETIME(3) NOT NULL
|
||||||
);
|
);
|
||||||
-- +end
|
-- +end
|
||||||
|
|
|
@ -14,7 +14,7 @@ func init() {
|
||||||
func upAddWithdrawsTable(ctx context.Context, tx rockhopper.SQLExecutor) (err error) {
|
func upAddWithdrawsTable(ctx context.Context, tx rockhopper.SQLExecutor) (err error) {
|
||||||
// This code is executed when the migration is applied.
|
// This code is executed when the migration is applied.
|
||||||
|
|
||||||
_, err = tx.ExecContext(ctx, "CREATE TABLE `withdraws`\n(\n `gid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,\n `exchange` VARCHAR(24) NOT NULL DEFAULT '',\n -- asset is the asset name (currency)\n `asset` VARCHAR(10) NOT NULL,\n `address` VARCHAR(64) NOT NULL,\n `network` VARCHAR(32) NOT NULL DEFAULT '',\n `amount` DECIMAL(16, 8) NOT NULL,\n `txn_id` VARCHAR(64) NOT NULL,\n `txn_fee` DECIMAL(16, 8) NOT NULL DEFAULT 0,\n `txn_fee_currency` VARCHAR(32) NOT NULL DEFAULT '',\n `time` DATETIME(3) NOT NULL,\n PRIMARY KEY (`gid`),\n UNIQUE KEY `txn_id` (`exchange`, `txn_id`)\n);")
|
_, err = tx.ExecContext(ctx, "CREATE TABLE `withdraws`\n(\n `gid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,\n `exchange` VARCHAR(24) NOT NULL DEFAULT '',\n -- asset is the asset name (currency)\n `asset` VARCHAR(10) NOT NULL,\n `address` VARCHAR(128) NOT NULL,\n `network` VARCHAR(32) NOT NULL DEFAULT '',\n `amount` DECIMAL(16, 8) NOT NULL,\n `txn_id` VARCHAR(256) NOT NULL,\n `txn_fee` DECIMAL(16, 8) NOT NULL DEFAULT 0,\n `txn_fee_currency` VARCHAR(32) NOT NULL DEFAULT '',\n `time` DATETIME(3) NOT NULL,\n PRIMARY KEY (`gid`),\n UNIQUE KEY `txn_id` (`exchange`, `txn_id`)\n);")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ func init() {
|
||||||
func upAddDepositsTable(ctx context.Context, tx rockhopper.SQLExecutor) (err error) {
|
func upAddDepositsTable(ctx context.Context, tx rockhopper.SQLExecutor) (err error) {
|
||||||
// This code is executed when the migration is applied.
|
// This code is executed when the migration is applied.
|
||||||
|
|
||||||
_, err = tx.ExecContext(ctx, "CREATE TABLE `deposits`\n(\n `gid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,\n `exchange` VARCHAR(24) NOT NULL,\n -- asset is the asset name (currency)\n `asset` VARCHAR(10) NOT NULL,\n `address` VARCHAR(64) NOT NULL DEFAULT '',\n `amount` DECIMAL(16, 8) NOT NULL,\n `txn_id` VARCHAR(64) NOT NULL,\n `time` DATETIME(3) NOT NULL,\n PRIMARY KEY (`gid`),\n UNIQUE KEY `txn_id` (`exchange`, `txn_id`)\n);")
|
_, err = tx.ExecContext(ctx, "CREATE TABLE `deposits`\n(\n `gid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,\n `exchange` VARCHAR(24) NOT NULL,\n -- asset is the asset name (currency)\n `asset` VARCHAR(10) NOT NULL,\n `address` VARCHAR(128) NOT NULL DEFAULT '',\n `amount` DECIMAL(16, 8) NOT NULL,\n `txn_id` VARCHAR(256) NOT NULL,\n `time` DATETIME(3) NOT NULL,\n PRIMARY KEY (`gid`),\n UNIQUE KEY `txn_id` (`exchange`, `txn_id`)\n);")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ func init() {
|
||||||
func upAddWithdrawsTable(ctx context.Context, tx rockhopper.SQLExecutor) (err error) {
|
func upAddWithdrawsTable(ctx context.Context, tx rockhopper.SQLExecutor) (err error) {
|
||||||
// This code is executed when the migration is applied.
|
// This code is executed when the migration is applied.
|
||||||
|
|
||||||
_, err = tx.ExecContext(ctx, "CREATE TABLE `withdraws`\n(\n `gid` INTEGER PRIMARY KEY AUTOINCREMENT,\n `exchange` VARCHAR(24) NOT NULL DEFAULT '',\n -- asset is the asset name (currency)\n `asset` VARCHAR(10) NOT NULL,\n `address` VARCHAR(64) NOT NULL,\n `network` VARCHAR(32) NOT NULL DEFAULT '',\n `amount` DECIMAL(16, 8) NOT NULL,\n `txn_id` VARCHAR(64) NOT NULL,\n `txn_fee` DECIMAL(16, 8) NOT NULL DEFAULT 0,\n `txn_fee_currency` VARCHAR(32) NOT NULL DEFAULT '',\n `time` DATETIME(3) NOT NULL\n);")
|
_, err = tx.ExecContext(ctx, "CREATE TABLE `withdraws`\n(\n `gid` INTEGER PRIMARY KEY AUTOINCREMENT,\n `exchange` VARCHAR(24) NOT NULL DEFAULT '',\n -- asset is the asset name (currency)\n `asset` VARCHAR(10) NOT NULL,\n `address` VARCHAR(128) NOT NULL,\n `network` VARCHAR(32) NOT NULL DEFAULT '',\n `amount` DECIMAL(16, 8) NOT NULL,\n `txn_id` VARCHAR(256) NOT NULL,\n `txn_fee` DECIMAL(16, 8) NOT NULL DEFAULT 0,\n `txn_fee_currency` VARCHAR(32) NOT NULL DEFAULT '',\n `time` DATETIME(3) NOT NULL\n);")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ func init() {
|
||||||
func upAddDepositsTable(ctx context.Context, tx rockhopper.SQLExecutor) (err error) {
|
func upAddDepositsTable(ctx context.Context, tx rockhopper.SQLExecutor) (err error) {
|
||||||
// This code is executed when the migration is applied.
|
// This code is executed when the migration is applied.
|
||||||
|
|
||||||
_, err = tx.ExecContext(ctx, "CREATE TABLE `deposits`\n(\n `gid` INTEGER PRIMARY KEY AUTOINCREMENT,\n `exchange` VARCHAR(24) NOT NULL,\n -- asset is the asset name (currency)\n `asset` VARCHAR(10) NOT NULL,\n `address` VARCHAR(64) NOT NULL DEFAULT '',\n `amount` DECIMAL(16, 8) NOT NULL,\n `txn_id` VARCHAR(64) NOT NULL,\n `time` DATETIME(3) NOT NULL\n);")
|
_, err = tx.ExecContext(ctx, "CREATE TABLE `deposits`\n(\n `gid` INTEGER PRIMARY KEY AUTOINCREMENT,\n `exchange` VARCHAR(24) NOT NULL,\n -- asset is the asset name (currency)\n `asset` VARCHAR(10) NOT NULL,\n `address` VARCHAR(128) NOT NULL DEFAULT '',\n `amount` DECIMAL(16, 8) NOT NULL,\n `txn_id` VARCHAR(256) NOT NULL,\n `time` DATETIME(3) NOT NULL\n);")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user