/*!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' */;
/*!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 */;

DROP DATABASE IF EXISTS `xiaohh_generator`;
CREATE DATABASE `xiaohh_generator` CHARSET 'UTF8';
USE `xiaohh_generator`;

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `gen_column` (
  `column_id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '表格列ID',
  `table_id` bigint unsigned NOT NULL COMMENT '表格ID',
  `column_name` varchar(64) NOT NULL COMMENT '列名称',
  `nullable` varchar(3) NOT NULL COMMENT '是否可以为空',
  `data_type` longtext NOT NULL COMMENT '数据类型',
  `column_type` mediumtext NOT NULL COMMENT '列类型',
  `column_comment` text NOT NULL COMMENT '列备注',
  `field_name` varchar(64) NOT NULL COMMENT '字段名字',
  `field_full_type` varchar(128) NOT NULL COMMENT '字段完整类型，带包名',
  `field_type` varchar(64) NOT NULL COMMENT '字段类型，不带包名',
  `field_comment` text NOT NULL COMMENT '字段备注',
  `form_type` varchar(16) NOT NULL DEFAULT 'input' COMMENT '表单类型；input,select,date',
  `operation_type` tinyint NOT NULL DEFAULT '15' COMMENT '操作类型，4个二进制位分别代表 增删查改',
  `column_key` varchar(3) NOT NULL DEFAULT '' COMMENT '索引类型',
  `extra_info` varchar(256) NOT NULL DEFAULT '' COMMENT '额外信息；auto_increment 为自增',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`column_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='代码生成导入表格列';
/*!40101 SET character_set_client = @saved_cs_client */;

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `gen_table` (
  `table_id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '表格ID',
  `database_name` varchar(64) NOT NULL COMMENT '数据库名',
  `table_name` varchar(64) NOT NULL COMMENT '表名',
  `table_comment` text NOT NULL COMMENT '表格备注',
  `module_name` varchar(64) NOT NULL COMMENT '模块名',
  `business_name` varchar(64) NOT NULL COMMENT '业务名',
  `package_name` varchar(512) NOT NULL COMMENT '包名',
  `author_name` varchar(512) NOT NULL DEFAULT 'XiaoHH' COMMENT '作者名',
  `class_name` varchar(64) NOT NULL COMMENT '类名',
  `class_comment` text NOT NULL COMMENT '类备注',
  `primary_key_column` varchar(64) NOT NULL COMMENT '主键列',
  `primary_key_field` varchar(64) NOT NULL COMMENT '主键字段名',
  `primary_key_full_type` varchar(128) NOT NULL COMMENT '主键字段类型全名',
  `primary_key_type` varchar(64) NOT NULL COMMENT '主键字段类型名',
  `primary_key_comment` text NOT NULL COMMENT '字段备注',
  `delete_type` tinyint NOT NULL DEFAULT '1' COMMENT '删除类型；1=物理删除,2=逻辑删除',
  `delete_flag_column` varchar(64) NOT NULL DEFAULT '' COMMENT '删除标记列',
  `delete_flag` varchar(8) NOT NULL DEFAULT '' COMMENT '删除标记',
  `no_delete_flag` varchar(8) NOT NULL DEFAULT '' COMMENT '未删除标记',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`table_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='代码生成导入表格';
/*!40101 SET character_set_client = @saved_cs_client */;

/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!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 */;
