/*
 Navicat Premium Data Transfer

 Source Server         : 法律文档管理
 Source Server Type    : SQLite
 Source Server Version : 3035005 (3.35.5)
 Source Schema         : main

 Target Server Type    : SQLite
 Target Server Version : 3035005 (3.35.5)
 File Encoding         : 65001

 Date: 21/10/2023 14:41:20
*/

PRAGMA foreign_keys = false;

-- ----------------------------
-- Table structure for article
-- ----------------------------
DROP TABLE IF EXISTS "article";
CREATE TABLE "article" (
  "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  "title" TEXT(255),
  "version" TEXT(255),
  "category_id" integer(11),
  "category_name" TEXT(255),
  "level_id" integer(11),
  "level_name" TEXT(255),
  "keywords" TEXT(255),
  "current_status" integer(11),
  "content" blob,
  "content_text" blob,
  "file_urls" TEXT(5000),
  "describe" TEXT(255),
  "implementation_date" TEXT(255),
  "create_date_time" TEXT(255) DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')),
  "update_date_time" TEXT(255) DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')),
  "create_by" integer(11),
  "update_by" integer(11),
  "state" integer(11) DEFAULT 1,
  "only_file" integer(11) DEFAULT 0
);

-- ----------------------------
-- Table structure for category
-- ----------------------------
DROP TABLE IF EXISTS "category";
CREATE TABLE "category" (
  "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  "category_name" TEXT(255),
  "create_date_time" TEXT(255) DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')),
  "update_date_time" TEXT(255) DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')),
  "create_by" integer(11),
  "update_by" integer(11),
  "state" integer(11) DEFAULT 1
);

-- ----------------------------
-- Table structure for level
-- ----------------------------
DROP TABLE IF EXISTS "level";
CREATE TABLE "level" (
  "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  "level_name" TEXT(255),
  "create_date_time" TEXT(255) DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')),
  "update_date_time" TEXT(255) DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')),
  "create_by" integer(11),
  "update_by" integer(11),
  "state" integer(11) DEFAULT 1
);

-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS "users";
CREATE TABLE "users" (
  "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
  "user_name" TEXT(255),
  "user_no" TEXT(255),
  "password" TEXT(255),
  "create_date_time" TEXT(255) DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')),
  "update_date_time" TEXT(255) DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')),
  "create_by" TEXT(255),
  "update_by" TEXT(255),
  "state" TEXT(255)
);

-- ----------------------------
-- Auto increment value for article
-- ----------------------------
UPDATE "sqlite_sequence" SET seq = 1 WHERE name = 'article';

-- ----------------------------
-- Auto increment value for category
-- ----------------------------
UPDATE "sqlite_sequence" SET seq = 1 WHERE name = 'category';

-- ----------------------------
-- Auto increment value for level
-- ----------------------------
UPDATE "sqlite_sequence" SET seq = 1 WHERE name = 'level';

-- ----------------------------
-- Auto increment value for users
-- ----------------------------
UPDATE "sqlite_sequence" SET seq = 1 WHERE name = 'users';

PRAGMA foreign_keys = true;
