mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-13 15:19:15 +00:00
17 lines
662 B
SQL
17 lines
662 B
SQL
-- step-ca 0001: create_certs
|
|
-- Generated by termix-plugin migrations. Review before committing.
|
|
|
|
CREATE TABLE IF NOT EXISTS "p_step_ca_certs" (
|
|
"id" integer PRIMARY KEY AUTOINCREMENT,
|
|
"user_id" text NOT NULL,
|
|
"host_id" integer NOT NULL,
|
|
"ssh_cert" text NOT NULL,
|
|
"private_key" text NOT NULL,
|
|
"email" text,
|
|
"created_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"expires_at" text NOT NULL,
|
|
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE,
|
|
FOREIGN KEY ("host_id") REFERENCES "ssh_data" ("id") ON DELETE CASCADE
|
|
);
|
|
CREATE UNIQUE INDEX IF NOT EXISTS "idx_step_ca_certs_user_host" ON "p_step_ca_certs" ("user_id", "host_id");
|