3 drop view person_alias_1, person_alias_2;
6 alter index person__pkey rename to user__pkey;
7 alter index idx_person_actor_id rename to idx_user_actor_id;
8 alter index idx_person_inbox_url rename to idx_user_inbox_url;
9 alter index idx_person_lower_actor_id rename to idx_user_lower_actor_id;
10 alter index idx_person_published rename to idx_user_published;
13 alter trigger site_aggregates_person_delete on person rename to site_aggregates_user_delete;
14 alter trigger site_aggregates_person_insert on person rename to site_aggregates_user_insert;
15 alter trigger person_aggregates_person on person rename to user_aggregates_user;
17 -- Rename the trigger functions
18 alter function site_aggregates_person_delete() rename to site_aggregates_user_delete;
19 alter function site_aggregates_person_insert() rename to site_aggregates_user_insert;
20 alter function person_aggregates_person() rename to user_aggregates_user;
22 -- Rename the table back to user_
23 alter table person rename to user_;
25 -- Add the columns back in
27 add column password_encrypted text not null default 'changeme',
28 add column email text,
29 add column admin boolean default false not null,
30 add column show_nsfw boolean default false not null,
31 add column theme character varying(20) default 'darkly'::character varying not null,
32 add column default_sort_type smallint default 0 not null,
33 add column default_listing_type smallint default 1 not null,
34 add column lang character varying(20) default 'browser'::character varying not null,
35 add column show_avatars boolean default true not null,
36 add column send_notifications_to_email boolean default false not null,
37 add column matrix_user_id text;
39 -- Update the user_ table with the local_user data
41 password_encrypted = lu.password_encrypted,
44 show_nsfw = lu.show_nsfw,
46 default_sort_type = lu.default_sort_type,
47 default_listing_type = lu.default_listing_type,
49 show_avatars = lu.show_avatars,
50 send_notifications_to_email = lu.send_notifications_to_email,
51 matrix_user_id = lu.matrix_user_id
53 where lu.user_id = u.id;
55 create view user_alias_1 as select * from user_;
56 create view user_alias_2 as select * from user_;
58 drop table local_user;