--- licenses

create table licenses (
    id number(19) primary key,
    "current" number(1) not null,
    "key" varchar2(4000 char) not null,

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

create sequence licenses_id_seq;

create unique index licenses_current_uniq
on licenses(case when "current" = 1 then id end);
