create table forms (
    id NUMBER(19) primary key not null,
    type varchar2(100) not null,
    project_id NUMBER(19) not null references projects(id),
    updated_at timestamp with time zone
);

create sequence forms_id_seq;
create index forms_project_id_idx on forms(project_id);

create table form_fields (
    id NUMBER(19) primary key  not null,
    form_id NUMBER(19) not null  references forms(id),
    place NUMBER(5),
    name varchar2(500) not null,
    corresponding_field varchar2(500),
    label varchar2(1500),
    type varchar2(100),
    enabled NUMBER(1) default false not null,
    required NUMBER(1) default false not null,
    deleted NUMBER(1) default false not null,
    deleted_at timestamp with time zone,
    created_at timestamp with time zone,
    updated_at timestamp with time zone
);
create sequence form_fields_id_seq;
create index form_fields_form_id_idx on form_fields(form_id);
