--- users-auth-backends

create table user_auth_backends (
    id bigint primary key identity(1, 1),
    name nvarchar(255) not null,
    type nvarchar(255) not null,
    active bit not null,
    deleted bit not null,

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

    ldap_dir_id bigint references ldap_directories(id),

    created_at datetimeoffset not null,
    updated_at datetimeoffset not null
);

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