Committer: ailyin
LJSUP-11030 (Increase max wallet balance up to 10 quintillion tokens)U trunk/bin/upgrading/update-db-local.pl
Modified: trunk/bin/upgrading/update-db-local.pl =================================================================== --- trunk/bin/upgrading/update-db-local.pl 2012-02-03 12:00:07 UTC (rev 11404) +++ trunk/bin/upgrading/update-db-local.pl 2012-02-03 12:40:12 UTC (rev 11405) @@ -1435,7 +1435,7 @@ register_tablecreate("user_wallet", <<'EOC'); CREATE TABLE user_wallet ( userid INT NOT NULL DEFAULT 0 PRIMARY KEY, - balance DECIMAL(10,3) DEFAULT 0.0, + balance BIGINT NOT NULL, INDEX (balance) ) @@ -1446,7 +1446,7 @@ logid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, userid INT NOT NULL DEFAULT 0, action CHAR(1) NOT NULL DEFAULT "", - qty DECIMAL(10,3) DEFAULT 0.0, + qty BIGINT NOT NULL, payid INT NOT NULL DEFAULT 0, piid INT NOT NULL DEFAULT 0, time_start INT NOT NULL DEFAULT 0, @@ -2309,6 +2309,17 @@ "ALTER TABLE ftp_transactions RENAME free2pay_trx"); } + unless ( column_type( 'user_wallet', 'balance' ) =~ /bigint/i ) { + do_alter( 'user_wallet', + 'ALTER TABLE user_wallet ' . + 'MODIFY COLUMN balance BIGINT NOT NULL' ); + } + + unless ( column_type( 'user_wallet_history', 'qty' ) =~ /bigint/i ) { + do_alter( 'user_wallet', + 'ALTER TABLE user_wallet_history ' . + 'MODIFY COLUMN qty BIGINT NOT NULL' ); + } }); 1; # true