-create table mod_ban_from_community (
- id serial primary key,
- mod_user_id int references user_ on update cascade on delete cascade not null,
- other_user_id int references user_ on update cascade on delete cascade not null,
- community_id int references community on update cascade on delete cascade not null,
- reason text,
- banned boolean default true,
- expires timestamp,
- when_ timestamp not null default now()
+CREATE TABLE mod_ban_from_community (
+ id serial PRIMARY KEY,
+ mod_user_id int REFERENCES user_ ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
+ other_user_id int REFERENCES user_ ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
+ community_id int REFERENCES community ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
+ reason text,
+ banned boolean DEFAULT TRUE,
+ expires timestamp,
+ when_ timestamp NOT NULL DEFAULT now()