]> Untitled Git - lemmy.git/blob - migrations/2021-11-23-132840_email_verification/up.sql
add enable_federated_downvotes site option
[lemmy.git] / migrations / 2021-11-23-132840_email_verification / up.sql
1 -- use defaults from db for local user init
2 ALTER TABLE local_user
3     ALTER COLUMN theme SET DEFAULT 'browser';
4
5 ALTER TABLE local_user
6     ALTER COLUMN default_listing_type SET DEFAULT 2;
7
8 -- add tables and columns for optional email verification
9 ALTER TABLE site
10     ADD COLUMN require_email_verification boolean NOT NULL DEFAULT FALSE;
11
12 ALTER TABLE local_user
13     ADD COLUMN email_verified boolean NOT NULL DEFAULT FALSE;
14
15 CREATE TABLE email_verification (
16     id serial PRIMARY KEY,
17     local_user_id int REFERENCES local_user (id) ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
18     email text NOT NULL,
19     verification_token text NOT NULL
20 );
21