]> Untitled Git - lemmy.git/blob - migrations/2021-11-23-153753_add_invite_only_columns/up.sql
First pass at invite-only migration. (#1949)
[lemmy.git] / migrations / 2021-11-23-153753_add_invite_only_columns / up.sql
1 -- Add columns to site table
2 alter table site add column require_application boolean not null default false;
3 alter table site add column application_question text;
4 alter table site add column private_instance boolean not null default false;
5
6 -- Add pending to local_user
7 alter table local_user add column accepted_application boolean not null default false;
8
9 create table registration_application (
10   id serial primary key,
11   local_user_id int references local_user on update cascade on delete cascade not null,
12   answer text not null,
13   admin_id int references person on update cascade on delete cascade,
14   deny_reason text,
15   published timestamp not null default now(),
16   unique(local_user_id)
17 );
18
19 create index idx_registration_application_published on registration_application (published desc);