--- client-details-fields

create table client_detail_fields (
    id number(19) primary key,
    client_id number(19) not null references clients(id),
    name varchar2(4000 char) not null,
    value varchar2(4000 char) not null,
    deleted number(1) not null,

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

create sequence client_detail_fields_id_seq;

create unique index client_detail_fields_uniq
on client_detail_fields(client_id, lower(name));
