/*
Navicat SQLite Data Transfer

Source Server         : project
Source Server Version : 30808
Source Host           : :0

Target Server Type    : SQLite
Target Server Version : 30808
File Encoding         : 65001

Date: 2025-05-30 09:13:56
*/

PRAGMA foreign_keys = OFF;

-- ----------------------------
-- Table structure for app_application
-- ----------------------------
DROP TABLE IF EXISTS "main"."app_application";
CREATE TABLE "app_application" (
"id"  TEXT(40) NOT NULL,
"type"  TEXT(2),
"code"  TEXT(6),
"name"  TEXT(200) NOT NULL,
"simplename"  TEXT(100),
"createdate"  TEXT,
"description"  TEXT(600),
"image"  TEXT,
"appconfig"  TEXT,
"dbconfig"  TEXT,
"organization"  TEXT(200),
"status"  TEXT(20),
"lastmodifier"  TEXT(40),
"lastmodifydate"  TEXT,
"custom1"  TEXT(100),
"custom2"  TEXT(100),
"custom3"  TEXT(100),
PRIMARY KEY ("id")
);

-- ----------------------------
-- Table structure for app_dictionary
-- ----------------------------
DROP TABLE IF EXISTS "main"."app_dictionary";
CREATE TABLE "app_dictionary" (
"id"  TEXT(40) NOT NULL,
"app_id"  TEXT(40),
"orderno"  INTEGER NOT NULL,
"dictcode"  TEXT(40) NOT NULL,
"dictname"  TEXT(100) NOT NULL,
"dictdata"  TEXT,
"lastmodifydate"  TEXT,
"custom1"  TEXT(1000),
"custom2"  TEXT(100),
"custom3"  TEXT(100),
PRIMARY KEY ("id")
);

-- ----------------------------
-- Table structure for app_menu
-- ----------------------------
DROP TABLE IF EXISTS "main"."app_menu";
CREATE TABLE "app_menu" (
"id"  TEXT(40) NOT NULL,
"app_id"  TEXT(40),
"type"  TEXT(2) NOT NULL,
"code"  TEXT(20) NOT NULL,
"orderno"  INTEGER,
"name"  TEXT(100) NOT NULL,
"icon"  TEXT(9000),
"islink"  TEXT(2),
"url"  TEXT(200),
"module_id"  TEXT(40),
"parentid"  TEXT(40),
"isdisplay"  TEXT(2),
"lastmodifier"  TEXT(40),
"lastmodifydate"  TEXT,
"custom1"  TEXT(100),
"custom2"  TEXT(100),
"custom3"  TEXT(100),
PRIMARY KEY ("id")
);

-- ----------------------------
-- Table structure for app_module
-- ----------------------------
DROP TABLE IF EXISTS "main"."app_module";
CREATE TABLE "app_module" (
"id"  TEXT(40) NOT NULL,
"app_id"  TEXT(40),
"name"  TEXT(200),
"pid"  TEXT(40),
"level"  INTEGER,
"node_type"  TEXT(40),
"type"  TEXT(40),
"canvas_style_data"  TEXT,
"component_data"  TEXT,
"status"  INTEGER,
"self_watermark_status"  INTEGER,
"sort"  INTEGER,
"create_time"  TEXT,
"create_by"  TEXT(40),
"update_time"  TEXT,
"update_by"  TEXT(40),
"remark"  TEXT(255),
"source"  TEXT(255),
"delete_flag"  INTEGER,
"delete_time"  TEXT,
"delete_by"  TEXT(40),
"version"  INTEGER,
"content_id"  TEXT(50),
"check_version"  TEXT(50),
"custom1"  TEXT(100),
"custom2"  TEXT(100),
"custom3"  TEXT(100),
PRIMARY KEY ("id")
);

-- ----------------------------
-- Table structure for app_optlog
-- ----------------------------
DROP TABLE IF EXISTS "main"."app_optlog";
CREATE TABLE "app_optlog" (
"id"  TEXT(40) NOT NULL,
"usercode"  TEXT(200),
"username"  TEXT(200),
"opttype"  TEXT(20),
"module"  TEXT(200),
"description"  TEXT(400),
"method"  TEXT(200),
"params"  TEXT,
"logtime"  TEXT,
"requestip"  TEXT(200),
"browser"  TEXT(200),
PRIMARY KEY ("id")
);

