Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

small fix

daniel31x1342d877e2b593
diff --git a/packages/prisma/migrations/20250627155222_add_default_db_sections_fix/migration.sql b/packages/prisma/migrations/20250627155222_add_default_db_sections_fix/migration.sql
new file mode 100644
index 00000000..3df073f2
--- /dev/null
+++ b/packages/prisma/migrations/20250627155222_add_default_db_sections_fix/migration.sql
@@ -0,0 +1,23 @@
+INSERT INTO "DashboardSection"
+ ("userId", "collectionId", "type", "order", "createdAt", "updatedAt")
+SELECT
+ u.id AS "userId",
+ NULL AS "collectionId",
+ t.typ::"DashboardSectionType" AS "type",
+ t.ord AS "order",
+ now() AS "createdAt",
+ now() AS "updatedAt"
+FROM
+ "User" u
+ CROSS JOIN (
+ VALUES
+ ('STATS'::"DashboardSectionType", 0),
+ ('RECENT_LINKS'::"DashboardSectionType", 1),
+ ('PINNED_LINKS'::"DashboardSectionType", 2)
+ ) AS t(typ, ord)
+WHERE
+ NOT EXISTS (
+ SELECT 1
+ FROM "DashboardSection" ds
+ WHERE ds."userId" = u.id
+ );
\ No newline at end of file