3 ALTER COLUMN hidden DROP NOT NULL;
6 ALTER COLUMN posting_restricted_to_mods DROP NOT NULL;
9 ALTER COLUMN sensitive DROP NOT NULL;
12 ALTER COLUMN removed DROP NOT NULL;
14 ALTER TABLE mod_add_community
15 ALTER COLUMN removed DROP NOT NULL;
18 ALTER COLUMN banned DROP NOT NULL;
20 ALTER TABLE mod_ban_from_community
21 ALTER COLUMN banned DROP NOT NULL;
23 ALTER TABLE mod_hide_community
24 ALTER COLUMN hidden DROP NOT NULL;
26 ALTER TABLE mod_lock_post
27 ALTER COLUMN LOCKED DROP NOT NULL;
29 ALTER TABLE mod_remove_comment
30 ALTER COLUMN removed DROP NOT NULL;
32 ALTER TABLE mod_remove_community
33 ALTER COLUMN removed DROP NOT NULL;
35 ALTER TABLE mod_remove_post
36 ALTER COLUMN removed DROP NOT NULL;
38 ALTER TABLE mod_transfer_community
39 ADD COLUMN removed boolean DEFAULT FALSE;
42 ALTER COLUMN code DROP NOT NULL;
45 ALTER COLUMN name DROP NOT NULL;
47 -- Fix the registration mode enums
48 ALTER TYPE registration_mode_enum RENAME VALUE 'Closed' TO 'closed';
50 ALTER TYPE registration_mode_enum RENAME VALUE 'RequireApplication' TO 'require_application';
52 ALTER TYPE registration_mode_enum RENAME VALUE 'Open' TO 'open';
54 -- add back old columns
55 -- Alter the local_user table
56 ALTER TABLE local_user
57 ALTER COLUMN default_sort_type DROP DEFAULT;
59 ALTER TABLE local_user
60 ALTER COLUMN default_sort_type TYPE smallint
62 CASE default_sort_type
81 WHEN 'MostComments' THEN
83 WHEN 'NewComments' THEN
89 ALTER TABLE local_user
90 ALTER COLUMN default_sort_type SET DEFAULT 0;
92 ALTER TABLE local_user
93 ALTER COLUMN default_listing_type DROP DEFAULT;
95 ALTER TABLE local_user
96 ALTER COLUMN default_listing_type TYPE smallint
98 CASE default_listing_type
103 WHEN 'Subscribed' THEN
109 ALTER TABLE local_user
110 ALTER COLUMN default_listing_type SET DEFAULT 1;
112 -- Alter the local site column
113 ALTER TABLE local_site
114 ALTER COLUMN default_post_listing_type DROP DEFAULT;
116 ALTER TABLE local_site
117 ALTER COLUMN default_post_listing_type TYPE text;
119 ALTER TABLE local_site
120 ALTER COLUMN default_post_listing_type SET DEFAULT 1;
123 DROP TYPE listing_type_enum;
125 DROP TYPE sort_type_enum;