1.9.8.sql 12.6 KB
ALTER TABLE `hi-sing`.`activity_share_users` ADD UNIQUE INDEX `key` (`activity_id` ASC, `user_id` ASC) USING BTREE;

CREATE TABLE `hi-sing`.`activity_user_has_prices`
(
    `id`                int      NOT NULL AUTO_INCREMENT,
    `user_id`           int      NOT NULL DEFAULT 0 COMMENT '用户id',
    `activity_id`       int      NOT NULL DEFAULT 0 COMMENT '活动id',
    `value`             json     NOT NULL COMMENT '分成比列',
    `is_deduct`         tinyint  NOT NULL DEFAULT 0 COMMENT '分成是否抵扣唱酬  0:否  1:是',
    `is_talk`           tinyint  NOT NULL DEFAULT 0 COMMENT '是否可谈  0:否 1:是',
    `address_id`        int      NOT NULL DEFAULT 0 COMMENT '录音地址',
    `is_accept_address` tinyint  NOT NULL DEFAULT 0 COMMENT '是否接受其它录音地址  0:不接受  1:接受',
    `created_at`        datetime NOT NULL,
    `updated_at`        datetime NOT NULL,
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `key` (`activity_id` ASC, `user_id` ASC) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = Dynamic;

CREATE TABLE `hi-sing`.`country_areas`
(
    `id`         int UNSIGNED                                                  NOT NULL AUTO_INCREMENT,
    `identifier` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  NOT NULL,
    `name`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
    `status`     tinyint UNSIGNED                                              NOT NULL DEFAULT 1,
    `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;

CREATE TABLE `hi-sing`.`country_regions`
(
    `id`         int UNSIGNED                                                  NOT NULL AUTO_INCREMENT,
    `parent_id`  int UNSIGNED                                                  NOT NULL DEFAULT 0,
    `country_id` int UNSIGNED                                                  NOT NULL,
    `identifier` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  NOT NULL,
    `name`       varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
    `code`       varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  NOT NULL DEFAULT '',
    `weight`     tinyint UNSIGNED                                              NOT NULL DEFAULT 0,
    `status`     tinyint UNSIGNED                                              NOT NULL DEFAULT 1,
    `created_at` datetime                                                      NULL     DEFAULT NULL,
    `updated_at` datetime                                                      NULL     DEFAULT NULL,
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `parent` (`parent_id` ASC) USING BTREE,
    INDEX `code` (`code` ASC) USING BTREE,
    INDEX `country` (`country_id` ASC) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = Dynamic;

CREATE TABLE `hi-sing`.`failed_jobs`
(
    `id`         bigint UNSIGNED                                               NOT NULL AUTO_INCREMENT,
    `uuid`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
    `connection` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci         NOT NULL,
    `queue`      text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci         NOT NULL,
    `payload`    longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci     NOT NULL,
    `exception`  longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci     NOT NULL,
    `failed_at`  timestamp                                                     NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE INDEX `failed_jobs_uuid_unique` (`uuid` ASC) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = Dynamic;

ALTER TABLE `hi-sing`.`system_http_logs`
    MODIFY COLUMN `guard` enum ('Admin','Manage','App','Other','Web') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Other' AFTER `id`;

CREATE TABLE `hi-sing`.`telescope_entries`
(
    `sequence`                bigint UNSIGNED                                               NOT NULL AUTO_INCREMENT,
    `uuid`                    char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci     NOT NULL,
    `batch_id`                char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci     NOT NULL,
    `family_hash`             varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL     DEFAULT NULL,
    `should_display_on_index` tinyint(1)                                                    NOT NULL DEFAULT 1,
    `type`                    varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci  NOT NULL,
    `content`                 longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci     NOT NULL,
    `created_at`              datetime                                                      NULL     DEFAULT NULL,
    PRIMARY KEY (`sequence`) USING BTREE,
    UNIQUE INDEX `telescope_entries_uuid_unique` (`uuid` ASC) USING BTREE,
    INDEX `telescope_entries_batch_id_index` (`batch_id` ASC) USING BTREE,
    INDEX `telescope_entries_family_hash_index` (`family_hash` ASC) USING BTREE,
    INDEX `telescope_entries_created_at_index` (`created_at` ASC) USING BTREE,
    INDEX `telescope_entries_type_should_display_on_index_index` (`type` ASC, `should_display_on_index` ASC) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = Dynamic;

CREATE TABLE `hi-sing`.`telescope_entries_tags`
(
    `entry_uuid` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci     NOT NULL,
    `tag`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
    INDEX `telescope_entries_tags_entry_uuid_tag_index` (`entry_uuid` ASC, `tag` ASC) USING BTREE,
    INDEX `telescope_entries_tags_tag_index` (`tag` ASC) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = Dynamic;

CREATE TABLE `hi-sing`.`telescope_monitoring`
(
    `tag` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_unicode_ci
  ROW_FORMAT = Dynamic;

ALTER TABLE `hi-sing`.`tidings_has_reports`
    ADD COLUMN `person_id` int NULL DEFAULT 0 COMMENT '被举报人id' AFTER `comment_id`;

ALTER TABLE `hi-sing`.`tidings_has_reports`
    ADD COLUMN `desc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL AFTER `reason`;

ALTER TABLE `hi-sing`.`telescope_entries_tags`
    ADD CONSTRAINT `telescope_entries_tags_entry_uuid_foreign` FOREIGN KEY (`entry_uuid`) REFERENCES `hi-sing`.`telescope_entries` (`uuid`) ON DELETE CASCADE ON UPDATE RESTRICT;

CREATE 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`,
       `activity_has_users`.`user_id`               AS `user_id`,
       `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`.`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`))));


INSERT INTO `hi-sing`.`system_config` (`id`, `creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`, `status`, `weight`, `created_at`, `updated_at`, `deleted_at`) VALUES (41, 0, 0, '分成年限', 'year_limit ', '', NULL, '', 1, 0, '2023-03-24 16:41:54', '2023-03-24 16:41:54', NULL);
INSERT INTO `hi-sing`.`system_config` (`id`, `creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`, `status`, `weight`, `created_at`, `updated_at`, `deleted_at`) VALUES (42, 0, 41, '1年', '1', '1年', NULL, '', 1, 0, '2023-03-24 16:42:34', '2023-03-24 16:48:05', NULL);
INSERT INTO `hi-sing`.`system_config` (`id`, `creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`, `status`, `weight`, `created_at`, `updated_at`, `deleted_at`) VALUES (43, 0, 41, '2年', '2', '2年', NULL, '', 1, 0, '2023-03-24 16:42:46', '2023-03-24 16:48:12', NULL);
INSERT INTO `hi-sing`.`system_config` (`id`, `creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`, `status`, `weight`, `created_at`, `updated_at`, `deleted_at`) VALUES (44, 0, 41, '3年', '3', '3年', NULL, '', 1, 0, '2023-03-24 16:42:54', '2023-03-24 16:48:29', NULL);
INSERT INTO `hi-sing`.`system_config` (`id`, `creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`, `status`, `weight`, `created_at`, `updated_at`, `deleted_at`) VALUES (45, 0, 41, '4年', '4', '4年', NULL, '', 1, 0, '2023-03-24 16:43:02', '2023-03-24 16:48:19', NULL);
INSERT INTO `hi-sing`.`system_config` (`id`, `creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`, `status`, `weight`, `created_at`, `updated_at`, `deleted_at`) VALUES (46, 0, 41, '5年', '5', '5年', NULL, '', 1, 0, '2023-03-24 16:43:10', '2023-03-24 16:48:35', NULL);
INSERT INTO `hi-sing`.`system_config` (`id`, `creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`, `status`, `weight`, `created_at`, `updated_at`, `deleted_at`) VALUES (47, 0, 41, '5 年以上', 'more_than_five_years', '5 年以上', NULL, '', 1, 0, '2023-03-24 16:44:56', '2023-03-24 16:48:42', NULL);
INSERT INTO `hi-sing`.`system_config` (`id`, `creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`, `status`, `weight`, `created_at`, `updated_at`, `deleted_at`) VALUES (48, 0, 0, '用户举报', 'user_report', '', NULL, '', 1, 0, '2023-03-29 15:27:07', '2023-03-29 15:27:07', NULL);
INSERT INTO `hi-sing`.`system_config` (`id`, `creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`, `status`, `weight`, `created_at`, `updated_at`, `deleted_at`) VALUES (49, 0, 48, '言辞谩骂', 'user_report1', '言辞谩骂', NULL, '', 1, 0, '2023-03-29 15:30:11', '2023-03-29 15:30:59', NULL);
INSERT INTO `hi-sing`.`system_config` (`id`, `creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`, `status`, `weight`, `created_at`, `updated_at`, `deleted_at`) VALUES (50, 0, 48, '涉黑言论', 'user_report2', '涉黑言论', NULL, '', 1, 0, '2023-03-29 15:30:48', '2023-03-29 15:30:48', NULL);
INSERT INTO `hi-sing`.`system_config` (`id`, `creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`, `status`, `weight`, `created_at`, `updated_at`, `deleted_at`) VALUES (51, 0, 48, '涉黄传播', 'user_report3', '涉黄传播', NULL, '', 1, 0, '2023-03-29 15:31:36', '2023-03-29 15:31:36', NULL);
INSERT INTO `hi-sing`.`system_config` (`id`, `creator_id`, `parent_id`, `name`, `identifier`, `content`, `expand`, `remark`, `status`, `weight`, `created_at`, `updated_at`, `deleted_at`) VALUES (52, 0, 0, '较高分成比列', 'high_ratio', '36', NULL, '您填写的费用过高,版权方可能不会选您~', 1, 0, '2023-03-31 10:17:55', '2023-04-03 16:07:34', NULL);