3 ALTER COLUMN hidden SET NOT NULL;
6 ALTER COLUMN posting_restricted_to_mods SET NOT NULL;
9 ALTER COLUMN sensitive SET NOT NULL;
12 ALTER COLUMN removed SET NOT NULL;
14 ALTER TABLE mod_add_community
15 ALTER COLUMN removed SET NOT NULL;
18 ALTER COLUMN banned SET NOT NULL;
20 ALTER TABLE mod_ban_from_community
21 ALTER COLUMN banned SET NOT NULL;
23 ALTER TABLE mod_hide_community
24 ALTER COLUMN hidden SET NOT NULL;
26 ALTER TABLE mod_lock_post
27 ALTER COLUMN LOCKED SET NOT NULL;
29 ALTER TABLE mod_remove_comment
30 ALTER COLUMN removed SET NOT NULL;
32 ALTER TABLE mod_remove_community
33 ALTER COLUMN removed SET NOT NULL;
35 ALTER TABLE mod_remove_post
36 ALTER COLUMN removed SET NOT NULL;
38 ALTER TABLE mod_transfer_community
42 ALTER COLUMN code SET NOT NULL;
45 ALTER COLUMN name SET 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 'require_application' TO 'RequireApplication';
52 ALTER TYPE registration_mode_enum RENAME VALUE 'open' TO 'Open';
55 CREATE TYPE sort_type_enum AS ENUM (
69 CREATE TYPE listing_type_enum AS ENUM (
75 -- Alter the local_user table
76 ALTER TABLE local_user
77 ALTER COLUMN default_sort_type DROP DEFAULT;
79 ALTER TABLE local_user
80 ALTER COLUMN default_sort_type TYPE sort_type_enum
82 CASE default_sort_type
109 ALTER TABLE local_user
110 ALTER COLUMN default_sort_type SET DEFAULT 'Active';
112 ALTER TABLE local_user
113 ALTER COLUMN default_listing_type DROP DEFAULT;
115 ALTER TABLE local_user
116 ALTER COLUMN default_listing_type TYPE listing_type_enum
118 CASE default_listing_type
127 END::listing_type_enum;
129 ALTER TABLE local_user
130 ALTER COLUMN default_listing_type SET DEFAULT 'Local';
132 -- Alter the local site column
133 ALTER TABLE local_site
134 ALTER COLUMN default_post_listing_type DROP DEFAULT;
136 ALTER TABLE local_site
137 ALTER COLUMN default_post_listing_type TYPE listing_type_enum
138 USING default_post_listing_type::listing_type_enum;
140 ALTER TABLE local_site
141 ALTER COLUMN default_post_listing_type SET DEFAULT 'Local';