stacker.news/prisma/migrations/20240222032317_drop_territo.../migration.sql

8 lines
358 B
SQL

-- migrate values from founders which had notifications for territory posts enabled to new table
INSERT INTO "SubSubscription"("userId", "subName")
SELECT u.id, s.name
FROM users u JOIN "Sub" s ON u.id = s."userId"
WHERE "noteTerritoryPosts";
-- we don't drop the users.noteTerritoryPosts column in this migration since it's a backwards incompatible change