certd/packages/ui/certd-server/db/migration-pg/v10000__certd.sql

25 lines
2.7 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

--
-- 由SQLiteStudio v3.3.3 产生的文件 周六 7月 3 00:38:02 2021
--
-- 文本编码UTF-8
--
-- 表cd_access
CREATE TABLE "cd_access" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "name" varchar(100) NOT NULL, "type" varchar(100) NOT NULL, "setting" varchar(1024), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
-- 表cd_cert
CREATE TABLE "cd_cert" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "domains" varchar(2048) NOT NULL, "email" varchar(100) NOT NULL, "cert_issuer_id" bigint, "challenge_type" varchar(100), "challenge_dns_type" varchar(100),"challenge_access_id" bigint, "country" varchar(100), "state" varchar(100), "locality" varchar(100), "organization" varchar(100), "organization_unit" varchar(100), "remark" varchar(100), "last_history_id" bigint, "last_success_id" bigint, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
-- 表cd_cert_apply_history
CREATE TABLE "cd_cert_apply_history" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "cert_id" bigint NOT NULL, "success" boolean, "result" varchar(1024), "cert_crt" varchar(1024), "cert_key" varchar(1024), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
-- 表cd_cert_issuer
CREATE TABLE "cd_cert_issuer" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "type" varchar(20) NOT NULL, "account" varchar(100) NOT NULL, "private_key" varchar(1024), "setting" varchar, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
-- 表cd_task
CREATE TABLE "cd_task" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "name" varchar(100), "type" varchar(100), "setting" varchar(2048), "cert_id" bigint NOT NULL, "last_history_id" bigint, "last_success_id" bigint, "remark" varchar(100), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
-- 表cd_task_history
CREATE TABLE "cd_task_history" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL, "user_id" bigint NOT NULL, "task_id" bigint NOT NULL, "cert_id" bigint NOT NULL, "cert_apply_history_id" bigint NOT NULL, "success" boolean, "result" varchar(2048), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));