--- options


create table org_options (
    org_id bigint primary key references orgs(id),

    max_inbox int not null,

    created_at datetimeoffset not null,
    updated_at datetimeoffset not null,
);

create table project_options (
    project_id bigint primary key references projects(id),

    allow_user_file_upload bit not null,

    created_at datetimeoffset not null,
    updated_at datetimeoffset not null
);

insert into org_options (
    org_id,
    max_inbox,
    created_at,
    updated_at
) (
    SELECT
        id,
        max_inbox,
        created_at,
        updated_at
    FROM
        orgs
);

alter table orgs drop column max_inbox;
