drop table if exists forum_banned_users;
create table forum_banned_users(
	forum_banned_user_id serial not null,
	user_id integer references users( user_id ),
	banned_user_id integer references users( user_id ),
	bantype smallint not null default 1,
	constraint forum_banned_users_pkey primary key( forum_banned_user_id )
);

comment on table forum_banned_users is 'storage of banned users';
comment on column forum_banned_users.forum_banned_user_id is 'unique id if table';
comment on column forum_banned_users.user_id is 'reference id to users table - the user';
comment on column forum_banned_users.banned_user_id is 'reference id to users table - the banned user';
comment on column forum_banned_users.bantype is '1 - softban (poster should be displayed), 2 - hardban (completely remove from posts)';

comment on constraint forum_banned_users_pkey on forum_banned_users is 'unique constraint of table';
comment on constraint forum_banned_users_user_id_fkey on forum_banned_users is 'foreign constraint to users table';
comment on constraint forum_banned_users_banned_user_id_fkey on forum_banned_users is 'foreign constraint to users table';

