src/server/plugins/postgresql/test/postgresql_vfs_testdata.sql

changeset 385
a1f4cb076d2f
parent 288
7dd45173f68a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/server/plugins/postgresql/test/postgresql_vfs_testdata.sql	Sat Sep 24 16:26:10 2022 +0200
@@ -0,0 +1,29 @@
+
+do $$
+declare
+    res_id int;
+begin
+    insert into Resource (nodename, iscollection) values ('', true);
+    res_id := lastval();
+   
+    insert into Resource(parent_id,  nodename, resoid) values
+    (res_id, 'file1.txt', (select lo_create(0))),
+    (res_id, 'file2.txt', (select lo_create(0))),
+    (res_id, 'file3.txt', (select lo_create(0))),
+    (res_id, 'file4.txt', (select lo_create(0)));
+    
+    insert into Resource(parent_id,  nodename, iscollection) values
+    (res_id, 'dir1', true);
+    res_id := lastval();
+    
+    insert into Resource(parent_id,  nodename, iscollection) values
+    (res_id, 'dir2', true);
+    res_id := lastval();
+    
+    insert into Resource(parent_id,  nodename, resoid) values
+    (res_id, 'd1file1.txt', (select lo_create(0))),
+    (res_id, 'd2file1.txt', (select lo_create(0))),
+    (res_id, 'd2file2.txt', (select lo_create(0)));
+
+end $$;
+

mercurial