]> Untitled Git - lemmy.git/blob - migrations/2022-01-20-160328_remove_site_creator/down.sql
Implement separate mod activities for feature, lock post (#2716)
[lemmy.git] / migrations / 2022-01-20-160328_remove_site_creator / down.sql
1 --  Add the column back
2 alter table site add column creator_id int references person on update cascade on delete cascade;
3
4 -- Add the data, selecting the highest admin
5 update site
6 set creator_id = sub.id
7 from (
8   select id from person
9   where admin = true
10   limit 1
11 ) as sub;
12
13 -- Set to not null
14 alter table site alter column creator_id set not null;