Файл: new_top/sql/migrate_points.sql
Строк: 26
ALTER TABLE `user`
ADD COLUMN IF NOT EXISTS `points` int NOT NULL DEFAULT
0 COMMENT 'баллы' AFTER `level`;
CREATE TABLE IF NOT EXISTS
`points_log` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id`
int UNSIGNED NOT NULL,
`delta` int NOT NULL,
`balance` int NOT NULL
DEFAULT 0,
`reason` varchar(64) NOT NULL DEFAULT '',
`ref_id` int
UNSIGNED NOT NULL DEFAULT 0,
`time` int UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `user_time` (`user_id`, `time`)
) ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT
EXISTS `points_config` (
`k` varchar(40) NOT NULL,
`v` varchar(64) NOT
NULL DEFAULT '0',
PRIMARY KEY (`k`)
) ENGINE=InnoDB DEFAULT
CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT IGNORE INTO
`points_config` (`k`, `v`) VALUES
('in_reward', '1'),
('gold_day_cost',
'50'),
('ad_point_per_currency', '1'),
('enabled', '1');