]> Untitled Git - lemmy.git/blobdiff - migrations/2021-03-20-185321_move_matrix_id_to_person/up.sql
Moving admin to person table. Fixes #1515
[lemmy.git] / migrations / 2021-03-20-185321_move_matrix_id_to_person / up.sql
index 92f20c6cb9ba539127d6daad75ae17d8752e8ec8..d9ba3dd9c2097abae78c5fbd6df58909c653f3c6 100644 (file)
@@ -1,11 +1,15 @@
 alter table person add column matrix_user_id text;
+alter table person add column admin boolean default false not null;
 
 update person p
-set matrix_user_id = lu.matrix_user_id 
+set 
+  matrix_user_id = lu.matrix_user_id,
+  admin = lu.admin
 from local_user lu
 where p.id = lu.person_id;
 
 alter table local_user drop column matrix_user_id;
+alter table local_user drop column admin;
 
 -- Regenerate the person_alias views
 drop view person_alias_1, person_alias_2;