--- users-auth-backends

create table user_auth_backends (
    id number(19) primary key,
    name varchar2(255 char) not null,
    type varchar2(255 char) not null,
    active number(1) not null,
    deleted number(1) not null,

    create_on_login number(1) not null,
    update_on_login number(1) not null,
    default_role_id number(19) not null references user_roles(id),

    ldap_dir_id number(19) references ldap_directories(id),

    created_at timestamp with time zone not null,
    updated_at timestamp with time zone not null
);

create sequence user_auth_backends_id_seq;

create unique index user_auth_backends_uniq
on user_auth_backends(case when active = 1 then id end);
