aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--schema.sql6
1 files changed, 4 insertions, 2 deletions
diff --git a/schema.sql b/schema.sql
index 3a84825..e1d18f8 100644
--- a/schema.sql
+++ b/schema.sql
@@ -3,8 +3,10 @@
CREATE TABLE groups (
id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
- name TEXT NOT NULL UNIQUE,
- description TEXT
+ name TEXT NOT NULL,
+ parent_group INTEGER REFERENCES groups(id) ON DELETE CASCADE,
+ description TEXT,
+ UNIQUE NULLS NOT DISTINCT (parent_group, name)
);
CREATE TABLE repos (