create table user_blocking_settings (
    id number(19) primary key not null,
    attempts_until_temp_ban number(19) not null default 5,
    temp_ban_time varchar2(10) default '00:30:00',
    attempts_until_perm_ban number(19) not null default 5,
    enabled number(1) not null default 0,
    temp_ban_enabled number(1) not null default 0,
    perm_ban_enabled number(1) not null default 0,
    created_at timestamp with time zone not null,
    updated_at timestamp with time zone
);

create sequence user_blocking_settings_id_seq;

alter table users add failed_logins_count number(19) default 0;
alter table users add was_banned number(1) default 0;
alter table users add blocked number(1) default 0;
alter table users add blocked_until timestamp with time zone;
update users set failed_logins_count = 0, was_banned = 0, blocked = 0;
