lemmy/migrations/2023-08-01-101826_admin_flag_local_user/down.sql
Dull Bananas 5d8af0d476 fix
2024-05-17 20:21:13 +00:00

20 lines
315 B
SQL

ALTER TABLE person
ADD COLUMN admin boolean DEFAULT FALSE NOT NULL;
UPDATE
person
SET
admin = TRUE
FROM
local_user
WHERE
local_user.person_id = person.id
AND local_user.admin;
ALTER TABLE local_user
DROP COLUMN admin;
CREATE INDEX idx_person_admin ON person (admin)
WHERE
admin;