orchid/renewal/create-tables.sql

34 lines
899 B
MySQL
Raw Normal View History

2023-06-26 11:56:21 +01:00
CREATE TABLE IF NOT EXISTS certificates
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
2023-07-10 17:51:14 +01:00
owner VARCHAR,
2023-06-26 11:56:21 +01:00
dns INTEGER,
auto_renew INTEGER DEFAULT 0,
active INTEGER DEFAULT 0,
renewing INTEGER DEFAULT 0,
renew_failed INTEGER DEFAULT 0,
not_after DATETIME,
updated_at DATETIME,
2023-07-10 17:51:14 +01:00
temp_parent INTEGER DEFAULT 0,
FOREIGN KEY (dns) REFERENCES dns_acme (id),
FOREIGN KEY (temp_parent) REFERENCES certificates (id)
2023-06-26 11:56:21 +01:00
);
CREATE TABLE IF NOT EXISTS certificate_domains
(
domain_id INTEGER PRIMARY KEY AUTOINCREMENT,
cert_id INTEGER,
domain VARCHAR,
2023-07-10 17:51:14 +01:00
state INTEGER DEFAULT 1,
UNIQUE (cert_id, domain),
2023-06-26 11:56:21 +01:00
FOREIGN KEY (cert_id) REFERENCES certificates (id)
);
2023-07-10 17:51:14 +01:00
CREATE TABLE IF NOT EXISTS dns_acme
2023-06-26 11:56:21 +01:00
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
type VARCHAR,
email VARCHAR,
token VARCHAR
);