mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-23 19:31:33 +00:00
Nutomic
6047257bfc
* Move admin flag from person to local_user (fixes #3060) The person table is for federated data, but admin flag can only apply to local users. Thats why it really belongs in the local_user table. This will also prevent the federation code from accidentally overwriting the admin flag * fmt * try to fix api tests * lint * fix person view * ci * ci --------- Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
16 lines
245 B
SQL
16 lines
245 B
SQL
ALTER TABLE local_user
|
|
ADD COLUMN admin boolean DEFAULT FALSE NOT NULL;
|
|
|
|
UPDATE
|
|
local_user
|
|
SET
|
|
admin = TRUE
|
|
FROM
|
|
person
|
|
WHERE
|
|
local_user.person_id = person.id
|
|
AND person.admin;
|
|
|
|
ALTER TABLE person
|
|
DROP COLUMN admin;
|
|
|