--- users-auth-backends

create table user_auth_backends (
    id bigint primary key,
    name varchar not null,
    type varchar not null,
    active boolean not null,
    deleted boolean not null,

    create_on_login boolean not null,
    update_on_login boolean not null,
    default_role_id bigint not null references user_roles(id),

    ldap_dir_id bigint references ldap_directories(id),

    created_at timestamptz not null,
    updated_at timestamptz not null
);

create sequence user_auth_backends_id_seq;

create unique index user_auth_backends_uniq
on user_auth_backends(id) where active = true;
