1.9.12.sql 6.62 KB
SET FOREIGN_KEY_CHECKS = 0;

ALTER TABLE `hi-sing`.`activity_links`
    ADD COLUMN `expand` json NULL AFTER `link_id`;

CREATE TABLE `hi-sing`.`group_has_members`
(
    `id`         int      NOT NULL AUTO_INCREMENT,
    `group_id`   int      NOT NULL DEFAULT 0 COMMENT '群组id',
    `member_id`  int      NOT NULL DEFAULT 0 COMMENT '成员id',
    `is_top`     tinyint  NOT NULL DEFAULT 0 COMMENT '0:不置顶  1:置顶',
    `role`       tinyint  NOT NULL DEFAULT 3 COMMENT '1:团长 3:成员',
    `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;

CREATE TABLE `hi-sing`.`group_invites`
(
    `id`         int      NOT NULL AUTO_INCREMENT,
    `group_id`   int      NOT NULL DEFAULT 0 COMMENT '群组id',
    `invite_id`  int      NOT NULL DEFAULT 0 COMMENT '邀请人id',
    `user_id`    int      NOT NULL DEFAULT 0 COMMENT '被邀请人id',
    `type`       tinyint  NOT NULL DEFAULT 1 COMMENT '1:邀请加入  2:申请加入',
    `status`     tinyint  NOT NULL DEFAULT 0 COMMENT '1:已邀请 2:已加入 3:已拒绝 4:已失效',
    `created_at` datetime NULL     DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    `updated_at` datetime NULL     DEFAULT NULL,
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = Dynamic;

CREATE TABLE `hi-sing`.`groups`
(
    `id`         int      NOT NULL AUTO_INCREMENT,
    `user_id`    int      NOT NULL DEFAULT 0 COMMENT '群主id',
    `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`.`projects`
    ADD COLUMN `is_can_apply` tinyint UNSIGNED NOT NULL DEFAULT 1 COMMENT '是否允许提交上架申请' AFTER `is_public`;

ALTER TABLE `hi-sing`.`projects`
    ADD COLUMN `is_can_manage` tinyint UNSIGNED NOT NULL DEFAULT 1 COMMENT '是否允许自行添加外部成员' AFTER `is_can_apply`;

ALTER TABLE `hi-sing`.`system_http_logs`
    ADD INDEX `guard` (`guard` ASC) USING BTREE;

ALTER TABLE `hi-sing`.`system_http_logs`
    ADD INDEX `method` (`method` ASC, `uri` ASC) USING BTREE;

ALTER TABLE `hi-sing`.`system_http_logs`
    ADD INDEX `user` (`user_id` ASC) USING BTREE;

ALTER TABLE `hi-sing`.`user_tag_relations`
    ADD INDEX `user` (`user_id` ASC) USING BTREE;

ALTER TABLE `hi-sing`.`user_tag_relations`
    ADD INDEX `tag` (`tag_id` ASC) USING BTREE;

ALTER TABLE `hi-sing`.`users`
    ADD COLUMN `business_singer_limit` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '商务拥有歌手限制数' AFTER `business_id`;

ALTER TABLE `hi-sing`.`users`
    MODIFY COLUMN `avatar` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '头像' AFTER `real_name`;

ALTER TABLE `hi-sing`.`users`
    MODIFY COLUMN `intro` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '介绍' AFTER `avatar`;

ALTER TABLE `hi-sing`.`users`
    MODIFY COLUMN `cover` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'https://hi-sing-cdn-dev.hikoon.com/file/20230426/9rwhiimko8a1682488070422huu8th1sctj.jpg' COMMENT '背景封面' AFTER `intro`;

ALTER TABLE `hi-sing`.`users`
    MODIFY COLUMN `audit_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '审核状态[0:待审核,1:审核通过 2:拒绝]' AFTER `scope`;

CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `hi-sing`.`user_manage_activities` AS
select `activity_links`.`id`                                                 AS `id`,
       `activity_links`.`link_id`                                            AS `user_id`,
       `activity_links`.`activity_id`                                        AS `activity_id`,
       `activitys`.`project_id`                                              AS `project_id`,
       `activitys`.`publish_at`                                              AS `activity_publish_at`,
       `activitys`.`status`                                                  AS `activity_status`,
       json_unquote(json_extract(`activity_links`.`expand`, '$.permission')) AS `permission`
from (`activity_links` join `activitys` on ((`activity_links`.`activity_id` = `activitys`.`id`)))
where ((`activity_links`.`type` = 'manager') and (`activity_links`.`link_type` = 'App\\Models\\User'));

UPDATE `hi-sing`.`users`
set `business_singer_limit` = 3;

SET FOREIGN_KEY_CHECKS = 1;

INSERT INTO `hi-sing`.`system_config` (`creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`,
                                       `status`, `weight`, `created_at`, `updated_at`, `deleted_at`)
VALUES (12, 0, '团队歌手标签限制', 'svMC9TNFz2Acx8ccPdAIH', '3', '{\"type\": \"input\"}', '', 1, 0,
        '2023-06-13 13:58:07', '2023-06-13 13:58:07', NULL);
INSERT INTO `hi-sing`.`system_config` (`creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`,
                                       `status`, `weight`, `created_at`, `updated_at`, `deleted_at`)
VALUES (12, 0, '团队歌手标签运营人', 'DBYsQqJrvuPf_d_zMR4va', '12', '{\"type\": \"input\"}',
        '团队歌手标签限制通知接收人员', 1, 0, '2023-06-16 11:33:20', '2023-06-16 11:33:20', NULL);


INSERT INTO `hi-sing`.`system_config` (`creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`,
                                       `status`, `weight`, `created_at`, `updated_at`, `deleted_at`)
VALUES (12, 0, '自动退群天数', 'F_bk65qzuTXvyemFAl4DR', '7', '{\"type\": \"input\"}',
        '单位:天', 1, 0, '2023-06-16 11:33:20', '2023-06-16 11:33:20', NULL);


INSERT INTO `hi-sing`.`system_config` (`creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`,
                                       `status`, `weight`, `created_at`, `updated_at`, `deleted_at`)
VALUES (12, 0, '入团邀请限制', 'bZ__e20DwVDbQKiVWlJYc', '1', '{\"type\": \"input\"}',
        '单位:天', 1, 0, '2023-06-16 11:33:20', '2023-06-16 11:33:20', NULL);


INSERT INTO `hi-sing`.`system_config` (`creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`,
                                       `status`, `weight`, `created_at`, `updated_at`, `deleted_at`)
VALUES (12, 0, '邀请失效时间', '-gYt2-b4MIRRePHVXpMnD', '7', '{\"type\": \"input\"}',
        '单位:天', 1, 0, '2023-06-16 11:33:20', '2023-06-16 11:33:20', NULL);