seed relations

This commit is contained in:
Anton Tranelis 2025-12-03 19:52:12 +01:00
parent 213b97dfd5
commit 119afe2ea0
2 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,27 @@
{
"collection": "relations",
"meta": {
"insert_order": 1,
"create": true,
"update": true,
"delete": true,
"preserve_ids": true,
"ignore_on_update": []
},
"data": [
{
"_sync_id": "1",
"relation": "is_following",
"heading": "Following",
"direction": "outgoing",
"hideWhenEmpty": true
},
{
"_sync_id": "2",
"relation": "is_following",
"heading": "Follower",
"direction": "ingoing",
"hideWhenEmpty": true
}
]
}

View File

@ -86,6 +86,32 @@ FROM
public.types as types
WHERE
name = 'user:text+gallery'
ON CONFLICT (id) DO UPDATE
SET collection = excluded.collection,
item = excluded.item,
sort = excluded.sort,
types_id = excluded.types_id;
INSERT INTO public."types_profileTemplate" (collection, id, item, sort, types_id)
SELECT
'relations', '3', '1' , '3', types.id
FROM
public.types as types
WHERE
name = 'user:text+gallery'
ON CONFLICT (id) DO UPDATE
SET collection = excluded.collection,
item = excluded.item,
sort = excluded.sort,
types_id = excluded.types_id;
INSERT INTO public."types_profileTemplate" (collection, id, item, sort, types_id)
SELECT
'relations', '4', '2' , '4', types.id
FROM
public.types as types
WHERE
name = 'user:text+gallery'
ON CONFLICT (id) DO UPDATE
SET collection = excluded.collection,
item = excluded.item,