create table forms (
    id bigint primary key not null,
    type varchar(100) not null,
    project_id bigint 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 bigint primary key  not null,
    form_id bigint not null  references forms(id),
    place integer,
    name varchar(500) not null,
    corresponding_field varchar(500),
    label varchar(1500),
    type varchar(100),
    enabled boolean not null default false,
    required boolean not null  default false,
    deleted boolean not null  default false,
    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);
