1.9.9.sql
10.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE `hi-sing`.`activity_has_users` ADD COLUMN `is_hide` tinyint NULL DEFAULT 1 COMMENT '是否隐藏:1是 2否' AFTER `sing_type`;
ALTER TABLE `hi-sing`.`activity_has_users` ADD COLUMN `is_top` tinyint NULL DEFAULT 0 COMMENT '站内作品是否置顶:1是 0否' AFTER `is_hide`;
CREATE TABLE `hi-sing`.`on_site_works` (
`id` int NOT NULL AUTO_INCREMENT,
`ahu_id` int NOT NULL DEFAULT 0 COMMENT '提交作品id',
`is_top` tinyint NULL DEFAULT 0 COMMENT '是否置顶',
`is_hide` tinyint NULL DEFAULT 1 COMMENT '是否隐藏',
`created_at` datetime NULL DEFAULT NULL,
`updated_at` datetime NULL DEFAULT NULL,
`deleted_at` datetime NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
ALTER TABLE `hi-sing`.`system_config` MODIFY COLUMN `creator_id` bigint UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人ID' AFTER `id`;
ALTER TABLE `hi-sing`.`system_config` MODIFY COLUMN `content` varchar(800) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '内容' AFTER `identifier`;
ALTER TABLE `hi-sing`.`system_config` ADD INDEX `weight`(`weight` DESC) USING BTREE;
ALTER TABLE `hi-sing`.`system_http_logs` MODIFY COLUMN `method` enum('GET','POST','PUT','DELETE','OPTIONS') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'GET' AFTER `user_id`;
CREATE TABLE `hi-sing`.`system_sms_logs` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`gateway` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`phone` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '接收人',
`content` json NULL COMMENT '内容',
`result` json NULL COMMENT '结果',
`status` enum('success','failure','wait') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'wait' COMMENT '0:等待 ,1: 成功,2:异常',
`created_at` datetime NULL DEFAULT NULL COMMENT '创建时间',
`updated_at` datetime NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `phone`(`phone` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hi-sing`.`system_upload_logs` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` bigint UNSIGNED NOT NULL DEFAULT 0 COMMENT '所属用户',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '文件名',
`url` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '地址',
`created_at` datetime NULL DEFAULT NULL,
`updated_at` datetime NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
ALTER TABLE `hi-sing`.`tidings_has_interacts` MODIFY COLUMN `type` int NOT NULL DEFAULT 1 COMMENT '1:动态 2:评论 3:我的声音 4:站内作品点赞' AFTER `type_id`;
ALTER TABLE `hi-sing`.`tidings_has_reports` MODIFY COLUMN `type` tinyint NULL DEFAULT 1 COMMENT '1:广场动态类 2:评论类 3:用户举报 4:图片视频音频举报' AFTER `user_id`;
CREATE TABLE `hi-sing`.`user_dynamics` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` bigint UNSIGNED NOT NULL DEFAULT 0,
`type` enum('image','audio','video') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'image' COMMENT '1:图片 2:视频 3:音频',
`intro` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '描述内容',
`properties` json NULL COMMENT '内容属性',
`is_top` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否置顶',
`created_at` datetime NULL DEFAULT NULL,
`updated_at` datetime NULL DEFAULT NULL,
`deleted_at` datetime NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
ALTER TABLE `hi-sing`.`user_follow_relations` ADD COLUMN `is_read` tinyint NULL DEFAULT 0 COMMENT '是否已读' AFTER `following_id`;
CREATE TABLE `hi-sing`.`user_quotations` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` bigint UNSIGNED NOT NULL DEFAULT 0,
`is_reward` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否唱酬',
`reward_price` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '唱酬金额',
`is_dividend` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否分成',
`dividend_year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '分成年限',
`dividend_ratio` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '分成比例',
`is_public` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否公开',
`is_talk` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否可谈',
`created_at` datetime NULL DEFAULT NULL,
`updated_at` datetime NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户意向报价' ROW_FORMAT = Dynamic;
ALTER TABLE `hi-sing`.`users` ADD COLUMN `wechat_account` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '微信账号' AFTER `chat_mode`;
CREATE OR REPLACE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `hi-sing`.`activity_user_submits` AS select `activity_works`.`id` AS `id`,`activity_works`.`activity_id` AS `activity_id`,`activity_works`.`activity_name` AS `activity_name`,`activity_works`.`activity_title` AS `activity_title`,`activity_works`.`activity_status` AS `activity_status`,`activity_works`.`activity_user_id` AS `activity_user_id`,`activity_works`.`user_id` AS `user_id`,`activity_works`.`user_role` AS `user_role`,`activity_works`.`demo_url` AS `demo_url`,`activity_works`.`durations` AS `durations`,`activity_works`.`type` AS `type`,`activity_works`.`status` AS `status`,`activity_works`.`syn_data` AS `syn_data`,`activity_works`.`syn_status` AS `syn_status`,`activity_works`.`mode` AS `mode`,`activity_works`.`open_id` AS `open_id`,`activity_works`.`is_checked` AS `is_checked`,`activity_works`.`is_top` AS `is_top`,`activity_works`.`is_hide` AS `is_hide`,`activity_works`.`submit_at` AS `submit_at`,`activity_works`.`version` AS `version`,`activity_works`.`sing_type` AS `sing_type`,`activity_works`.`created_at` AS `created_at`,`activity_works`.`updated_at` AS `updated_at`,`activity_works`.`deleted_at` AS `deleted_at`,`activity_works`.`business_id` AS `business_id`,`activity_works`.`share_id` AS `share_id`,`activity_works`.`project_id` AS `project_id`,`activity_works`.`price_id` AS `price_id` from `activity_works` where (`activity_works`.`type` = 'Submit');
CREATE OR REPLACE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `hi-sing`.`activity_works` AS select `activity_has_users`.`id` AS `id`,`activity_has_users`.`activity_id` AS `activity_id`,`activitys`.`song_name` AS `activity_name`,`activitys`.`sub_title` AS `activity_title`,`activitys`.`status` AS `activity_status`,`activitys`.`user_id` AS `activity_user_id`,`activity_has_users`.`user_id` AS `user_id`,`users`.`role` AS `user_role`,`activity_has_users`.`demo_url` AS `demo_url`,`activity_has_users`.`durations` AS `durations`,`activity_has_users`.`type` AS `type`,`activity_has_users`.`status` AS `status`,`activity_has_users`.`syn_data` AS `syn_data`,`activity_has_users`.`syn_status` AS `syn_status`,`activity_has_users`.`mode` AS `mode`,`activity_has_users`.`open_id` AS `open_id`,`activity_has_users`.`is_checked` AS `is_checked`,`activity_has_users`.`is_top` AS `is_top`,`activity_has_users`.`is_hide` AS `is_hide`,`activity_has_users`.`submit_at` AS `submit_at`,`activity_has_users`.`version` AS `version`,`activity_has_users`.`sing_type` AS `sing_type`,`activity_has_users`.`created_at` AS `created_at`,`activity_has_users`.`updated_at` AS `updated_at`,`activity_has_users`.`deleted_at` AS `deleted_at`,ifnull(`users`.`business_id`,0) AS `business_id`,ifnull(`activity_share_users`.`share_id`,0) AS `share_id`,ifnull(`activitys`.`project_id`,0) AS `project_id`,ifnull(`activity_user_has_prices`.`id`,0) AS `price_id` from ((((`activity_has_users` join `users` on((`users`.`id` = `activity_has_users`.`user_id`))) join `activitys` on((`activitys`.`id` = `activity_has_users`.`activity_id`))) left join `activity_share_users` on(((`activity_has_users`.`user_id` = `activity_share_users`.`user_id`) and (`activity_has_users`.`activity_id` = `activity_share_users`.`activity_id`)))) left join `activity_user_has_prices` on(((`activity_has_users`.`user_id` = `activity_user_has_prices`.`user_id`) and (`activity_has_users`.`activity_id` = `activity_user_has_prices`.`activity_id`))));
SET FOREIGN_KEY_CHECKS=1;