From 3293255b3c815c982f9517a2aafea36e9f4c7c2a Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 7 Jun 2023 16:07:19 +0800 Subject: [PATCH] 1 --- sql/gamedb.sql | 4 +++- sql/gamedb2006_migrate_230605_01.sql | 2 +- sql/migrate_230607_01.sql | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 17f240c7..4f4c7a2a 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -847,6 +847,7 @@ DROP TABLE IF EXISTS `t_transaction`; CREATE TABLE `t_transaction` ( `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', `account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)', + `address` varchar(60) NOT NULL DEFAULT '' COMMENT 'address', `trans_id` varchar(255) NOT NULL DEFAULT '' COMMENT '事务id', `action` int(11) NOT NULL DEFAULT '0' COMMENT 'action', `token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id', @@ -861,7 +862,8 @@ CREATE TABLE `t_transaction` ( `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`idx`), UNIQUE KEY `trans_id` (`trans_id`), - KEY `account_id` (`account_id`) + KEY `account_id` (`account_id`), + KEY `address` (`address`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/sql/gamedb2006_migrate_230605_01.sql b/sql/gamedb2006_migrate_230605_01.sql index 3f766e41..61369448 100644 --- a/sql/gamedb2006_migrate_230605_01.sql +++ b/sql/gamedb2006_migrate_230605_01.sql @@ -1,7 +1,7 @@ begin; alter table t_user add column `address` varchar(60) COMMENT 'address'; -alter table t_user add KEY `address` (`address`); +alter table t_user add UNIQUE KEY `address` (`address`); insert into version (version) values(2023060501); diff --git a/sql/migrate_230607_01.sql b/sql/migrate_230607_01.sql index 27e7e468..e9d7cedd 100644 --- a/sql/migrate_230607_01.sql +++ b/sql/migrate_230607_01.sql @@ -3,6 +3,9 @@ begin; alter table t_chip add column `active_token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'active_token_id'; alter table t_chip add column `active_count` int(11) NOT NULL DEFAULT '0' COMMENT 'active_count'; +alter table t_transaction add column `address` varchar(60) NOT NULL DEFAULT '' COMMENT 'address'; +alter table t_transaction add KEY `address` (`address`); + insert into version (version) values(2023060701); commit;