]> Untitled Git - lemmy.git/blob - migrations/2021-02-25-112959_remove-categories/down.sql
Adding SQL format checking via `pg_format` / pgFormatter (#3740)
[lemmy.git] / migrations / 2021-02-25-112959_remove-categories / down.sql
1 CREATE TABLE category (
2     id serial PRIMARY KEY,
3     name varchar(100) NOT NULL UNIQUE
4 );
5
6 INSERT INTO category (name)
7     VALUES ('Discussion'),
8     ('Humor/Memes'),
9     ('Gaming'),
10     ('Movies'),
11     ('TV'),
12     ('Music'),
13     ('Literature'),
14     ('Comics'),
15     ('Photography'),
16     ('Art'),
17     ('Learning'),
18     ('DIY'),
19     ('Lifestyle'),
20     ('News'),
21     ('Politics'),
22     ('Society'),
23     ('Gender/Identity/Sexuality'),
24     ('Race/Colonisation'),
25     ('Religion'),
26     ('Science/Technology'),
27     ('Programming/Software'),
28     ('Health/Sports/Fitness'),
29     ('Porn'),
30     ('Places'),
31     ('Meta'),
32     ('Other');
33
34 ALTER TABLE community
35     ADD category_id int REFERENCES category ON UPDATE CASCADE ON DELETE CASCADE NOT NULL DEFAULT 1;
36