-- ----------------------------
-- Table structure for SERVICES - 虚拟主机
-- Target   : SQLite
-- Author   : wangbing
-- Date:    : 2021-02-07
-- ----------------------------
CREATE TABLE IF NOT EXISTS NA_SERVICES (
    "ID" BIGINT PRIMARY KEY NOT NULL,
    "TITLE" VARCHAR(50) NOT NULL,
    "DOMAIN" VARCHAR(50) NOT NULL,
    "TYPE" VARCHAR(20) NOT NULL,
    "PORT" MEDIUMINT NOT NULL,
    "VALID" BOOLEAN,
    "FILTER" BOOLEAN NOT NULL,
    "FILTER_CONF" VARCHAR(500),
    "ROW_VERSION" BIGINT NOT NULL,
    "IS_DELETED" BOOLEAN NOT NULL,
    "CREATE_BY" BIGINT NOT NULL,
    "CREATE_TIME" DATETIME NOT NULL,
    "LAST_UPDATE_BY" BIGINT,
    "LAST_UPDATE_TIME" DATETIME
);

-- ----------------------------
-- Table structure for LOCATIONS - 路径配置
-- Target   : SQLite
-- Author   : wangbing
-- Date:    : 2021-02-07
-- ----------------------------
CREATE TABLE IF NOT EXISTS NA_LOCATIONS (
    "ID" BIGINT PRIMARY KEY NOT NULL,
    "SERVICE_ID" BIGINT NOT NULL,
    "LOCAL_TITLE" VARCHAR(50) NOT NULL,
    "LOCAL_NOTE" VARCHAR(250),
    "LOCAL_PATH" VARCHAR(50) NOT NULL,
    "LOCAL_VALID" BOOLEAN NOT NULL,
    "FILTER" BOOLEAN NOT NULL,
    "FILTER_CONF" VARCHAR(500),
    "ROW_VERSION" BIGINT NOT NULL,
    "IS_DELETED" BOOLEAN NOT NULL,
    "CREATE_BY" BIGINT NOT NULL,
    "CREATE_TIME" DATETIME NOT NULL,
    "LAST_UPDATE_BY" BIGINT,
    "LAST_UPDATE_TIME" DATETIME
);

-- ----------------------------
-- Table structure for CONFIG - 配置预设
-- Target   : SQLite
-- Author   : wangbing
-- Date:    : 2021-02-07
-- ----------------------------
CREATE TABLE IF NOT EXISTS NA_CONFIG (
    "ID" BIGINT PRIMARY KEY NOT NULL,
    "CONF_NAME" VARCHAR(50) NOT NULL,
    "CONF_TYPE" VARCHAR(50) NOT NULL,
    "CONF_VALUE" VARCHAR(250),
    "CONF_NOTE" VARCHAR(250),
    "ROW_VERSION" BIGINT NOT NULL,
    "IS_DELETED" BOOLEAN NOT NULL,
    "CREATE_BY" BIGINT NOT NULL,
    "CREATE_TIME" DATETIME NOT NULL,
    "LAST_UPDATE_BY" BIGINT,
    "LAST_UPDATE_TIME" DATETIME
);

-- ----------------------------
-- Table structure for CONFIG_DATA - 配置数据
-- Target   : SQLite
-- Author   : wangbing
-- Date:    : 2021-02-07
-- ----------------------------
CREATE TABLE IF NOT EXISTS NA_CONFIG_DATA (
    "ID" BIGINT PRIMARY KEY NOT NULL,
    "TARGET_ID" BIGINT NOT NULL,
    "CONF_NAME" VARCHAR(50) NOT NULL,
    "CONF_TYPE" VARCHAR(50) NOT NULL,
    "CONF_VALUE" VARCHAR(250) NOT NULL,
    "CONF_NOTE" VARCHAR(250),
    "ROW_VERSION" BIGINT NOT NULL,
    "IS_DELETED" BOOLEAN NOT NULL,
    "CREATE_BY" BIGINT NOT NULL,
    "CREATE_TIME" DATETIME NOT NULL,
    "LAST_UPDATE_BY" BIGINT,
    "LAST_UPDATE_TIME" DATETIME
);

