-- MySQL dump 10.13  Distrib 8.0.31, for Linux (x86_64)
--
-- Host: localhost    Database: 
-- ------------------------------------------------------
-- Server version	8.0.31
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */
;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */
;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */
;
/*!50503 SET NAMES utf8mb4 */
;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */
;
/*!40103 SET TIME_ZONE='+00:00' */
;
/*!50606 SET @OLD_INNODB_STATS_AUTO_RECALC=@@INNODB_STATS_AUTO_RECALC */
;
/*!50606 SET GLOBAL INNODB_STATS_AUTO_RECALC=OFF */
;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */
;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */
;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */
;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */
;
--
-- Current Database: `mysql`
--

CREATE DATABASE
/*!32312 IF NOT EXISTS*/
`mysql`
/*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */
/*!80016 DEFAULT ENCRYPTION='N' */
;
USE `mysql`;
--
-- Table structure for table `columns_priv`
--

DROP TABLE IF EXISTS `columns_priv`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `columns_priv` (
  `Host` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
  `Db` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `User` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `Table_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `Column_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `Column_priv`
  set('Select', 'Insert', 'Update', 'References') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
    PRIMARY KEY (`Host`, `User`, `Db`, `Table_name`, `Column_name`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Column privileges';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `component`
--

DROP TABLE IF EXISTS `component`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `component` (
  `component_id` int unsigned NOT NULL AUTO_INCREMENT,
  `component_group_id` int unsigned NOT NULL,
  `component_urn` text NOT NULL,
  PRIMARY KEY (`component_id`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 ROW_FORMAT = DYNAMIC COMMENT = 'Components';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `db`
--

DROP TABLE IF EXISTS `db`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `db` (
  `Host` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
  `Db` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `User` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `Select_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Insert_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Update_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Delete_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Create_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Drop_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Grant_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `References_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Index_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Alter_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Create_tmp_table_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Lock_tables_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Create_view_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Show_view_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Create_routine_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Alter_routine_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Execute_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Event_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Trigger_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  PRIMARY KEY (`Host`, `User`, `Db`),
  KEY `User` (`User`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Database privileges';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `default_roles`
--

DROP TABLE IF EXISTS `default_roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `default_roles` (
  `HOST` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
  `USER` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `DEFAULT_ROLE_HOST` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '%',
  `DEFAULT_ROLE_USER` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  PRIMARY KEY (
    `HOST`,
    `USER`,
    `DEFAULT_ROLE_HOST`,
    `DEFAULT_ROLE_USER`
  )
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Default roles';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `engine_cost`
--

DROP TABLE IF EXISTS `engine_cost`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `engine_cost` (
  `engine_name` varchar(64) NOT NULL,
  `device_type` int NOT NULL,
  `cost_name` varchar(64) NOT NULL,
  `cost_value` float DEFAULT NULL,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `comment` varchar(1024) DEFAULT NULL,
  `default_value` float GENERATED ALWAYS AS (
    (
      case
        `cost_name`
        when _utf8mb3 'io_block_read_cost' then 1.0
        when _utf8mb3 'memory_block_read_cost' then 0.25
        else NULL
      end
    )
  ) VIRTUAL,
  PRIMARY KEY (`cost_name`, `engine_name`, `device_type`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `func`
--

DROP TABLE IF EXISTS `func`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `func` (
  `name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `ret` tinyint NOT NULL DEFAULT '0',
  `dl` char(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `type` enum('function', 'aggregate') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  PRIMARY KEY (`name`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'User defined functions';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `global_grants`
--

DROP TABLE IF EXISTS `global_grants`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `global_grants` (
  `USER` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `HOST` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
  `PRIV` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  `WITH_GRANT_OPTION` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  PRIMARY KEY (`USER`, `HOST`, `PRIV`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Extended global grants';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `gtid_executed`
--

/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE IF NOT EXISTS `gtid_executed` (
  `source_uuid` char(36) NOT NULL COMMENT 'uuid of the source where the transaction was originally executed.',
  `interval_start` bigint NOT NULL COMMENT 'First number of interval.',
  `interval_end` bigint NOT NULL COMMENT 'Last number of interval.',
  PRIMARY KEY (`source_uuid`, `interval_start`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `help_category`
--

DROP TABLE IF EXISTS `help_category`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `help_category` (
  `help_category_id` smallint unsigned NOT NULL,
  `name` char(64) NOT NULL,
  `parent_category_id` smallint unsigned DEFAULT NULL,
  `url` text NOT NULL,
  PRIMARY KEY (`help_category_id`),
  UNIQUE KEY `name` (`name`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'help categories';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `help_keyword`
--

DROP TABLE IF EXISTS `help_keyword`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `help_keyword` (
  `help_keyword_id` int unsigned NOT NULL,
  `name` char(64) NOT NULL,
  PRIMARY KEY (`help_keyword_id`),
  UNIQUE KEY `name` (`name`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'help keywords';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `help_relation`
--

DROP TABLE IF EXISTS `help_relation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `help_relation` (
  `help_topic_id` int unsigned NOT NULL,
  `help_keyword_id` int unsigned NOT NULL,
  PRIMARY KEY (`help_keyword_id`, `help_topic_id`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'keyword-topic relation';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `help_topic`
--

DROP TABLE IF EXISTS `help_topic`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `help_topic` (
  `help_topic_id` int unsigned NOT NULL,
  `name` char(64) NOT NULL,
  `help_category_id` smallint unsigned NOT NULL,
  `description` text NOT NULL,
  `example` text NOT NULL,
  `url` text NOT NULL,
  PRIMARY KEY (`help_topic_id`),
  UNIQUE KEY `name` (`name`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'help topics';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `ndb_binlog_index`
--

DROP TABLE IF EXISTS `ndb_binlog_index`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `ndb_binlog_index` (
  `Position` bigint unsigned NOT NULL,
  `File` varchar(255) NOT NULL,
  `epoch` bigint unsigned NOT NULL,
  `inserts` int unsigned NOT NULL,
  `updates` int unsigned NOT NULL,
  `deletes` int unsigned NOT NULL,
  `schemaops` int unsigned NOT NULL,
  `orig_server_id` int unsigned NOT NULL,
  `orig_epoch` bigint unsigned NOT NULL,
  `gci` int unsigned NOT NULL,
  `next_position` bigint unsigned NOT NULL,
  `next_file` varchar(255) NOT NULL,
  PRIMARY KEY (`epoch`, `orig_server_id`, `orig_epoch`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = latin1 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `password_history`
--

DROP TABLE IF EXISTS `password_history`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `password_history` (
  `Host` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
  `User` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `Password_timestamp` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `Password` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin,
  PRIMARY KEY (`Host`, `User`, `Password_timestamp` DESC)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Password history for user accounts';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `plugin`
--

DROP TABLE IF EXISTS `plugin`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `plugin` (
  `name` varchar(64) NOT NULL DEFAULT '',
  `dl` varchar(128) NOT NULL DEFAULT '',
  PRIMARY KEY (`name`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'MySQL plugins';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `procs_priv`
--

DROP TABLE IF EXISTS `procs_priv`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `procs_priv` (
  `Host` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
  `Db` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `User` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `Routine_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  `Routine_type` enum('FUNCTION', 'PROCEDURE') CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `Grantor` varchar(288) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `Proc_priv`
  set('Execute', 'Alter Routine', 'Grant') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
    `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`Host`, `User`, `Db`, `Routine_name`, `Routine_type`),
    KEY `Grantor` (`Grantor`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Procedure privileges';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `proxies_priv`
--

DROP TABLE IF EXISTS `proxies_priv`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `proxies_priv` (
  `Host` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
  `User` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `Proxied_host` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
  `Proxied_user` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `With_grant` tinyint(1) NOT NULL DEFAULT '0',
  `Grantor` varchar(288) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`Host`, `User`, `Proxied_host`, `Proxied_user`),
  KEY `Grantor` (`Grantor`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'User proxy privileges';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `replication_asynchronous_connection_failover`
--

DROP TABLE IF EXISTS `replication_asynchronous_connection_failover`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `replication_asynchronous_connection_failover` (
  `Channel_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'The replication channel name that connects source and replica.',
  `Host` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL COMMENT 'The source hostname that the replica will attempt to switch over the replication connection to in case of a failure.',
  `Port` int unsigned NOT NULL COMMENT 'The source port that the replica will attempt to switch over the replication connection to in case of a failure.',
  `Network_namespace` char(64) NOT NULL COMMENT 'The source network namespace that the replica will attempt to switch over the replication connection to in case of a failure. If its value is empty, connections use the default (global) namespace.',
  `Weight` tinyint unsigned NOT NULL COMMENT 'The order in which the replica shall try to switch the connection over to when there are failures. Weight can be set to a number between 1 and 100, where 100 is the highest weight and 1 the lowest.',
  `Managed_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT 'The name of the group which this server belongs to.',
  PRIMARY KEY (
    `Channel_name`,
    `Host`,
    `Port`,
    `Network_namespace`,
    `Managed_name`
  ),
  KEY `Channel_name` (`Channel_name`, `Managed_name`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'The source configuration details';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `replication_asynchronous_connection_failover_managed`
--

DROP TABLE IF EXISTS `replication_asynchronous_connection_failover_managed`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `replication_asynchronous_connection_failover_managed` (
  `Channel_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'The replication channel name that connects source and replica.',
  `Managed_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT 'The name of the source which needs to be managed.',
  `Managed_type` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT 'Determines the managed type.',
  `Configuration` json DEFAULT NULL COMMENT 'The data to help manage group. For Managed_type = GroupReplication, Configuration value should contain {"Primary_weight": 80, "Secondary_weight": 60}, so that it assigns weight=80 to PRIMARY of the group, and weight=60 for rest of the members in mysql.replication_asynchronous_connection_failover table.',
  PRIMARY KEY (`Channel_name`, `Managed_name`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'The managed source configuration details';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `replication_group_configuration_version`
--

DROP TABLE IF EXISTS `replication_group_configuration_version`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `replication_group_configuration_version` (
  `name` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL COMMENT 'The configuration name.',
  `version` bigint unsigned NOT NULL COMMENT 'The version of the configuration name.',
  PRIMARY KEY (`name`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'The group configuration version.';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `replication_group_member_actions`
--

DROP TABLE IF EXISTS `replication_group_member_actions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `replication_group_member_actions` (
  `name` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL COMMENT 'The action name.',
  `event` char(64) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL COMMENT 'The event that will trigger the action.',
  `enabled` tinyint(1) NOT NULL COMMENT 'Whether the action is enabled.',
  `type` char(64) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL COMMENT 'The action type.',
  `priority` tinyint unsigned NOT NULL COMMENT 'The order on which the action will be run, value between 1 and 100, lower values first.',
  `error_handling` char(64) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL COMMENT 'On errors during the action will be handled: IGNORE, CRITICAL.',
  PRIMARY KEY (`name`, `event`),
  KEY `event` (`event`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'The member actions configuration.';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `role_edges`
--

DROP TABLE IF EXISTS `role_edges`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `role_edges` (
  `FROM_HOST` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
  `FROM_USER` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `TO_HOST` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
  `TO_USER` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `WITH_ADMIN_OPTION` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  PRIMARY KEY (`FROM_HOST`, `FROM_USER`, `TO_HOST`, `TO_USER`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Role hierarchy and role grants';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `server_cost`
--

DROP TABLE IF EXISTS `server_cost`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `server_cost` (
  `cost_name` varchar(64) NOT NULL,
  `cost_value` float DEFAULT NULL,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `comment` varchar(1024) DEFAULT NULL,
  `default_value` float GENERATED ALWAYS AS (
    (
      case
        `cost_name`
        when _utf8mb3 'disk_temptable_create_cost' then 20.0
        when _utf8mb3 'disk_temptable_row_cost' then 0.5
        when _utf8mb3 'key_compare_cost' then 0.05
        when _utf8mb3 'memory_temptable_create_cost' then 1.0
        when _utf8mb3 'memory_temptable_row_cost' then 0.1
        when _utf8mb3 'row_evaluate_cost' then 0.1
        else NULL
      end
    )
  ) VIRTUAL,
  PRIMARY KEY (`cost_name`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `servers`
--

DROP TABLE IF EXISTS `servers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `servers` (
  `Server_name` char(64) NOT NULL DEFAULT '',
  `Host` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
  `Db` char(64) NOT NULL DEFAULT '',
  `Username` char(64) NOT NULL DEFAULT '',
  `Password` char(64) NOT NULL DEFAULT '',
  `Port` int NOT NULL DEFAULT '0',
  `Socket` char(64) NOT NULL DEFAULT '',
  `Wrapper` char(64) NOT NULL DEFAULT '',
  `Owner` char(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`Server_name`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'MySQL Foreign Servers table';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `slave_master_info`
--

/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE IF NOT EXISTS `slave_master_info` (
  `Number_of_lines` int unsigned NOT NULL COMMENT 'Number of lines in the file.',
  `Master_log_name` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'The name of the master binary log currently being read from the master.',
  `Master_log_pos` bigint unsigned NOT NULL COMMENT 'The master log position of the last read event.',
  `Host` varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci DEFAULT NULL COMMENT 'The host name of the source.',
  `User_name` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The user name used to connect to the master.',
  `User_password` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The password used to connect to the master.',
  `Port` int unsigned NOT NULL COMMENT 'The network port used to connect to the master.',
  `Connect_retry` int unsigned NOT NULL COMMENT 'The period (in seconds) that the slave will wait before trying to reconnect to the master.',
  `Enabled_ssl` tinyint(1) NOT NULL COMMENT 'Indicates whether the server supports SSL connections.',
  `Ssl_ca` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The file used for the Certificate Authority (CA) certificate.',
  `Ssl_capath` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The path to the Certificate Authority (CA) certificates.',
  `Ssl_cert` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The name of the SSL certificate file.',
  `Ssl_cipher` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The name of the cipher in use for the SSL connection.',
  `Ssl_key` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The name of the SSL key file.',
  `Ssl_verify_server_cert` tinyint(1) NOT NULL COMMENT 'Whether to verify the server certificate.',
  `Heartbeat` float NOT NULL,
  `Bind` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'Displays which interface is employed when connecting to the MySQL server',
  `Ignored_server_ids` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The number of server IDs to be ignored, followed by the actual server IDs',
  `Uuid` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The master server uuid.',
  `Retry_count` bigint unsigned NOT NULL COMMENT 'Number of reconnect attempts, to the master, before giving up.',
  `Ssl_crl` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The file used for the Certificate Revocation List (CRL)',
  `Ssl_crlpath` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The path used for Certificate Revocation List (CRL) files',
  `Enabled_auto_position` tinyint(1) NOT NULL COMMENT 'Indicates whether GTIDs will be used to retrieve events from the master.',
  `Channel_name` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'The channel on which the replica is connected to a source. Used in Multisource Replication',
  `Tls_version` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'Tls version',
  `Public_key_path` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The file containing public key of master server.',
  `Get_public_key` tinyint(1) NOT NULL COMMENT 'Preference to get public key from master.',
  `Network_namespace` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'Network namespace used for communication with the master server.',
  `Master_compression_algorithm` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'Compression algorithm supported for data transfer between source and replica.',
  `Master_zstd_compression_level` int unsigned NOT NULL COMMENT 'Compression level associated with zstd compression algorithm.',
  `Tls_ciphersuites` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'Ciphersuites used for TLS 1.3 communication with the master server.',
  `Source_connection_auto_failover` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Indicates whether the channel connection failover is enabled.',
  `Gtid_only` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Indicates if this channel only uses GTIDs and does not persist positions.',
  PRIMARY KEY (`Channel_name`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Master Information';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `slave_relay_log_info`
--

/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE IF NOT EXISTS `slave_relay_log_info` (
  `Number_of_lines` int unsigned NOT NULL COMMENT 'Number of lines in the file or rows in the table. Used to version table definitions.',
  `Relay_log_name` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The name of the current relay log file.',
  `Relay_log_pos` bigint unsigned DEFAULT NULL COMMENT 'The relay log position of the last executed event.',
  `Master_log_name` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'The name of the master binary log file from which the events in the relay log file were read.',
  `Master_log_pos` bigint unsigned DEFAULT NULL COMMENT 'The master log position of the last executed event.',
  `Sql_delay` int DEFAULT NULL COMMENT 'The number of seconds that the slave must lag behind the master.',
  `Number_of_workers` int unsigned DEFAULT NULL,
  `Id` int unsigned DEFAULT NULL COMMENT 'Internal Id that uniquely identifies this record.',
  `Channel_name` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'The channel on which the replica is connected to a source. Used in Multisource Replication',
  `Privilege_checks_username` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'Username part of PRIVILEGE_CHECKS_USER.',
  `Privilege_checks_hostname` varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci DEFAULT NULL COMMENT 'Hostname part of PRIVILEGE_CHECKS_USER.',
  `Require_row_format` tinyint(1) NOT NULL COMMENT 'Indicates whether the channel shall only accept row based events.',
  `Require_table_primary_key_check` enum('STREAM', 'ON', 'OFF') NOT NULL DEFAULT 'STREAM' COMMENT 'Indicates what is the channel policy regarding tables having primary keys on create and alter table queries',
  `Assign_gtids_to_anonymous_transactions_type` enum('OFF', 'LOCAL', 'UUID') NOT NULL DEFAULT 'OFF' COMMENT 'Indicates whether the channel will generate a new GTID for anonymous transactions. OFF means that anonymous transactions will remain anonymous. LOCAL means that anonymous transactions will be assigned a newly generated GTID based on server_uuid. UUID indicates that anonymous transactions will be assigned a newly generated GTID based on Assign_gtids_to_anonymous_transactions_value',
  `Assign_gtids_to_anonymous_transactions_value` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'Indicates the UUID used while generating GTIDs for anonymous transactions',
  PRIMARY KEY (`Channel_name`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Relay Log Information';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `slave_worker_info`
--

DROP TABLE IF EXISTS `slave_worker_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `slave_worker_info` (
  `Id` int unsigned NOT NULL,
  `Relay_log_name` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `Relay_log_pos` bigint unsigned NOT NULL,
  `Master_log_name` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `Master_log_pos` bigint unsigned NOT NULL,
  `Checkpoint_relay_log_name` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `Checkpoint_relay_log_pos` bigint unsigned NOT NULL,
  `Checkpoint_master_log_name` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `Checkpoint_master_log_pos` bigint unsigned NOT NULL,
  `Checkpoint_seqno` int unsigned NOT NULL,
  `Checkpoint_group_size` int unsigned NOT NULL,
  `Checkpoint_group_bitmap` blob NOT NULL,
  `Channel_name` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'The channel on which the replica is connected to a source. Used in Multisource Replication',
  PRIMARY KEY (`Channel_name`, `Id`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Worker Information';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `tables_priv`
--

DROP TABLE IF EXISTS `tables_priv`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `tables_priv` (
  `Host` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
  `Db` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `User` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `Table_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `Grantor` varchar(288) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `Table_priv`
  set(
      'Select',
      'Insert',
      'Update',
      'Delete',
      'Create',
      'Drop',
      'Grant',
      'References',
      'Index',
      'Alter',
      'Create View',
      'Show view',
      'Trigger'
    ) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
    `Column_priv`
  set('Select', 'Insert', 'Update', 'References') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
    PRIMARY KEY (`Host`, `User`, `Db`, `Table_name`),
    KEY `Grantor` (`Grantor`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Table privileges';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `time_zone`
--

DROP TABLE IF EXISTS `time_zone`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `time_zone` (
  `Time_zone_id` int unsigned NOT NULL AUTO_INCREMENT,
  `Use_leap_seconds` enum('Y', 'N') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  PRIMARY KEY (`Time_zone_id`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB AUTO_INCREMENT = 1790 DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Time zones';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `time_zone_leap_second`
--

DROP TABLE IF EXISTS `time_zone_leap_second`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `time_zone_leap_second` (
  `Transition_time` bigint NOT NULL,
  `Correction` int NOT NULL,
  PRIMARY KEY (`Transition_time`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Leap seconds information for time zones';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `time_zone_name`
--

DROP TABLE IF EXISTS `time_zone_name`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `time_zone_name` (
  `Name` char(64) NOT NULL,
  `Time_zone_id` int unsigned NOT NULL,
  PRIMARY KEY (`Name`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Time zone names';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `time_zone_transition`
--

DROP TABLE IF EXISTS `time_zone_transition`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `time_zone_transition` (
  `Time_zone_id` int unsigned NOT NULL,
  `Transition_time` bigint NOT NULL,
  `Transition_type_id` int unsigned NOT NULL,
  PRIMARY KEY (`Time_zone_id`, `Transition_time`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Time zone transitions';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `time_zone_transition_type`
--

DROP TABLE IF EXISTS `time_zone_transition_type`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `time_zone_transition_type` (
  `Time_zone_id` int unsigned NOT NULL,
  `Transition_type_id` int unsigned NOT NULL,
  `Offset` int NOT NULL DEFAULT '0',
  `Is_DST` tinyint unsigned NOT NULL DEFAULT '0',
  `Abbreviation` char(8) NOT NULL DEFAULT '',
  PRIMARY KEY (`Time_zone_id`, `Transition_type_id`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Time zone transition types';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `user`
--

DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `user` (
  `Host` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
  `User` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `Select_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Insert_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Update_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Delete_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Create_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Drop_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Reload_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Shutdown_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Process_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `File_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Grant_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `References_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Index_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Alter_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Show_db_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Super_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Create_tmp_table_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Lock_tables_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Execute_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Repl_slave_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Repl_client_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Create_view_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Show_view_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Create_routine_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Alter_routine_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Create_user_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Event_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Trigger_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Create_tablespace_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `ssl_type` enum('', 'ANY', 'X509', 'SPECIFIED') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  `ssl_cipher` blob NOT NULL,
  `x509_issuer` blob NOT NULL,
  `x509_subject` blob NOT NULL,
  `max_questions` int unsigned NOT NULL DEFAULT '0',
  `max_updates` int unsigned NOT NULL DEFAULT '0',
  `max_connections` int unsigned NOT NULL DEFAULT '0',
  `max_user_connections` int unsigned NOT NULL DEFAULT '0',
  `plugin` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT 'caching_sha2_password',
  `authentication_string` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin,
  `password_expired` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `password_last_changed` timestamp NULL DEFAULT NULL,
  `password_lifetime` smallint unsigned DEFAULT NULL,
  `account_locked` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Create_role_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Drop_role_priv` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Password_reuse_history` smallint unsigned DEFAULT NULL,
  `Password_reuse_time` smallint unsigned DEFAULT NULL,
  `Password_require_current` enum('N', 'Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `User_attributes` json DEFAULT NULL,
  PRIMARY KEY (`Host`, `User`)
)
/*!50100 TABLESPACE `mysql` */
ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin STATS_PERSISTENT = 0 ROW_FORMAT = DYNAMIC COMMENT = 'Users and global privileges';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `general_log`
--

/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE IF NOT EXISTS `general_log` (
  `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  `user_host` mediumtext NOT NULL,
  `thread_id` bigint unsigned NOT NULL,
  `server_id` int unsigned NOT NULL,
  `command_type` varchar(64) NOT NULL,
  `argument` mediumblob NOT NULL
) ENGINE = CSV DEFAULT CHARSET = utf8mb3 COMMENT = 'General log';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `slow_log`
--

/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE IF NOT EXISTS `slow_log` (
  `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  `user_host` mediumtext NOT NULL,
  `query_time` time(6) NOT NULL,
  `lock_time` time(6) NOT NULL,
  `rows_sent` int NOT NULL,
  `rows_examined` int NOT NULL,
  `db` varchar(512) NOT NULL,
  `last_insert_id` int NOT NULL,
  `insert_id` int NOT NULL,
  `server_id` int unsigned NOT NULL,
  `sql_text` mediumblob NOT NULL,
  `thread_id` bigint unsigned NOT NULL
) ENGINE = CSV DEFAULT CHARSET = utf8mb3 COMMENT = 'Slow log';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Current Database: `gitea`
--

CREATE DATABASE
/*!32312 IF NOT EXISTS*/
`gitea`
/*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs */
/*!80016 DEFAULT ENCRYPTION='N' */
;
USE `gitea`;
--
-- Table structure for table `access`
--

DROP TABLE IF EXISTS `access`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `access` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `mode` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_access_s` (`user_id`, `repo_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 2 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `access_token`
--

DROP TABLE IF EXISTS `access_token`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `access_token` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `uid` bigint DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `token_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `token_salt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `token_last_eight` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `scope` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_access_token_token_hash` (`token_hash`),
  KEY `IDX_access_token_uid` (`uid`),
  KEY `IDX_access_token_token_last_eight` (`token_last_eight`),
  KEY `IDX_access_token_created_unix` (`created_unix`),
  KEY `IDX_access_token_updated_unix` (`updated_unix`)
) ENGINE = InnoDB AUTO_INCREMENT = 2 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `action`
--

DROP TABLE IF EXISTS `action`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `action` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint DEFAULT NULL,
  `op_type` int DEFAULT NULL,
  `act_user_id` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `comment_id` bigint DEFAULT NULL,
  `is_deleted` tinyint(1) NOT NULL DEFAULT '0',
  `ref_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `is_private` tinyint(1) NOT NULL DEFAULT '0',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `created_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_action_user_id` (`user_id`),
  KEY `IDX_action_comment_id` (`comment_id`),
  KEY `IDX_action_au_r_c_u_d` (
    `act_user_id`,
    `repo_id`,
    `created_unix`,
    `user_id`,
    `is_deleted`
  ),
  KEY `IDX_action_r_u_d` (`repo_id`, `user_id`, `is_deleted`),
  KEY `IDX_action_c_u_d` (`created_unix`, `user_id`, `is_deleted`),
  KEY `IDX_action_c_u` (`user_id`, `is_deleted`),
  KEY `IDX_action_au_c_u` (`act_user_id`, `created_unix`, `user_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 129 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `action_artifact`
--

DROP TABLE IF EXISTS `action_artifact`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `action_artifact` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `run_id` bigint DEFAULT NULL,
  `runner_id` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `owner_id` bigint DEFAULT NULL,
  `commit_sha` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `storage_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `file_size` bigint DEFAULT NULL,
  `file_compressed_size` bigint DEFAULT NULL,
  `content_encoding` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `artifact_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `artifact_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `status` bigint DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  `expired_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_action_artifact_runid_name_path` (`run_id`, `artifact_path`, `artifact_name`),
  KEY `IDX_action_artifact_run_id` (`run_id`),
  KEY `IDX_action_artifact_repo_id` (`repo_id`),
  KEY `IDX_action_artifact_artifact_path` (`artifact_path`),
  KEY `IDX_action_artifact_artifact_name` (`artifact_name`),
  KEY `IDX_action_artifact_status` (`status`),
  KEY `IDX_action_artifact_updated_unix` (`updated_unix`),
  KEY `IDX_action_artifact_expired_unix` (`expired_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `action_run`
--

DROP TABLE IF EXISTS `action_run`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `action_run` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `owner_id` bigint DEFAULT NULL,
  `workflow_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `index` bigint DEFAULT NULL,
  `trigger_user_id` bigint DEFAULT NULL,
  `schedule_id` bigint DEFAULT NULL,
  `ref` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `commit_sha` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `is_fork_pull_request` tinyint(1) DEFAULT NULL,
  `need_approval` tinyint(1) DEFAULT NULL,
  `approved_by` bigint DEFAULT NULL,
  `event` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `event_payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `trigger_event` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `status` int DEFAULT NULL,
  `version` int DEFAULT '0',
  `raw_concurrency` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `concurrency_group` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL DEFAULT '',
  `concurrency_cancel` tinyint(1) NOT NULL DEFAULT '0',
  `started` bigint DEFAULT NULL,
  `stopped` bigint DEFAULT NULL,
  `previous_duration` bigint DEFAULT NULL,
  `created` bigint DEFAULT NULL,
  `updated` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_action_run_repo_index` (`repo_id`, `index`),
  KEY `IDX_action_run_trigger_user_id` (`trigger_user_id`),
  KEY `IDX_action_run_repo_concurrency` (`repo_id`, `concurrency_group`),
  KEY `IDX_action_run_ref` (`ref`),
  KEY `IDX_action_run_approved_by` (`approved_by`),
  KEY `IDX_action_run_status` (`status`),
  KEY `IDX_action_run_owner_id` (`owner_id`),
  KEY `IDX_action_run_workflow_id` (`workflow_id`),
  KEY `IDX_action_run_index` (`index`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `action_run_index`
--

DROP TABLE IF EXISTS `action_run_index`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `action_run_index` (
  `group_id` bigint NOT NULL,
  `max_index` bigint DEFAULT NULL,
  PRIMARY KEY (`group_id`),
  KEY `IDX_action_run_index_max_index` (`max_index`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `action_run_job`
--

DROP TABLE IF EXISTS `action_run_job`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `action_run_job` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `run_id` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `owner_id` bigint DEFAULT NULL,
  `commit_sha` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `is_fork_pull_request` tinyint(1) DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `attempt` bigint DEFAULT NULL,
  `workflow_payload` blob,
  `job_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `needs` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `runs_on` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `task_id` bigint DEFAULT NULL,
  `status` int DEFAULT NULL,
  `raw_concurrency` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `is_concurrency_evaluated` tinyint(1) DEFAULT NULL,
  `concurrency_group` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL DEFAULT '',
  `concurrency_cancel` tinyint(1) NOT NULL DEFAULT '0',
  `started` bigint DEFAULT NULL,
  `stopped` bigint DEFAULT NULL,
  `created` bigint DEFAULT NULL,
  `updated` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_action_run_job_status` (`status`),
  KEY `IDX_action_run_job_updated` (`updated`),
  KEY `IDX_action_run_job_run_id` (`run_id`),
  KEY `IDX_action_run_job_repo_concurrency` (`repo_id`, `concurrency_group`),
  KEY `IDX_action_run_job_owner_id` (`owner_id`),
  KEY `IDX_action_run_job_commit_sha` (`commit_sha`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `action_runner`
--

DROP TABLE IF EXISTS `action_runner`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `action_runner` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `uuid` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `version` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `owner_id` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `base` int DEFAULT NULL,
  `repo_range` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `token_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `token_salt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `last_online` bigint DEFAULT NULL,
  `last_active` bigint DEFAULT NULL,
  `agent_labels` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `ephemeral` tinyint(1) NOT NULL DEFAULT '0',
  `created` bigint DEFAULT NULL,
  `updated` bigint DEFAULT NULL,
  `deleted` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_action_runner_uuid` (`uuid`),
  UNIQUE KEY `UQE_action_runner_token_hash` (`token_hash`),
  KEY `IDX_action_runner_owner_id` (`owner_id`),
  KEY `IDX_action_runner_repo_id` (`repo_id`),
  KEY `IDX_action_runner_last_online` (`last_online`),
  KEY `IDX_action_runner_last_active` (`last_active`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `action_runner_token`
--

DROP TABLE IF EXISTS `action_runner_token`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `action_runner_token` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `owner_id` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `created` bigint DEFAULT NULL,
  `updated` bigint DEFAULT NULL,
  `deleted` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_action_runner_token_token` (`token`),
  KEY `IDX_action_runner_token_owner_id` (`owner_id`),
  KEY `IDX_action_runner_token_repo_id` (`repo_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `action_schedule`
--

DROP TABLE IF EXISTS `action_schedule`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `action_schedule` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `specs` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `repo_id` bigint DEFAULT NULL,
  `owner_id` bigint DEFAULT NULL,
  `workflow_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `trigger_user_id` bigint DEFAULT NULL,
  `ref` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `commit_sha` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `event` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `event_payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `content` blob,
  `created` bigint DEFAULT NULL,
  `updated` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_action_schedule_repo_id` (`repo_id`),
  KEY `IDX_action_schedule_owner_id` (`owner_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `action_schedule_spec`
--

DROP TABLE IF EXISTS `action_schedule_spec`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `action_schedule_spec` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `schedule_id` bigint DEFAULT NULL,
  `next` bigint DEFAULT NULL,
  `prev` bigint DEFAULT NULL,
  `spec` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `created` bigint DEFAULT NULL,
  `updated` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_action_schedule_spec_repo_id` (`repo_id`),
  KEY `IDX_action_schedule_spec_schedule_id` (`schedule_id`),
  KEY `IDX_action_schedule_spec_next` (`next`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `action_task`
--

DROP TABLE IF EXISTS `action_task`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `action_task` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `job_id` bigint DEFAULT NULL,
  `attempt` bigint DEFAULT NULL,
  `runner_id` bigint DEFAULT NULL,
  `status` int DEFAULT NULL,
  `started` bigint DEFAULT NULL,
  `stopped` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `owner_id` bigint DEFAULT NULL,
  `commit_sha` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `is_fork_pull_request` tinyint(1) DEFAULT NULL,
  `token_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `token_salt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `token_last_eight` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `log_filename` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `log_in_storage` tinyint(1) DEFAULT NULL,
  `log_length` bigint DEFAULT NULL,
  `log_size` bigint DEFAULT NULL,
  `log_indexes` longblob,
  `log_expired` tinyint(1) DEFAULT NULL,
  `created` bigint DEFAULT NULL,
  `updated` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_action_task_token_hash` (`token_hash`),
  KEY `IDX_action_task_status` (`status`),
  KEY `IDX_action_task_started` (`started`),
  KEY `IDX_action_task_repo_id` (`repo_id`),
  KEY `IDX_action_task_commit_sha` (`commit_sha`),
  KEY `IDX_action_task_updated` (`updated`),
  KEY `IDX_action_task_runner_id` (`runner_id`),
  KEY `IDX_action_task_stopped_log_expired` (`stopped`, `log_expired`),
  KEY `IDX_action_task_owner_id` (`owner_id`),
  KEY `IDX_action_task_token_last_eight` (`token_last_eight`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `action_task_output`
--

DROP TABLE IF EXISTS `action_task_output`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `action_task_output` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `task_id` bigint DEFAULT NULL,
  `output_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `output_value` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_action_task_output_task_id_output_key` (`task_id`, `output_key`),
  KEY `IDX_action_task_output_task_id` (`task_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `action_task_step`
--

DROP TABLE IF EXISTS `action_task_step`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `action_task_step` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `task_id` bigint DEFAULT NULL,
  `index` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `status` int DEFAULT NULL,
  `log_index` bigint DEFAULT NULL,
  `log_length` bigint DEFAULT NULL,
  `started` bigint DEFAULT NULL,
  `stopped` bigint DEFAULT NULL,
  `created` bigint DEFAULT NULL,
  `updated` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_action_task_step_task_index` (`task_id`, `index`),
  KEY `IDX_action_task_step_status` (`status`),
  KEY `IDX_action_task_step_task_id` (`task_id`),
  KEY `IDX_action_task_step_index` (`index`),
  KEY `IDX_action_task_step_repo_id` (`repo_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `action_tasks_version`
--

DROP TABLE IF EXISTS `action_tasks_version`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `action_tasks_version` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `owner_id` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `version` bigint DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_action_tasks_version_owner_repo` (`owner_id`, `repo_id`),
  KEY `IDX_action_tasks_version_repo_id` (`repo_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `action_variable`
--

DROP TABLE IF EXISTS `action_variable`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `action_variable` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `owner_id` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `created_unix` bigint NOT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_action_variable_owner_repo_name` (`owner_id`, `repo_id`, `name`),
  KEY `IDX_action_variable_repo_id` (`repo_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `app_state`
--

DROP TABLE IF EXISTS `app_state`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `app_state` (
  `id` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `revision` bigint DEFAULT NULL,
  `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `attachment`
--

DROP TABLE IF EXISTS `attachment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `attachment` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `uuid` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `issue_id` bigint DEFAULT NULL,
  `release_id` bigint DEFAULT NULL,
  `uploader_id` bigint DEFAULT '0',
  `comment_id` bigint DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `download_count` bigint DEFAULT '0',
  `size` bigint DEFAULT '0',
  `created_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_attachment_uuid` (`uuid`),
  KEY `IDX_attachment_repo_id` (`repo_id`),
  KEY `IDX_attachment_issue_id` (`issue_id`),
  KEY `IDX_attachment_release_id` (`release_id`),
  KEY `IDX_attachment_uploader_id` (`uploader_id`),
  KEY `IDX_attachment_comment_id` (`comment_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `auth_token`
--

DROP TABLE IF EXISTS `auth_token`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `auth_token` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `token_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `user_id` bigint DEFAULT NULL,
  `expires_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_auth_token_user_id` (`user_id`),
  KEY `IDX_auth_token_expires_unix` (`expires_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `badge`
--

DROP TABLE IF EXISTS `badge`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `badge` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `slug` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `image_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_badge_slug` (`slug`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `branch`
--

DROP TABLE IF EXISTS `branch`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `branch` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `commit_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `commit_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `pusher_id` bigint DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT NULL,
  `deleted_by_id` bigint DEFAULT NULL,
  `deleted_unix` bigint DEFAULT NULL,
  `commit_time` bigint DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_branch_s` (`repo_id`, `name`),
  KEY `IDX_branch_is_deleted` (`is_deleted`),
  KEY `IDX_branch_deleted_unix` (`deleted_unix`)
) ENGINE = InnoDB AUTO_INCREMENT = 3 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `collaboration`
--

DROP TABLE IF EXISTS `collaboration`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `collaboration` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint NOT NULL,
  `user_id` bigint NOT NULL,
  `mode` int NOT NULL DEFAULT '2',
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_collaboration_s` (`repo_id`, `user_id`),
  KEY `IDX_collaboration_repo_id` (`repo_id`),
  KEY `IDX_collaboration_user_id` (`user_id`),
  KEY `IDX_collaboration_created_unix` (`created_unix`),
  KEY `IDX_collaboration_updated_unix` (`updated_unix`)
) ENGINE = InnoDB AUTO_INCREMENT = 2 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `comment`
--

DROP TABLE IF EXISTS `comment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `comment` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `type` int DEFAULT NULL,
  `poster_id` bigint DEFAULT NULL,
  `original_author` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `original_author_id` bigint DEFAULT NULL,
  `issue_id` bigint DEFAULT NULL,
  `label_id` bigint DEFAULT NULL,
  `old_project_id` bigint DEFAULT NULL,
  `project_id` bigint DEFAULT NULL,
  `old_milestone_id` bigint DEFAULT NULL,
  `milestone_id` bigint DEFAULT NULL,
  `time_id` bigint DEFAULT NULL,
  `assignee_id` bigint DEFAULT NULL,
  `removed_assignee` tinyint(1) DEFAULT NULL,
  `assignee_team_id` bigint NOT NULL DEFAULT '0',
  `resolve_doer_id` bigint DEFAULT NULL,
  `old_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `new_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `old_ref` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `new_ref` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `dependent_issue_id` bigint DEFAULT NULL,
  `commit_id` bigint DEFAULT NULL,
  `line` bigint DEFAULT NULL,
  `tree_path` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `content_version` int NOT NULL DEFAULT '0',
  `patch` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  `commit_sha` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `review_id` bigint DEFAULT NULL,
  `invalidated` tinyint(1) DEFAULT NULL,
  `ref_repo_id` bigint DEFAULT NULL,
  `ref_issue_id` bigint DEFAULT NULL,
  `ref_comment_id` bigint DEFAULT NULL,
  `ref_action` smallint DEFAULT NULL,
  `ref_is_pull` tinyint(1) DEFAULT NULL,
  `comment_meta_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  PRIMARY KEY (`id`),
  KEY `IDX_comment_poster_id` (`poster_id`),
  KEY `IDX_comment_dependent_issue_id` (`dependent_issue_id`),
  KEY `IDX_comment_created_unix` (`created_unix`),
  KEY `IDX_comment_updated_unix` (`updated_unix`),
  KEY `IDX_comment_review_id` (`review_id`),
  KEY `IDX_comment_ref_repo_id` (`ref_repo_id`),
  KEY `IDX_comment_ref_issue_id` (`ref_issue_id`),
  KEY `IDX_comment_type` (`type`),
  KEY `IDX_comment_issue_id` (`issue_id`),
  KEY `IDX_comment_ref_comment_id` (`ref_comment_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `commit_status`
--

DROP TABLE IF EXISTS `commit_status`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `commit_status` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `index` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `state` varchar(7) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `sha` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `target_url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `context_hash` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `context` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `creator_id` bigint DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_commit_status_repo_sha_index` (`index`, `repo_id`, `sha`),
  KEY `IDX_commit_status_index` (`index`),
  KEY `IDX_commit_status_repo_id` (`repo_id`),
  KEY `IDX_commit_status_sha` (`sha`),
  KEY `IDX_commit_status_context_hash` (`context_hash`),
  KEY `IDX_commit_status_created_unix` (`created_unix`),
  KEY `IDX_commit_status_updated_unix` (`updated_unix`)
) ENGINE = InnoDB AUTO_INCREMENT = 499 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `commit_status_index`
--

DROP TABLE IF EXISTS `commit_status_index`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `commit_status_index` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `sha` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `max_index` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_commit_status_index_repo_sha` (`repo_id`, `sha`),
  KEY `IDX_commit_status_index_max_index` (`max_index`)
) ENGINE = InnoDB AUTO_INCREMENT = 499 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `commit_status_summary`
--

DROP TABLE IF EXISTS `commit_status_summary`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `commit_status_summary` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `sha` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `state` varchar(7) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `target_url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_commit_status_summary_repo_id_sha` (`repo_id`, `sha`),
  KEY `IDX_commit_status_summary_repo_id` (`repo_id`),
  KEY `IDX_commit_status_summary_sha` (`sha`)
) ENGINE = InnoDB AUTO_INCREMENT = 499 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `dbfs_data`
--

DROP TABLE IF EXISTS `dbfs_data`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `dbfs_data` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `revision` bigint NOT NULL,
  `meta_id` bigint NOT NULL,
  `blob_offset` bigint NOT NULL,
  `blob_size` bigint NOT NULL,
  `blob_data` blob NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_dbfs_data_meta_offset` (`meta_id`, `blob_offset`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `dbfs_meta`
--

DROP TABLE IF EXISTS `dbfs_meta`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `dbfs_meta` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `full_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `block_size` bigint NOT NULL,
  `file_size` bigint NOT NULL,
  `create_timestamp` bigint NOT NULL,
  `modify_timestamp` bigint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_dbfs_meta_full_path` (`full_path`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `deploy_key`
--

DROP TABLE IF EXISTS `deploy_key`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `deploy_key` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `key_id` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `fingerprint` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `mode` int NOT NULL DEFAULT '1',
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_deploy_key_s` (`key_id`, `repo_id`),
  KEY `IDX_deploy_key_key_id` (`key_id`),
  KEY `IDX_deploy_key_repo_id` (`repo_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `email_address`
--

DROP TABLE IF EXISTS `email_address`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `email_address` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `uid` bigint NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `lower_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `is_activated` tinyint(1) DEFAULT NULL,
  `is_primary` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_email_address_lower_email` (`lower_email`),
  UNIQUE KEY `UQE_email_address_email` (`email`),
  KEY `IDX_email_address_uid` (`uid`)
) ENGINE = InnoDB AUTO_INCREMENT = 3 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `email_hash`
--

DROP TABLE IF EXISTS `email_hash`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `email_hash` (
  `hash` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  PRIMARY KEY (`hash`),
  UNIQUE KEY `UQE_email_hash_email` (`email`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `external_login_user`
--

DROP TABLE IF EXISTS `external_login_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `external_login_user` (
  `external_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `user_id` bigint NOT NULL,
  `login_source_id` bigint NOT NULL,
  `raw_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `provider` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `first_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `last_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `nick_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `avatar_url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `access_token` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `access_token_secret` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `refresh_token` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `expires_at` datetime DEFAULT NULL,
  PRIMARY KEY (`external_id`, `login_source_id`),
  KEY `IDX_external_login_user_user_id` (`user_id`),
  KEY `IDX_external_login_user_provider` (`provider`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `follow`
--

DROP TABLE IF EXISTS `follow`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `follow` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint DEFAULT NULL,
  `follow_id` bigint DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_follow_follow` (`user_id`, `follow_id`),
  KEY `IDX_follow_created_unix` (`created_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `gpg_key`
--

DROP TABLE IF EXISTS `gpg_key`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `gpg_key` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `owner_id` bigint NOT NULL,
  `key_id` char(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `primary_key_id` char(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `content` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `created_unix` bigint DEFAULT NULL,
  `expired_unix` bigint DEFAULT NULL,
  `added_unix` bigint DEFAULT NULL,
  `emails` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `verified` tinyint(1) NOT NULL DEFAULT '0',
  `can_sign` tinyint(1) DEFAULT NULL,
  `can_encrypt_comms` tinyint(1) DEFAULT NULL,
  `can_encrypt_storage` tinyint(1) DEFAULT NULL,
  `can_certify` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_gpg_key_owner_id` (`owner_id`),
  KEY `IDX_gpg_key_key_id` (`key_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `gpg_key_import`
--

DROP TABLE IF EXISTS `gpg_key_import`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `gpg_key_import` (
  `key_id` char(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `content` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  PRIMARY KEY (`key_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `hook_task`
--

DROP TABLE IF EXISTS `hook_task`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `hook_task` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `hook_id` bigint DEFAULT NULL,
  `uuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `payload_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `payload_version` int DEFAULT '1',
  `event_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `is_delivered` tinyint(1) DEFAULT NULL,
  `delivered` bigint DEFAULT NULL,
  `is_succeed` tinyint(1) DEFAULT NULL,
  `request_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `response_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_hook_task_uuid` (`uuid`),
  KEY `IDX_hook_task_hook_id` (`hook_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 121 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `issue`
--

DROP TABLE IF EXISTS `issue`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `issue` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `index` bigint DEFAULT NULL,
  `poster_id` bigint DEFAULT NULL,
  `original_author` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `original_author_id` bigint DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `content_version` int NOT NULL DEFAULT '0',
  `milestone_id` bigint DEFAULT NULL,
  `priority` int DEFAULT NULL,
  `is_closed` tinyint(1) DEFAULT NULL,
  `is_pull` tinyint(1) DEFAULT NULL,
  `num_comments` int DEFAULT NULL,
  `ref` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `deadline_unix` bigint DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  `closed_unix` bigint DEFAULT NULL,
  `is_locked` tinyint(1) NOT NULL DEFAULT '0',
  `time_estimate` bigint NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_issue_repo_index` (`repo_id`, `index`),
  KEY `IDX_issue_updated_unix` (`updated_unix`),
  KEY `IDX_issue_created_unix` (`created_unix`),
  KEY `IDX_issue_closed_unix` (`closed_unix`),
  KEY `IDX_issue_repo_id` (`repo_id`),
  KEY `IDX_issue_poster_id` (`poster_id`),
  KEY `IDX_issue_original_author_id` (`original_author_id`),
  KEY `IDX_issue_milestone_id` (`milestone_id`),
  KEY `IDX_issue_is_closed` (`is_closed`),
  KEY `IDX_issue_is_pull` (`is_pull`),
  KEY `IDX_issue_deadline_unix` (`deadline_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `issue_assignees`
--

DROP TABLE IF EXISTS `issue_assignees`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `issue_assignees` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `assignee_id` bigint DEFAULT NULL,
  `issue_id` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_issue_assignees_assignee_id` (`assignee_id`),
  KEY `IDX_issue_assignees_issue_id` (`issue_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `issue_content_history`
--

DROP TABLE IF EXISTS `issue_content_history`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `issue_content_history` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `poster_id` bigint DEFAULT NULL,
  `issue_id` bigint DEFAULT NULL,
  `comment_id` bigint DEFAULT NULL,
  `edited_unix` bigint DEFAULT NULL,
  `content_text` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `is_first_created` tinyint(1) DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_issue_content_history_issue_id` (`issue_id`),
  KEY `IDX_issue_content_history_comment_id` (`comment_id`),
  KEY `IDX_issue_content_history_edited_unix` (`edited_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `issue_dependency`
--

DROP TABLE IF EXISTS `issue_dependency`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `issue_dependency` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint NOT NULL,
  `issue_id` bigint NOT NULL,
  `dependency_id` bigint NOT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_issue_dependency_issue_dependency` (`issue_id`, `dependency_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `issue_index`
--

DROP TABLE IF EXISTS `issue_index`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `issue_index` (
  `group_id` bigint NOT NULL,
  `max_index` bigint DEFAULT NULL,
  PRIMARY KEY (`group_id`),
  KEY `IDX_issue_index_max_index` (`max_index`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `issue_label`
--

DROP TABLE IF EXISTS `issue_label`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `issue_label` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `issue_id` bigint DEFAULT NULL,
  `label_id` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_issue_label_s` (`issue_id`, `label_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `issue_pin`
--

DROP TABLE IF EXISTS `issue_pin`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `issue_pin` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint NOT NULL,
  `issue_id` bigint NOT NULL,
  `is_pull` tinyint(1) NOT NULL,
  `pin_order` int DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_issue_pin_s` (`repo_id`, `issue_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `issue_user`
--

DROP TABLE IF EXISTS `issue_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `issue_user` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `uid` bigint DEFAULT NULL,
  `issue_id` bigint DEFAULT NULL,
  `is_read` tinyint(1) DEFAULT NULL,
  `is_mentioned` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_issue_user_uid_to_issue` (`uid`, `issue_id`),
  KEY `IDX_issue_user_issue_id` (`issue_id`),
  KEY `IDX_issue_user_uid` (`uid`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `issue_watch`
--

DROP TABLE IF EXISTS `issue_watch`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `issue_watch` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint NOT NULL,
  `issue_id` bigint NOT NULL,
  `is_watching` tinyint(1) NOT NULL,
  `created_unix` bigint NOT NULL,
  `updated_unix` bigint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_issue_watch_watch` (`user_id`, `issue_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `label`
--

DROP TABLE IF EXISTS `label`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `label` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `org_id` bigint DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `exclusive` tinyint(1) DEFAULT NULL,
  `exclusive_order` int DEFAULT '0',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `color` varchar(7) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `num_issues` int DEFAULT NULL,
  `num_closed_issues` int DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  `archived_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_label_repo_id` (`repo_id`),
  KEY `IDX_label_org_id` (`org_id`),
  KEY `IDX_label_created_unix` (`created_unix`),
  KEY `IDX_label_updated_unix` (`updated_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `language_stat`
--

DROP TABLE IF EXISTS `language_stat`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `language_stat` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint NOT NULL,
  `commit_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `is_primary` tinyint(1) DEFAULT NULL,
  `language` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `size` bigint NOT NULL DEFAULT '0',
  `created_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_language_stat_s` (`repo_id`, `language`),
  KEY `IDX_language_stat_repo_id` (`repo_id`),
  KEY `IDX_language_stat_language` (`language`),
  KEY `IDX_language_stat_created_unix` (`created_unix`)
) ENGINE = InnoDB AUTO_INCREMENT = 13 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `lfs_lock`
--

DROP TABLE IF EXISTS `lfs_lock`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `lfs_lock` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint NOT NULL,
  `owner_id` bigint NOT NULL,
  `path` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `created` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_lfs_lock_repo_id` (`repo_id`),
  KEY `IDX_lfs_lock_owner_id` (`owner_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `lfs_meta_object`
--

DROP TABLE IF EXISTS `lfs_meta_object`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `lfs_meta_object` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `oid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `size` bigint NOT NULL,
  `repository_id` bigint NOT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_lfs_meta_object_s` (`oid`, `repository_id`),
  KEY `IDX_lfs_meta_object_repository_id` (`repository_id`),
  KEY `IDX_lfs_meta_object_updated_unix` (`updated_unix`),
  KEY `IDX_lfs_meta_object_oid` (`oid`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `login_source`
--

DROP TABLE IF EXISTS `login_source`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `login_source` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `type` int DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '0',
  `is_sync_enabled` tinyint(1) NOT NULL DEFAULT '0',
  `two_factor_policy` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL DEFAULT '',
  `cfg` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_login_source_name` (`name`),
  KEY `IDX_login_source_updated_unix` (`updated_unix`),
  KEY `IDX_login_source_is_active` (`is_active`),
  KEY `IDX_login_source_is_sync_enabled` (`is_sync_enabled`),
  KEY `IDX_login_source_created_unix` (`created_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `milestone`
--

DROP TABLE IF EXISTS `milestone`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `milestone` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `is_closed` tinyint(1) DEFAULT NULL,
  `num_issues` int DEFAULT NULL,
  `num_closed_issues` int DEFAULT NULL,
  `completeness` int DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  `deadline_unix` bigint DEFAULT NULL,
  `closed_date_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_milestone_created_unix` (`created_unix`),
  KEY `IDX_milestone_updated_unix` (`updated_unix`),
  KEY `IDX_milestone_repo_id` (`repo_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `mirror`
--

DROP TABLE IF EXISTS `mirror`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `mirror` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `interval` bigint DEFAULT NULL,
  `enable_prune` tinyint(1) NOT NULL DEFAULT '1',
  `updated_unix` bigint DEFAULT NULL,
  `next_update_unix` bigint DEFAULT NULL,
  `lfs_enabled` tinyint(1) NOT NULL DEFAULT '0',
  `lfs_endpoint` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `remote_address` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_mirror_repo_id` (`repo_id`),
  KEY `IDX_mirror_updated_unix` (`updated_unix`),
  KEY `IDX_mirror_next_update_unix` (`next_update_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `notice`
--

DROP TABLE IF EXISTS `notice`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `notice` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `type` int DEFAULT NULL,
  `description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `created_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_notice_created_unix` (`created_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `notification`
--

DROP TABLE IF EXISTS `notification`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `notification` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint NOT NULL,
  `repo_id` bigint NOT NULL,
  `status` smallint NOT NULL,
  `source` smallint NOT NULL,
  `issue_id` bigint NOT NULL,
  `commit_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `comment_id` bigint DEFAULT NULL,
  `updated_by` bigint NOT NULL,
  `created_unix` bigint NOT NULL,
  `updated_unix` bigint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_notification_idx_notification_status` (`status`),
  KEY `IDX_notification_idx_notification_source` (`source`),
  KEY `IDX_notification_idx_notification_issue_id` (`issue_id`),
  KEY `IDX_notification_idx_notification_commit_id` (`commit_id`),
  KEY `IDX_notification_idx_notification_updated_by` (`updated_by`),
  KEY `IDX_notification_u_s_uu` (`user_id`, `status`, `updated_unix`),
  KEY `IDX_notification_idx_notification_user_id` (`user_id`),
  KEY `IDX_notification_idx_notification_repo_id` (`repo_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `oauth2_application`
--

DROP TABLE IF EXISTS `oauth2_application`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `oauth2_application` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `uid` bigint DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `client_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `client_secret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `confidential_client` tinyint(1) NOT NULL DEFAULT '1',
  `skip_secondary_authorization` tinyint(1) NOT NULL DEFAULT '0',
  `redirect_uris` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_oauth2_application_client_id` (`client_id`),
  KEY `IDX_oauth2_application_uid` (`uid`),
  KEY `IDX_oauth2_application_created_unix` (`created_unix`),
  KEY `IDX_oauth2_application_updated_unix` (`updated_unix`)
) ENGINE = InnoDB AUTO_INCREMENT = 4 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `oauth2_authorization_code`
--

DROP TABLE IF EXISTS `oauth2_authorization_code`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `oauth2_authorization_code` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `grant_id` bigint DEFAULT NULL,
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `code_challenge` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `code_challenge_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `redirect_uri` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `valid_until` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_oauth2_authorization_code_code` (`code`),
  KEY `IDX_oauth2_authorization_code_valid_until` (`valid_until`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `oauth2_grant`
--

DROP TABLE IF EXISTS `oauth2_grant`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `oauth2_grant` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint DEFAULT NULL,
  `application_id` bigint DEFAULT NULL,
  `counter` bigint NOT NULL DEFAULT '1',
  `scope` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `nonce` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_oauth2_grant_user_application` (`user_id`, `application_id`),
  KEY `IDX_oauth2_grant_application_id` (`application_id`),
  KEY `IDX_oauth2_grant_user_id` (`user_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `org_user`
--

DROP TABLE IF EXISTS `org_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `org_user` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `uid` bigint DEFAULT NULL,
  `org_id` bigint DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_org_user_s` (`uid`, `org_id`),
  KEY `IDX_org_user_uid` (`uid`),
  KEY `IDX_org_user_org_id` (`org_id`),
  KEY `IDX_org_user_is_public` (`is_public`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `package`
--

DROP TABLE IF EXISTS `package`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `package` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `owner_id` bigint NOT NULL,
  `repo_id` bigint DEFAULT NULL,
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `lower_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `semver_compatible` tinyint(1) NOT NULL DEFAULT '0',
  `is_internal` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_package_s` (`owner_id`, `type`, `lower_name`),
  KEY `IDX_package_repo_id` (`repo_id`),
  KEY `IDX_package_type` (`type`),
  KEY `IDX_package_lower_name` (`lower_name`),
  KEY `IDX_package_owner_id` (`owner_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `package_blob`
--

DROP TABLE IF EXISTS `package_blob`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `package_blob` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `size` bigint NOT NULL DEFAULT '0',
  `hash_md5` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `hash_sha1` char(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `hash_sha256` char(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `hash_sha512` char(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `created_unix` bigint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_package_blob_md5` (`hash_md5`),
  UNIQUE KEY `UQE_package_blob_sha256` (`hash_sha256`),
  UNIQUE KEY `UQE_package_blob_sha512` (`hash_sha512`),
  UNIQUE KEY `UQE_package_blob_sha1` (`hash_sha1`),
  KEY `IDX_package_blob_hash_md5` (`hash_md5`),
  KEY `IDX_package_blob_hash_sha1` (`hash_sha1`),
  KEY `IDX_package_blob_hash_sha256` (`hash_sha256`),
  KEY `IDX_package_blob_hash_sha512` (`hash_sha512`),
  KEY `IDX_package_blob_created_unix` (`created_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `package_blob_upload`
--

DROP TABLE IF EXISTS `package_blob_upload`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `package_blob_upload` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `bytes_received` bigint NOT NULL DEFAULT '0',
  `hash_state_bytes` blob,
  `created_unix` bigint NOT NULL,
  `updated_unix` bigint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_package_blob_upload_updated_unix` (`updated_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `package_cleanup_rule`
--

DROP TABLE IF EXISTS `package_cleanup_rule`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `package_cleanup_rule` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `enabled` tinyint(1) NOT NULL DEFAULT '0',
  `owner_id` bigint NOT NULL DEFAULT '0',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `keep_count` int NOT NULL DEFAULT '0',
  `keep_pattern` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL DEFAULT '',
  `remove_days` int NOT NULL DEFAULT '0',
  `remove_pattern` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL DEFAULT '',
  `match_full_name` tinyint(1) NOT NULL DEFAULT '0',
  `created_unix` bigint NOT NULL DEFAULT '0',
  `updated_unix` bigint NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_package_cleanup_rule_s` (`owner_id`, `type`),
  KEY `IDX_package_cleanup_rule_owner_id` (`owner_id`),
  KEY `IDX_package_cleanup_rule_type` (`type`),
  KEY `IDX_package_cleanup_rule_enabled` (`enabled`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `package_file`
--

DROP TABLE IF EXISTS `package_file`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `package_file` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `version_id` bigint NOT NULL,
  `blob_id` bigint NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `lower_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `composite_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `is_lead` tinyint(1) NOT NULL DEFAULT '0',
  `created_unix` bigint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_package_file_s` (`version_id`, `lower_name`, `composite_key`),
  KEY `IDX_package_file_created_unix` (`created_unix`),
  KEY `IDX_package_file_version_id` (`version_id`),
  KEY `IDX_package_file_blob_id` (`blob_id`),
  KEY `IDX_package_file_lower_name` (`lower_name`),
  KEY `IDX_package_file_composite_key` (`composite_key`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `package_property`
--

DROP TABLE IF EXISTS `package_property`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `package_property` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `ref_type` bigint NOT NULL,
  `ref_id` bigint NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_package_property_ref_type` (`ref_type`),
  KEY `IDX_package_property_ref_id` (`ref_id`),
  KEY `IDX_package_property_name` (`name`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `package_version`
--

DROP TABLE IF EXISTS `package_version`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `package_version` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `package_id` bigint NOT NULL,
  `creator_id` bigint NOT NULL DEFAULT '0',
  `version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `lower_version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `created_unix` bigint NOT NULL,
  `is_internal` tinyint(1) NOT NULL DEFAULT '0',
  `metadata_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `download_count` bigint NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_package_version_s` (`package_id`, `lower_version`),
  KEY `IDX_package_version_created_unix` (`created_unix`),
  KEY `IDX_package_version_is_internal` (`is_internal`),
  KEY `IDX_package_version_package_id` (`package_id`),
  KEY `IDX_package_version_lower_version` (`lower_version`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `project`
--

DROP TABLE IF EXISTS `project`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `project` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `owner_id` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `creator_id` bigint NOT NULL,
  `is_closed` tinyint(1) DEFAULT NULL,
  `board_type` int unsigned DEFAULT NULL,
  `card_type` int unsigned DEFAULT NULL,
  `type` int unsigned DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  `closed_date_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_project_created_unix` (`created_unix`),
  KEY `IDX_project_updated_unix` (`updated_unix`),
  KEY `IDX_project_title` (`title`),
  KEY `IDX_project_owner_id` (`owner_id`),
  KEY `IDX_project_repo_id` (`repo_id`),
  KEY `IDX_project_is_closed` (`is_closed`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `project_board`
--

DROP TABLE IF EXISTS `project_board`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `project_board` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `default` tinyint(1) NOT NULL DEFAULT '0',
  `sorting` int NOT NULL DEFAULT '0',
  `color` varchar(7) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `project_id` bigint NOT NULL,
  `creator_id` bigint NOT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_project_board_project_id` (`project_id`),
  KEY `IDX_project_board_created_unix` (`created_unix`),
  KEY `IDX_project_board_updated_unix` (`updated_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `project_issue`
--

DROP TABLE IF EXISTS `project_issue`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `project_issue` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `issue_id` bigint DEFAULT NULL,
  `project_id` bigint DEFAULT NULL,
  `project_board_id` bigint DEFAULT NULL,
  `sorting` bigint NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `IDX_project_issue_issue_id` (`issue_id`),
  KEY `IDX_project_issue_project_id` (`project_id`),
  KEY `IDX_project_issue_project_board_id` (`project_board_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `protected_branch`
--

DROP TABLE IF EXISTS `protected_branch`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `protected_branch` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `branch_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `priority` bigint NOT NULL DEFAULT '0',
  `can_push` tinyint(1) NOT NULL DEFAULT '0',
  `enable_whitelist` tinyint(1) DEFAULT NULL,
  `whitelist_user_i_ds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `whitelist_team_i_ds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `enable_merge_whitelist` tinyint(1) NOT NULL DEFAULT '0',
  `whitelist_deploy_keys` tinyint(1) NOT NULL DEFAULT '0',
  `merge_whitelist_user_i_ds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `merge_whitelist_team_i_ds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `can_force_push` tinyint(1) NOT NULL DEFAULT '0',
  `enable_force_push_allowlist` tinyint(1) NOT NULL DEFAULT '0',
  `force_push_allowlist_user_i_ds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `force_push_allowlist_team_i_ds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `force_push_allowlist_deploy_keys` tinyint(1) NOT NULL DEFAULT '0',
  `enable_status_check` tinyint(1) NOT NULL DEFAULT '0',
  `status_check_contexts` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `enable_approvals_whitelist` tinyint(1) NOT NULL DEFAULT '0',
  `approvals_whitelist_user_i_ds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `approvals_whitelist_team_i_ds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `required_approvals` bigint NOT NULL DEFAULT '0',
  `block_on_rejected_reviews` tinyint(1) NOT NULL DEFAULT '0',
  `block_on_official_review_requests` tinyint(1) NOT NULL DEFAULT '0',
  `block_on_outdated_branch` tinyint(1) NOT NULL DEFAULT '0',
  `dismiss_stale_approvals` tinyint(1) NOT NULL DEFAULT '0',
  `ignore_stale_approvals` tinyint(1) NOT NULL DEFAULT '0',
  `require_signed_commits` tinyint(1) NOT NULL DEFAULT '0',
  `protected_file_patterns` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `unprotected_file_patterns` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `block_admin_merge_override` tinyint(1) NOT NULL DEFAULT '0',
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_protected_branch_s` (`repo_id`, `branch_name`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `protected_tag`
--

DROP TABLE IF EXISTS `protected_tag`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `protected_tag` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `name_pattern` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `allowlist_user_i_ds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `allowlist_team_i_ds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `public_key`
--

DROP TABLE IF EXISTS `public_key`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `public_key` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `owner_id` bigint NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `fingerprint` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `content` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `mode` int NOT NULL DEFAULT '2',
  `type` int NOT NULL DEFAULT '1',
  `login_source_id` bigint NOT NULL DEFAULT '0',
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  `verified` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `IDX_public_key_owner_id` (`owner_id`),
  KEY `IDX_public_key_fingerprint` (`fingerprint`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `pull_auto_merge`
--

DROP TABLE IF EXISTS `pull_auto_merge`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `pull_auto_merge` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `pull_id` bigint DEFAULT NULL,
  `doer_id` bigint NOT NULL,
  `merge_style` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `message` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `delete_branch_after_merge` tinyint(1) DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_pull_auto_merge_pull_id` (`pull_id`),
  KEY `IDX_pull_auto_merge_doer_id` (`doer_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `pull_request`
--

DROP TABLE IF EXISTS `pull_request`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `pull_request` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `type` int DEFAULT NULL,
  `status` int DEFAULT NULL,
  `conflicted_files` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `commits_ahead` int DEFAULT NULL,
  `commits_behind` int DEFAULT NULL,
  `changed_protected_files` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `issue_id` bigint DEFAULT NULL,
  `index` bigint DEFAULT NULL,
  `head_repo_id` bigint DEFAULT NULL,
  `base_repo_id` bigint DEFAULT NULL,
  `head_branch` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `base_branch` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `merge_base` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `allow_maintainer_edit` tinyint(1) NOT NULL DEFAULT '0',
  `has_merged` tinyint(1) DEFAULT NULL,
  `merged_commit_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `merger_id` bigint DEFAULT NULL,
  `merged_unix` bigint DEFAULT NULL,
  `flow` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `IDX_pull_request_merger_id` (`merger_id`),
  KEY `IDX_pull_request_merged_unix` (`merged_unix`),
  KEY `IDX_pull_request_issue_id` (`issue_id`),
  KEY `IDX_pull_request_head_repo_id` (`head_repo_id`),
  KEY `IDX_pull_request_base_repo_id` (`base_repo_id`),
  KEY `IDX_pull_request_has_merged` (`has_merged`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `push_mirror`
--

DROP TABLE IF EXISTS `push_mirror`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `push_mirror` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `remote_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `remote_address` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `sync_on_commit` tinyint(1) NOT NULL DEFAULT '1',
  `interval` bigint DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `last_update` bigint DEFAULT NULL,
  `last_error` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  PRIMARY KEY (`id`),
  KEY `IDX_push_mirror_repo_id` (`repo_id`),
  KEY `IDX_push_mirror_last_update` (`last_update`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `reaction`
--

DROP TABLE IF EXISTS `reaction`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `reaction` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `issue_id` bigint NOT NULL,
  `comment_id` bigint DEFAULT NULL,
  `user_id` bigint NOT NULL,
  `original_author_id` bigint NOT NULL DEFAULT '0',
  `original_author` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_reaction_s` (
    `type`,
    `issue_id`,
    `comment_id`,
    `user_id`,
    `original_author_id`,
    `original_author`
  ),
  KEY `IDX_reaction_user_id` (`user_id`),
  KEY `IDX_reaction_original_author_id` (`original_author_id`),
  KEY `IDX_reaction_original_author` (`original_author`),
  KEY `IDX_reaction_created_unix` (`created_unix`),
  KEY `IDX_reaction_type` (`type`),
  KEY `IDX_reaction_issue_id` (`issue_id`),
  KEY `IDX_reaction_comment_id` (`comment_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `release`
--

DROP TABLE IF EXISTS `release`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `release` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `publisher_id` bigint DEFAULT NULL,
  `tag_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `original_author` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `original_author_id` bigint DEFAULT NULL,
  `lower_tag_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `target` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `sha1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `num_commits` bigint DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `is_draft` tinyint(1) NOT NULL DEFAULT '0',
  `is_prerelease` tinyint(1) NOT NULL DEFAULT '0',
  `is_tag` tinyint(1) NOT NULL DEFAULT '0',
  `created_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_release_n` (`repo_id`, `tag_name`),
  KEY `IDX_release_tag_name` (`tag_name`),
  KEY `IDX_release_original_author_id` (`original_author_id`),
  KEY `IDX_release_sha1` (`sha1`),
  KEY `IDX_release_created_unix` (`created_unix`),
  KEY `IDX_release_repo_id` (`repo_id`),
  KEY `IDX_release_publisher_id` (`publisher_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `renamed_branch`
--

DROP TABLE IF EXISTS `renamed_branch`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `renamed_branch` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint NOT NULL,
  `from` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `to` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_renamed_branch_repo_id` (`repo_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `repo_archiver`
--

DROP TABLE IF EXISTS `repo_archiver`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `repo_archiver` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `type` int DEFAULT NULL,
  `status` int DEFAULT NULL,
  `commit_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `created_unix` bigint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_repo_archiver_s` (`repo_id`, `type`, `commit_id`),
  KEY `IDX_repo_archiver_repo_id` (`repo_id`),
  KEY `IDX_repo_archiver_created_unix` (`created_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `repo_indexer_status`
--

DROP TABLE IF EXISTS `repo_indexer_status`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `repo_indexer_status` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `commit_sha` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `indexer_type` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `IDX_repo_indexer_status_s` (`repo_id`, `indexer_type`)
) ENGINE = InnoDB AUTO_INCREMENT = 3 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `repo_license`
--

DROP TABLE IF EXISTS `repo_license`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `repo_license` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint NOT NULL,
  `commit_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `license` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_repo_license_s` (`repo_id`, `license`),
  KEY `IDX_repo_license_created_unix` (`created_unix`),
  KEY `IDX_repo_license_updated_unix` (`updated_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `repo_redirect`
--

DROP TABLE IF EXISTS `repo_redirect`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `repo_redirect` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `owner_id` bigint DEFAULT NULL,
  `lower_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `redirect_repo_id` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_repo_redirect_s` (`owner_id`, `lower_name`),
  KEY `IDX_repo_redirect_lower_name` (`lower_name`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `repo_topic`
--

DROP TABLE IF EXISTS `repo_topic`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `repo_topic` (
  `repo_id` bigint NOT NULL,
  `topic_id` bigint NOT NULL,
  PRIMARY KEY (`repo_id`, `topic_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `repo_transfer`
--

DROP TABLE IF EXISTS `repo_transfer`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `repo_transfer` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `doer_id` bigint DEFAULT NULL,
  `recipient_id` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `team_i_ds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `created_unix` bigint NOT NULL,
  `updated_unix` bigint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_repo_transfer_created_unix` (`created_unix`),
  KEY `IDX_repo_transfer_updated_unix` (`updated_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `repo_unit`
--

DROP TABLE IF EXISTS `repo_unit`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `repo_unit` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `type` int DEFAULT NULL,
  `config` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `created_unix` bigint DEFAULT NULL,
  `anonymous_access_mode` int NOT NULL DEFAULT '0',
  `everyone_access_mode` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `IDX_repo_unit_s` (`repo_id`, `type`),
  KEY `IDX_repo_unit_created_unix` (`created_unix`)
) ENGINE = InnoDB AUTO_INCREMENT = 17 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `repository`
--

DROP TABLE IF EXISTS `repository`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `repository` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `owner_id` bigint DEFAULT NULL,
  `owner_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `lower_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `website` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `original_service_type` int DEFAULT NULL,
  `original_url` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `default_branch` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `default_wiki_branch` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `num_watches` int DEFAULT NULL,
  `num_stars` int DEFAULT NULL,
  `num_forks` int DEFAULT NULL,
  `num_issues` int DEFAULT NULL,
  `num_closed_issues` int DEFAULT NULL,
  `num_pulls` int DEFAULT NULL,
  `num_closed_pulls` int DEFAULT NULL,
  `num_milestones` int NOT NULL DEFAULT '0',
  `num_closed_milestones` int NOT NULL DEFAULT '0',
  `num_projects` int NOT NULL DEFAULT '0',
  `num_closed_projects` int NOT NULL DEFAULT '0',
  `num_action_runs` int NOT NULL DEFAULT '0',
  `num_closed_action_runs` int NOT NULL DEFAULT '0',
  `is_private` tinyint(1) DEFAULT NULL,
  `is_empty` tinyint(1) DEFAULT NULL,
  `is_archived` tinyint(1) DEFAULT NULL,
  `is_mirror` tinyint(1) DEFAULT NULL,
  `status` int NOT NULL DEFAULT '0',
  `is_fork` tinyint(1) NOT NULL DEFAULT '0',
  `fork_id` bigint DEFAULT NULL,
  `is_template` tinyint(1) NOT NULL DEFAULT '0',
  `template_id` bigint DEFAULT NULL,
  `size` bigint NOT NULL DEFAULT '0',
  `git_size` bigint NOT NULL DEFAULT '0',
  `lfs_size` bigint NOT NULL DEFAULT '0',
  `is_fsck_enabled` tinyint(1) NOT NULL DEFAULT '1',
  `close_issues_via_commit_in_any_branch` tinyint(1) NOT NULL DEFAULT '0',
  `topics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `object_format_name` varchar(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL DEFAULT 'sha1',
  `trust_model` int DEFAULT NULL,
  `avatar` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  `archived_unix` bigint DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_repository_s` (`owner_id`, `lower_name`),
  KEY `IDX_repository_is_empty` (`is_empty`),
  KEY `IDX_repository_created_unix` (`created_unix`),
  KEY `IDX_repository_owner_id` (`owner_id`),
  KEY `IDX_repository_is_fork` (`is_fork`),
  KEY `IDX_repository_template_id` (`template_id`),
  KEY `IDX_repository_name` (`name`),
  KEY `IDX_repository_is_private` (`is_private`),
  KEY `IDX_repository_is_template` (`is_template`),
  KEY `IDX_repository_updated_unix` (`updated_unix`),
  KEY `IDX_repository_is_archived` (`is_archived`),
  KEY `IDX_repository_is_mirror` (`is_mirror`),
  KEY `IDX_repository_fork_id` (`fork_id`),
  KEY `IDX_repository_lower_name` (`lower_name`),
  KEY `IDX_repository_original_service_type` (`original_service_type`)
) ENGINE = InnoDB AUTO_INCREMENT = 3 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `review`
--

DROP TABLE IF EXISTS `review`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `review` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `type` int DEFAULT NULL,
  `reviewer_id` bigint DEFAULT NULL,
  `reviewer_team_id` bigint NOT NULL DEFAULT '0',
  `original_author` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `original_author_id` bigint DEFAULT NULL,
  `issue_id` bigint DEFAULT NULL,
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `official` tinyint(1) NOT NULL DEFAULT '0',
  `commit_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `stale` tinyint(1) NOT NULL DEFAULT '0',
  `dismissed` tinyint(1) NOT NULL DEFAULT '0',
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_review_issue_id` (`issue_id`),
  KEY `IDX_review_created_unix` (`created_unix`),
  KEY `IDX_review_updated_unix` (`updated_unix`),
  KEY `IDX_review_reviewer_id` (`reviewer_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `review_state`
--

DROP TABLE IF EXISTS `review_state`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `review_state` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint NOT NULL,
  `pull_id` bigint NOT NULL DEFAULT '0',
  `commit_sha` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `updated_files` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_review_state_pull_commit_user` (`user_id`, `pull_id`, `commit_sha`),
  KEY `IDX_review_state_pull_id` (`pull_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `secret`
--

DROP TABLE IF EXISTS `secret`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `secret` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `owner_id` bigint NOT NULL,
  `repo_id` bigint NOT NULL DEFAULT '0',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `created_unix` bigint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_secret_owner_repo_name` (`owner_id`, `repo_id`, `name`),
  KEY `IDX_secret_owner_id` (`owner_id`),
  KEY `IDX_secret_repo_id` (`repo_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `session`
--

DROP TABLE IF EXISTS `session`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `session` (
  `key` char(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `data` blob,
  `expiry` bigint DEFAULT NULL,
  PRIMARY KEY (`key`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `star`
--

DROP TABLE IF EXISTS `star`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `star` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `uid` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_star_s` (`uid`, `repo_id`),
  KEY `IDX_star_created_unix` (`created_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `stopwatch`
--

DROP TABLE IF EXISTS `stopwatch`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `stopwatch` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `issue_id` bigint DEFAULT NULL,
  `user_id` bigint DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_stopwatch_issue_id` (`issue_id`),
  KEY `IDX_stopwatch_user_id` (`user_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `system_setting`
--

DROP TABLE IF EXISTS `system_setting`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `system_setting` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `setting_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `setting_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `version` int DEFAULT NULL,
  `created` bigint DEFAULT NULL,
  `updated` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_system_setting_setting_key` (`setting_key`)
) ENGINE = InnoDB AUTO_INCREMENT = 4 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `task`
--

DROP TABLE IF EXISTS `task`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `task` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `doer_id` bigint DEFAULT NULL,
  `owner_id` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `type` int DEFAULT NULL,
  `status` int DEFAULT NULL,
  `start_time` bigint DEFAULT NULL,
  `end_time` bigint DEFAULT NULL,
  `payload_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `created` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_task_doer_id` (`doer_id`),
  KEY `IDX_task_owner_id` (`owner_id`),
  KEY `IDX_task_repo_id` (`repo_id`),
  KEY `IDX_task_status` (`status`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `team`
--

DROP TABLE IF EXISTS `team`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `team` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `org_id` bigint DEFAULT NULL,
  `lower_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `authorize` int DEFAULT NULL,
  `num_repos` int DEFAULT NULL,
  `num_members` int DEFAULT NULL,
  `includes_all_repositories` tinyint(1) NOT NULL DEFAULT '0',
  `can_create_org_repo` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `IDX_team_org_id` (`org_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `team_invite`
--

DROP TABLE IF EXISTS `team_invite`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `team_invite` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL DEFAULT '',
  `inviter_id` bigint NOT NULL DEFAULT '0',
  `org_id` bigint NOT NULL DEFAULT '0',
  `team_id` bigint NOT NULL DEFAULT '0',
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL DEFAULT '',
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_team_invite_team_mail` (`team_id`, `email`),
  KEY `IDX_team_invite_token` (`token`),
  KEY `IDX_team_invite_org_id` (`org_id`),
  KEY `IDX_team_invite_team_id` (`team_id`),
  KEY `IDX_team_invite_created_unix` (`created_unix`),
  KEY `IDX_team_invite_updated_unix` (`updated_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `team_repo`
--

DROP TABLE IF EXISTS `team_repo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `team_repo` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `org_id` bigint DEFAULT NULL,
  `team_id` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_team_repo_s` (`team_id`, `repo_id`),
  KEY `IDX_team_repo_org_id` (`org_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `team_unit`
--

DROP TABLE IF EXISTS `team_unit`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `team_unit` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `org_id` bigint DEFAULT NULL,
  `team_id` bigint DEFAULT NULL,
  `type` int DEFAULT NULL,
  `access_mode` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_team_unit_s` (`team_id`, `type`),
  KEY `IDX_team_unit_org_id` (`org_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `team_user`
--

DROP TABLE IF EXISTS `team_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `team_user` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `org_id` bigint DEFAULT NULL,
  `team_id` bigint DEFAULT NULL,
  `uid` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_team_user_s` (`team_id`, `uid`),
  KEY `IDX_team_user_org_id` (`org_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `topic`
--

DROP TABLE IF EXISTS `topic`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `topic` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `repo_count` int DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_topic_name` (`name`),
  KEY `IDX_topic_created_unix` (`created_unix`),
  KEY `IDX_topic_updated_unix` (`updated_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `tracked_time`
--

DROP TABLE IF EXISTS `tracked_time`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `tracked_time` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `issue_id` bigint DEFAULT NULL,
  `user_id` bigint DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `time` bigint NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `IDX_tracked_time_issue_id` (`issue_id`),
  KEY `IDX_tracked_time_user_id` (`user_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `two_factor`
--

DROP TABLE IF EXISTS `two_factor`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `two_factor` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `uid` bigint DEFAULT NULL,
  `secret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `scratch_salt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `scratch_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `last_used_passcode` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_two_factor_uid` (`uid`),
  KEY `IDX_two_factor_updated_unix` (`updated_unix`),
  KEY `IDX_two_factor_created_unix` (`created_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `upload`
--

DROP TABLE IF EXISTS `upload`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `upload` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `uuid` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_upload_uuid` (`uuid`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `user`
--

DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `user` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `lower_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `full_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `keep_email_private` tinyint(1) DEFAULT NULL,
  `email_notifications_preference` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL DEFAULT 'enabled',
  `passwd` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `passwd_hash_algo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL DEFAULT 'argon2',
  `must_change_password` tinyint(1) NOT NULL DEFAULT '0',
  `login_type` int DEFAULT NULL,
  `login_source` bigint NOT NULL DEFAULT '0',
  `login_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `type` int DEFAULT NULL,
  `location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `website` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `rands` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `salt` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `language` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  `last_login_unix` bigint DEFAULT NULL,
  `last_repo_visibility` tinyint(1) DEFAULT NULL,
  `max_repo_creation` int NOT NULL DEFAULT '-1',
  `is_active` tinyint(1) DEFAULT NULL,
  `is_admin` tinyint(1) DEFAULT NULL,
  `is_restricted` tinyint(1) NOT NULL DEFAULT '0',
  `allow_git_hook` tinyint(1) DEFAULT NULL,
  `allow_import_local` tinyint(1) DEFAULT NULL,
  `allow_create_organization` tinyint(1) DEFAULT '1',
  `prohibit_login` tinyint(1) NOT NULL DEFAULT '0',
  `avatar` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `avatar_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `use_custom_avatar` tinyint(1) DEFAULT NULL,
  `num_followers` int DEFAULT NULL,
  `num_following` int NOT NULL DEFAULT '0',
  `num_stars` int DEFAULT NULL,
  `num_repos` int DEFAULT NULL,
  `num_teams` int DEFAULT NULL,
  `num_members` int DEFAULT NULL,
  `visibility` int NOT NULL DEFAULT '0',
  `repo_admin_change_team_access` tinyint(1) NOT NULL DEFAULT '0',
  `diff_view_style` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL DEFAULT '',
  `theme` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL DEFAULT '',
  `keep_activity_private` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_user_lower_name` (`lower_name`),
  UNIQUE KEY `UQE_user_name` (`name`),
  KEY `IDX_user_created_unix` (`created_unix`),
  KEY `IDX_user_updated_unix` (`updated_unix`),
  KEY `IDX_user_last_login_unix` (`last_login_unix`),
  KEY `IDX_user_is_active` (`is_active`)
) ENGINE = InnoDB AUTO_INCREMENT = 3 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `user_badge`
--

DROP TABLE IF EXISTS `user_badge`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `user_badge` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `badge_id` bigint DEFAULT NULL,
  `user_id` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_user_badge_user_id` (`user_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `user_blocking`
--

DROP TABLE IF EXISTS `user_blocking`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `user_blocking` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `blocker_id` bigint DEFAULT NULL,
  `blockee_id` bigint DEFAULT NULL,
  `note` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_user_blocking_block` (`blocker_id`, `blockee_id`),
  KEY `IDX_user_blocking_created_unix` (`created_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `user_open_id`
--

DROP TABLE IF EXISTS `user_open_id`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `user_open_id` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `uid` bigint NOT NULL,
  `uri` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `show` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_user_open_id_uri` (`uri`),
  KEY `IDX_user_open_id_uid` (`uid`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `user_redirect`
--

DROP TABLE IF EXISTS `user_redirect`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `user_redirect` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `lower_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL,
  `redirect_user_id` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_user_redirect_s` (`lower_name`),
  KEY `IDX_user_redirect_lower_name` (`lower_name`)
) ENGINE = InnoDB AUTO_INCREMENT = 2 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `user_setting`
--

DROP TABLE IF EXISTS `user_setting`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `user_setting` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint DEFAULT NULL,
  `setting_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `setting_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_user_setting_key_userid` (`user_id`, `setting_key`),
  KEY `IDX_user_setting_user_id` (`user_id`),
  KEY `IDX_user_setting_setting_key` (`setting_key`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `version`
--

DROP TABLE IF EXISTS `version`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `version` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `version` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 2 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `watch`
--

DROP TABLE IF EXISTS `watch`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `watch` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint DEFAULT NULL,
  `repo_id` bigint DEFAULT NULL,
  `mode` smallint NOT NULL DEFAULT '1',
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_watch_watch` (`user_id`, `repo_id`),
  KEY `IDX_watch_created_unix` (`created_unix`),
  KEY `IDX_watch_updated_unix` (`updated_unix`)
) ENGINE = InnoDB AUTO_INCREMENT = 3 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `webauthn_credential`
--

DROP TABLE IF EXISTS `webauthn_credential`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `webauthn_credential` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `lower_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `user_id` bigint DEFAULT NULL,
  `credential_id` varbinary(1024) DEFAULT NULL,
  `public_key` blob,
  `attestation_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `aaguid` blob,
  `sign_count` bigint DEFAULT NULL,
  `clone_warning` tinyint(1) DEFAULT NULL,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UQE_webauthn_credential_s` (`lower_name`, `user_id`),
  KEY `IDX_webauthn_credential_user_id` (`user_id`),
  KEY `IDX_webauthn_credential_credential_id` (`credential_id`),
  KEY `IDX_webauthn_credential_created_unix` (`created_unix`),
  KEY `IDX_webauthn_credential_updated_unix` (`updated_unix`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `webhook`
--

DROP TABLE IF EXISTS `webhook`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `webhook` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `repo_id` bigint DEFAULT NULL,
  `owner_id` bigint DEFAULT NULL,
  `is_system_webhook` tinyint(1) DEFAULT NULL,
  `url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `http_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `content_type` int DEFAULT NULL,
  `secret` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `events` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `is_active` tinyint(1) DEFAULT NULL,
  `type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL,
  `meta` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `last_status` int DEFAULT NULL,
  `header_authorization_encrypted` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs,
  `created_unix` bigint DEFAULT NULL,
  `updated_unix` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_webhook_owner_id` (`owner_id`),
  KEY `IDX_webhook_is_active` (`is_active`),
  KEY `IDX_webhook_created_unix` (`created_unix`),
  KEY `IDX_webhook_updated_unix` (`updated_unix`),
  KEY `IDX_webhook_repo_id` (`repo_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 107 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_as_cs ROW_FORMAT = DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Current Database: `nacos_config`
--

CREATE DATABASE
/*!32312 IF NOT EXISTS*/
`nacos_config`
/*!40100 DEFAULT CHARACTER SET utf8mb3 */
/*!80016 DEFAULT ENCRYPTION='N' */
;
USE `nacos_config`;
--
-- Table structure for table `config_info`
--

DROP TABLE IF EXISTS `config_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `config_info` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL,
  `content` longtext COLLATE utf8mb3_bin NOT NULL COMMENT 'content',
  `md5` varchar(32) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'md5',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `src_user` text COLLATE utf8mb3_bin COMMENT 'source user',
  `src_ip` varchar(50) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'source ip',
  `app_name` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL,
  `tenant_id` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL COMMENT '租户字段',
  `c_desc` varchar(256) COLLATE utf8mb3_bin DEFAULT NULL,
  `c_use` varchar(64) COLLATE utf8mb3_bin DEFAULT NULL,
  `effect` varchar(64) COLLATE utf8mb3_bin DEFAULT NULL,
  `type` varchar(64) COLLATE utf8mb3_bin DEFAULT NULL,
  `c_schema` text COLLATE utf8mb3_bin,
  `encrypted_data_key` varchar(256) COLLATE utf8mb3_bin DEFAULT NULL COMMENT '密钥',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_configinfo_datagrouptenant` (`data_id`, `group_id`, `tenant_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 11 DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = 'config_info';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `config_info_aggr`
--

DROP TABLE IF EXISTS `config_info_aggr`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `config_info_aggr` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id',
  `datum_id` varchar(255) COLLATE utf8mb3_bin NOT NULL COMMENT 'datum_id',
  `content` longtext COLLATE utf8mb3_bin NOT NULL COMMENT '内容',
  `gmt_modified` datetime NOT NULL COMMENT '修改时间',
  `app_name` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL,
  `tenant_id` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL COMMENT '租户字段',
  `encrypted_data_key` varchar(256) COLLATE utf8mb3_bin DEFAULT NULL COMMENT '密钥',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_configinfoaggr_datagrouptenant_datum` (`data_id`, `group_id`, `tenant_id`, `datum_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = '增加租户字段';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `config_info_beta`
--

DROP TABLE IF EXISTS `config_info_beta`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `config_info_beta` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id',
  `app_name` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'app_name',
  `content` longtext COLLATE utf8mb3_bin NOT NULL COMMENT 'content',
  `beta_ips` varchar(1024) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'beta发布ips',
  `md5` varchar(32) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'md5',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `src_user` text COLLATE utf8mb3_bin COMMENT 'source user',
  `src_ip` varchar(50) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'source ip',
  `tenant_id` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL COMMENT '租户字段',
  `encrypted_data_key` varchar(256) COLLATE utf8mb3_bin DEFAULT NULL COMMENT '密钥',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_configinfobeta_datagrouptenant` (`data_id`, `group_id`, `tenant_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = 'config_info_beta';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `config_info_tag`
--

DROP TABLE IF EXISTS `config_info_tag`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `config_info_tag` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id',
  `tenant_id` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'tenant_id',
  `tag_id` varchar(128) COLLATE utf8mb3_bin NOT NULL COMMENT 'tag_id',
  `app_name` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'app_name',
  `content` longtext COLLATE utf8mb3_bin NOT NULL COMMENT 'content',
  `md5` varchar(32) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'md5',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `src_user` text COLLATE utf8mb3_bin COMMENT 'source user',
  `src_ip` varchar(50) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'source ip',
  `encrypted_data_key` varchar(256) COLLATE utf8mb3_bin DEFAULT NULL COMMENT '密钥',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_configinfotag_datagrouptenanttag` (`data_id`, `group_id`, `tenant_id`, `tag_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = 'config_info_tag';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `config_tags_relation`
--

DROP TABLE IF EXISTS `config_tags_relation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `config_tags_relation` (
  `id` bigint NOT NULL COMMENT 'id',
  `tag_name` varchar(128) COLLATE utf8mb3_bin NOT NULL COMMENT 'tag_name',
  `tag_type` varchar(64) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'tag_type',
  `data_id` varchar(255) COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id',
  `tenant_id` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'tenant_id',
  `nid` bigint NOT NULL AUTO_INCREMENT,
  `encrypted_data_key` varchar(256) COLLATE utf8mb3_bin DEFAULT NULL COMMENT '密钥',
  PRIMARY KEY (`nid`),
  UNIQUE KEY `uk_configtagrelation_configidtag` (`id`, `tag_name`, `tag_type`),
  KEY `idx_tenant_id` (`tenant_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = 'config_tag_relation';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `group_capacity`
--

DROP TABLE IF EXISTS `group_capacity`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `group_capacity` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `group_id` varchar(128) COLLATE utf8mb3_bin NOT NULL DEFAULT '' COMMENT 'Group ID，空字符表示整个集群',
  `quota` int unsigned NOT NULL DEFAULT '0' COMMENT '配额，0表示使用默认值',
  `usage` int unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
  `max_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限，单位为字节，0表示使用默认值',
  `max_aggr_count` int unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数，，0表示使用默认值',
  `max_aggr_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限，单位为字节，0表示使用默认值',
  `max_history_count` int unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_group_id` (`group_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = '集群、各Group容量信息表';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `his_config_info`
--

DROP TABLE IF EXISTS `his_config_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `his_config_info` (
  `id` bigint unsigned NOT NULL,
  `nid` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'nid',
  `data_id` varchar(255) COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id',
  `app_name` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'app_name',
  `content` longtext COLLATE utf8mb3_bin NOT NULL COMMENT 'content',
  `md5` varchar(32) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'md5',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `src_user` text COLLATE utf8mb3_bin COMMENT 'source user',
  `src_ip` varchar(50) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'source ip',
  `op_type` char(10) COLLATE utf8mb3_bin DEFAULT NULL COMMENT '操作类型',
  `tenant_id` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL COMMENT '租户字段',
  `encrypted_data_key` varchar(256) COLLATE utf8mb3_bin DEFAULT NULL COMMENT '密钥',
  PRIMARY KEY (`nid`),
  KEY `idx_gmt_create` (`gmt_create`),
  KEY `idx_gmt_modified` (`gmt_modified`),
  KEY `idx_did` (`data_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 10 DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = '多租户改造';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `permissions`
--

DROP TABLE IF EXISTS `permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `permissions` (
  `role` varchar(50) NOT NULL,
  `resource` varchar(255) NOT NULL,
  `action` varchar(8) NOT NULL,
  UNIQUE KEY `uk_role_permission` (`role`, `resource`, `action`) USING BTREE
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `roles`
--

DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `roles` (
  `username` varchar(50) NOT NULL,
  `role` varchar(50) NOT NULL,
  UNIQUE KEY `idx_user_role` (`username`, `role`) USING BTREE
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `tenant_capacity`
--

DROP TABLE IF EXISTS `tenant_capacity`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `tenant_capacity` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `tenant_id` varchar(128) COLLATE utf8mb3_bin NOT NULL DEFAULT '' COMMENT 'Tenant ID',
  `quota` int unsigned NOT NULL DEFAULT '0' COMMENT '配额，0表示使用默认值',
  `usage` int unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
  `max_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限，单位为字节，0表示使用默认值',
  `max_aggr_count` int unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数，0表示使用默认值',
  `max_aggr_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限，单位为字节，0表示使用默认值',
  `max_history_count` int unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_tenant_id` (`tenant_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = '租户容量信息表';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `tenant_info`
--

DROP TABLE IF EXISTS `tenant_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `tenant_info` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `kp` varchar(128) COLLATE utf8mb3_bin NOT NULL COMMENT 'kp',
  `tenant_id` varchar(128) COLLATE utf8mb3_bin DEFAULT '' COMMENT 'tenant_id',
  `tenant_name` varchar(128) COLLATE utf8mb3_bin DEFAULT '' COMMENT 'tenant_name',
  `tenant_desc` varchar(256) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'tenant_desc',
  `create_source` varchar(32) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'create_source',
  `gmt_create` bigint NOT NULL COMMENT '创建时间',
  `gmt_modified` bigint NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_tenant_info_kptenantid` (`kp`, `tenant_id`),
  KEY `idx_tenant_id` (`tenant_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = 'tenant_info';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `users` (
  `username` varchar(50) NOT NULL,
  `password` varchar(500) NOT NULL,
  `enabled` tinyint(1) NOT NULL,
  PRIMARY KEY (`username`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Current Database: `timeline`
--

CREATE DATABASE
/*!32312 IF NOT EXISTS*/
`timeline`
/*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */
/*!80016 DEFAULT ENCRYPTION='N' */
;
USE `timeline`;
--
-- Table structure for table `common_relation`
--

DROP TABLE IF EXISTS `common_relation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `common_relation` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `rela_id` varchar(32) NOT NULL COMMENT '主关系实例ID',
  `sub_rela_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '子关系实例ID',
  `rela_type` int DEFAULT NULL COMMENT '关系类型',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_delete` tinyint(1) DEFAULT '0' COMMENT '是否删除，0：否，1：是',
  `user_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 21 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `file_hash`
--

DROP TABLE IF EXISTS `file_hash`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `file_hash` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `instance_id` varchar(32) NOT NULL COMMENT 'image ID',
  `hash_value` varchar(255) NOT NULL COMMENT 'hash值',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除，0：否，1：是',
  PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 26 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '文件哈希值存储表';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `friend_notify`
--

DROP TABLE IF EXISTS `friend_notify`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `friend_notify` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `from_user_id` varchar(32) NOT NULL COMMENT '发送者用户ID',
  `to_user_id` varchar(32) NOT NULL COMMENT '接收者用户ID',
  `type` varchar(10) NOT NULL COMMENT '通知类型（request:好友申请, accept:好友同意, reject:好友拒绝）',
  `status` varchar(10) NOT NULL COMMENT '状态（unread:未读, read:已读）',
  `content` text COMMENT '通知内容',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `read_time` datetime DEFAULT NULL COMMENT '阅读时间',
  PRIMARY KEY (`id`),
  KEY `idx_from_user_id` (`from_user_id`),
  KEY `idx_to_user_id` (`to_user_id`),
  KEY `idx_type` (`type`),
  KEY `idx_status` (`status`),
  KEY `idx_create_time` (`create_time`)
) ENGINE = InnoDB AUTO_INCREMENT = 45 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '好友通知表';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `friendships`
--

DROP TABLE IF EXISTS `friendships`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `friendships` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` varchar(32) NOT NULL,
  `friend_id` varchar(32) NOT NULL,
  `sorted_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '9999',
  `status` enum('pending', 'accepted', 'rejected') DEFAULT 'pending',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 25 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `image_info`
--

DROP TABLE IF EXISTS `image_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `image_info` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `instance_id` varchar(32) NOT NULL COMMENT 'imageID',
  `image_name` varchar(255) NOT NULL,
  `object_key` varchar(255) NOT NULL,
  `upload_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `size` bigint DEFAULT NULL,
  `content_type` varchar(50) DEFAULT NULL,
  `user_id` varchar(32) NOT NULL,
  `thumbnail_instance_id` varchar(32) DEFAULT NULL COMMENT '视频缩略图ID',
  `duration` bigint DEFAULT NULL COMMENT '视频时长(秒)',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除，0：否，1：是',
  PRIMARY KEY (`id`),
  UNIQUE KEY `object_key` (`object_key`, `user_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 23 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `story`
--

DROP TABLE IF EXISTS `story`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `story` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `instance_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '故事ID',
  `title` varchar(255) NOT NULL COMMENT '标题',
  `description` text NOT NULL COMMENT '描述',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `update_id` varchar(32) DEFAULT '0' COMMENT '更新人ID',
  `is_delete` tinyint(1) DEFAULT '0' COMMENT '是否删除，0：否，1：是',
  `owner_id` varchar(32) NOT NULL COMMENT '故事拥有者ID',
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '状态',
  `logo` text,
  `story_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 12 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `story_activity`
--

DROP TABLE IF EXISTS `story_activity`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `story_activity` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `actor_id` varchar(64) NOT NULL,
  `action` varchar(64) NOT NULL,
  `story_instance_id` varchar(64) NOT NULL,
  `story_item_id` varchar(64) DEFAULT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_actor_time` (`actor_id`, `create_time`),
  KEY `idx_story_time` (`story_instance_id`, `create_time`),
  KEY `idx_item_time` (`story_item_id`, `create_time`),
  KEY `idx_action_time` (`action`, `create_time`)
) ENGINE = InnoDB AUTO_INCREMENT = 44 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `story_item`
--

DROP TABLE IF EXISTS `story_item`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `story_item` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `instance_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主项ID，story_id/item_id',
  `master_item_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '项目ID',
  `description` varchar(255) DEFAULT NULL COMMENT '描述',
  `location` varchar(255) DEFAULT NULL COMMENT '位置',
  `title` varchar(255) DEFAULT NULL,
  `create_id` varchar(32) NOT NULL COMMENT '创建人ID',
  `story_instance_id` varchar(32) DEFAULT NULL COMMENT '故事ID',
  `story_item_time` datetime DEFAULT NULL COMMENT '故事时间',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_root` tinyint(1) DEFAULT '0' COMMENT '是否是根项，0：否，1：是',
  `is_delete` tinyint(1) DEFAULT '0' COMMENT '是否删除，0：否，1：是',
  `update_id` varchar(32) DEFAULT NULL COMMENT '更新人ID',
  `share_id` varchar(64) DEFAULT NULL COMMENT '分享ID',
  PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 41 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `story_permission`
--

DROP TABLE IF EXISTS `story_permission`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `story_permission` (
  `id` int NOT NULL AUTO_INCREMENT,
  `permission_id` varchar(32) NOT NULL COMMENT '权限记录ID',
  `story_instance_id` varchar(32) NOT NULL COMMENT '故事实例ID',
  `user_id` varchar(32) NOT NULL COMMENT '用户ID',
  `permission_type` int NOT NULL COMMENT '权限类型（如1=创建者/管理员，2=编辑，3=只读等）',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_story_user` (`story_instance_id`, `user_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 12 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '故事权限表';
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `user`
--

DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `user` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` varchar(32) NOT NULL,
  `username` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `password` varchar(200) NOT NULL,
  `nickname` varchar(100) DEFAULT NULL,
  `email` varchar(200) DEFAULT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `status` tinyint DEFAULT '0',
  `is_deleted` tinyint DEFAULT '0',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `avator` text,
  `tag` varchar(255) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_user_user_id` (`user_id`),
  UNIQUE KEY `uk_user_username` (`username`)
) ENGINE = InnoDB AUTO_INCREMENT = 8 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Table structure for table `user_friend`
--

DROP TABLE IF EXISTS `user_friend`;
/*!40101 SET @saved_cs_client     = @@character_set_client */
;
/*!50503 SET character_set_client = utf8mb4 */
;
CREATE TABLE `user_friend` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` varchar(32) NOT NULL COMMENT '用户ID',
  `friend_id` varchar(32) NOT NULL COMMENT '朋友ID',
  `status` tinyint(1) NOT NULL COMMENT '状态',
  `remark` varchar(50) DEFAULT NULL COMMENT '关系标记',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */
;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */
;
/*!50606 SET GLOBAL INNODB_STATS_AUTO_RECALC=@OLD_INNODB_STATS_AUTO_RECALC */
;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */
;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */
;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */
;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */
;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */
;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */
;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */
;
-- Dump completed on 2026-02-12  2:06:34