-- ----------------------------
-- Table structure for app_organization
-- ----------------------------
DROP TABLE IF EXISTS "main"."app_organization";
CREATE TABLE "app_organization" (
"id"  TEXT(40) NOT NULL,
"app_id"  TEXT(40),
"orgtype"  TEXT(20),
"orgcode"  TEXT(20),
"orgname"  TEXT(200),
"parentid"  TEXT(40),
"manager"  TEXT(40),
"description"  TEXT(1000),
"address"  TEXT(100),
"contact_phone"  TEXT(100),
"contact_person"  TEXT(100),
"isvaild"  TEXT(2) NOT NULL,
"lastmodifier"  TEXT(40),
"lastmodifydate"  TEXT,
"custom1"  TEXT(100),
"custom2"  TEXT(100),
"custom3"  TEXT(100),
PRIMARY KEY ("id")
);

-- ----------------------------
-- Table structure for app_role
-- ----------------------------
DROP TABLE IF EXISTS "main"."app_role";
CREATE TABLE "app_role" (
"id"  TEXT(40) NOT NULL,
"app_id"  TEXT(40),
"rolecode"  TEXT(3) NOT NULL,
"rolename"  TEXT(100) NOT NULL,
"type"  TEXT(2) NOT NULL,
"description"  TEXT(1000),
"isvaild"  TEXT(2) NOT NULL,
"lastmodifier"  TEXT(40) NOT NULL,
"lastmodifydate"  TEXT NOT NULL,
"custom1"  TEXT(100),
"custom2"  TEXT(100),
"custom3"  TEXT(100),
PRIMARY KEY ("id")
);

-- ----------------------------
-- Table structure for app_role_menu
-- ----------------------------
DROP TABLE IF EXISTS "main"."app_role_menu";
CREATE TABLE "app_role_menu" (
"id"  TEXT(40) NOT NULL,
"app_id"  TEXT(40),
"roleid"  TEXT(40) NOT NULL,
"menuid"  TEXT(40) NOT NULL,
PRIMARY KEY ("id")
);

-- ----------------------------
-- Table structure for app_role_users
-- ----------------------------
DROP TABLE IF EXISTS "main"."app_role_users";
CREATE TABLE "app_role_users" (
"id"  TEXT(40) NOT NULL,
"app_id"  TEXT(40),
"roleid"  TEXT(40) NOT NULL,
"userid"  TEXT(40) NOT NULL,
PRIMARY KEY ("id")
);

-- ----------------------------
-- Table structure for app_user
-- ----------------------------
DROP TABLE IF EXISTS "main"."app_user";
CREATE TABLE "app_user" (
"id"  TEXT(40) NOT NULL,
"app_id"  TEXT(40),
"orgid"  TEXT(40) NOT NULL,
"usertype"  TEXT(20) NOT NULL,
"username"  TEXT(100) NOT NULL,
"nickname"  TEXT(255) NOT NULL,
"password"  TEXT(200),
"email"  TEXT(100),
"phone"  TEXT(20),
"avatar"  TEXT,
"status"  TEXT(2),
"pwdvalidperiod"  INTEGER,
"failednum"  INTEGER,
"loginip"  TEXT(40),
"failedlocktime"  TEXT,
"pwdresettime"  TEXT,
"lastmodifier"  TEXT(40),
"lastmodifydate"  TEXT,
"custom1"  TEXT(100),
"custom2"  TEXT(100),
"custom3"  TEXT(100),
PRIMARY KEY ("id")
);

-- ----------------------------
-- Indexes structure for table app_optlog
-- ----------------------------
CREATE INDEX "main"."inx_log_type"
ON "app_optlog" ("opttype" ASC);
CREATE INDEX "main"."log_create_time_index"
ON "app_optlog" ("logtime" ASC);
