2021-12-15 19:49:59 +00:00
|
|
|
-- Add columns to site table
|
2023-08-02 16:44:51 +00:00
|
|
|
ALTER TABLE site
|
|
|
|
ADD COLUMN require_application boolean NOT NULL DEFAULT FALSE;
|
|
|
|
|
|
|
|
ALTER TABLE site
|
|
|
|
ADD COLUMN application_question text;
|
|
|
|
|
|
|
|
ALTER TABLE site
|
|
|
|
ADD COLUMN private_instance boolean NOT NULL DEFAULT FALSE;
|
2021-12-15 19:49:59 +00:00
|
|
|
|
|
|
|
-- Add pending to local_user
|
2023-08-02 16:44:51 +00:00
|
|
|
ALTER TABLE local_user
|
|
|
|
ADD COLUMN accepted_application boolean NOT NULL DEFAULT FALSE;
|
2021-12-15 19:49:59 +00:00
|
|
|
|
2023-08-02 16:44:51 +00:00
|
|
|
CREATE TABLE registration_application (
|
|
|
|
id serial PRIMARY KEY,
|
|
|
|
local_user_id int REFERENCES local_user ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
|
|
|
|
answer text NOT NULL,
|
|
|
|
admin_id int REFERENCES person ON UPDATE CASCADE ON DELETE CASCADE,
|
|
|
|
deny_reason text,
|
|
|
|
published timestamp NOT NULL DEFAULT now(),
|
|
|
|
UNIQUE (local_user_id)
|
2021-12-15 19:49:59 +00:00
|
|
|
);
|
|
|
|
|
2023-08-02 16:44:51 +00:00
|
|
|
CREATE INDEX idx_registration_application_published ON registration_application (published DESC);
|
|
|
|
|