aboutsummaryrefslogtreecommitdiff
path: root/test.sql
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-06 13:51:05 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-06 13:51:05 +0800
commit9b46e7a889d446d62243cf768619d4615140f0e0 (patch)
tree99611cbae63597cebb5e403cb3c4d45968e46b4d /test.sql
parentsql: Add potential for recursive groups (diff)
downloadforge-9b46e7a889d446d62243cf768619d4615140f0e0.tar.gz
forge-9b46e7a889d446d62243cf768619d4615140f0e0.tar.zst
forge-9b46e7a889d446d62243cf768619d4615140f0e0.zip
sql: Add purge and test scripts
Diffstat (limited to '')
-rw-r--r--test.sql17
1 files changed, 17 insertions, 0 deletions
diff --git a/test.sql b/test.sql
new file mode 100644
index 0000000..43c898f
--- /dev/null
+++ b/test.sql
@@ -0,0 +1,17 @@
+WITH parent_group AS (
+ INSERT INTO groups (name, description)
+ VALUES ('lindenii', 'The Lindenii Project')
+ RETURNING id
+),
+child_group AS (
+ INSERT INTO groups (name, description, parent_group)
+ SELECT 'forge', 'Lindenii Forge', id
+ FROM parent_group
+ RETURNING id
+)
+INSERT INTO repos (name, group_id, contrib_requirements, filesystem_path)
+SELECT 'server', id, 'public', '/home/runxiyu/Lindenii/forge/server/.git'
+FROM child_group;
+
+SELECT * FROM groups;
+SELECT * FROM repos;