From f950bd8c0167348bf51e2ca073c3dcdc4b338119 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 21 Jan 2021 00:17:15 +1100 Subject: [PATCH] an ssh_public_key should always be linked to a user --- schema/sql/schema.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schema/sql/schema.sql b/schema/sql/schema.sql index b8fbf0e..a3b5150 100644 --- a/schema/sql/schema.sql +++ b/schema/sql/schema.sql @@ -90,11 +90,11 @@ create type ssh_key_type as enum ( create domain ssh_sha256_fingerprint bytea check (length(value) = 32); create table "ssh_public_key" ( + "uid" integer not null references passwd (uid) on delete cascade, "fingerprint" ssh_sha256_fingerprint not null, "type" ssh_key_type not null, "key" text unique not null check(length(key) < 4096), - "comment" text null check (length(comment) < 100), - "uid" integer references passwd (uid) on delete cascade + "comment" text null check (length(comment) < 100) ); create table "openpgp_public_key" (