text: -- Generated by ebean unknown at 2021-08-22T03:33:37.079509Z
  create table asimple_bean (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_asimple_bean primary key (id)
  );
  
  create table bar (
    bar_type                      varchar(31) not null,
    bar_id                        integer generated by default as identity not null,
    foo_id                        integer not null,
    version                       integer not null,
    constraint pk_bar primary key (bar_id)
  );
  
  create table block (
    case_type                     integer(31) not null,
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    notes                         varchar(255),
    constraint pk_block primary key (id)
  );
  
  create table oto_account (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_oto_account primary key (id)
  );
  
  create table acl (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_acl primary key (id)
  );
  
  create table acl_container_relation (
    id                            bigint generated by default as identity not null,
    container_id                  bigint not null,
    acl_entry_id                  bigint not null,
    constraint pk_acl_container_relation primary key (id)
  );
  
  create table addr (
    id                            bigint generated by default as identity not null,
    employee_id                   bigint,
    name                          varchar(255),
    address_line1                 varchar(255),
    address_line2                 varchar(255),
    city                          varchar(255),
    version                       bigint not null,
    constraint pk_addr primary key (id)
  );
  
  create table address (
    oid                           bigint generated by default as identity not null,
    street                        varchar(255),
    version                       integer not null,
    constraint pk_address primary key (oid)
  );
  
  create table o_address (
    id                            integer generated by default as identity not null,
    line_1                        varchar(100),
    line_2                        varchar(100),
    city                          varchar(100),
    cretime                       timestamp,
    country_code                  varchar(2),
    updtime                       timestamp not null,
    constraint pk_o_address primary key (id)
  );
  
  create table album (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    cover_id                      bigint,
    deleted                       boolean default false not null,
    created_at                    timestamp not null,
    last_update                   timestamp not null,
    constraint uq_album_cover_id unique (cover_id),
    constraint pk_album primary key (id)
  );
  
  create table animal (
    species                       varchar(255) not null,
    id                            bigint generated by default as identity not null,
    shelter_id                    bigint,
    version                       bigint not null,
    name                          varchar(255),
    registration_number           varchar(255),
    date_of_birth                 date,
    dog_size                      varchar(255),
    constraint pk_animal primary key (id)
  );
  
  create table animal_shelter (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_animal_shelter primary key (id)
  );
  
  create table app_config (
    id                            integer generated by default as identity not null,
    constraint pk_app_config primary key (id)
  );
  
  create table app_config_control (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    config_id                     integer,
    constraint pk_app_config_control primary key (id)
  );
  
  create table article (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    author                        varchar(255),
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_article primary key (id)
  );
  
  create table attribute (
    option_type                   integer(31) not null,
    id                            integer generated by default as identity not null,
    attribute_holder_id           integer,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_attribute primary key (id)
  );
  
  create table attribute_holder (
    id                            integer generated by default as identity not null,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_attribute_holder primary key (id)
  );
  
  create table audit_log (
    id                            bigint generated by default as identity (start with 1000 cache 100) not null,
    description                   varchar(255),
    modified_description          varchar(255),
    constraint pk_audit_log primary key (id)
  );
  
  create table bbookmark (
    id                            integer generated by default as identity not null,
    bookmark_reference            varchar(255),
    user_id                       integer,
    constraint pk_bbookmark primary key (id)
  );
  
  create table bbookmark_org (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    constraint pk_bbookmark_org primary key (id)
  );
  
  create table bbookmark_user (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    password                      varchar(255),
    email_address                 varchar(255),
    country                       varchar(255),
    org_id                        integer,
    constraint pk_bbookmark_user primary key (id)
  );
  
  create table bsimple_with_gen (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    constraint pk_bsimple_with_gen primary key (id)
  );
  
  create table bsite (
    id                            uuid not null,
    name                          varchar(255),
    constraint pk_bsite primary key (id)
  );
  
  create table bsite_user_a (
    site_id                       uuid not null,
    user_id                       uuid not null,
    access_level                  integer,
    version                       bigint not null,
    constraint ck_bsite_user_a_access_level check ( access_level in (0,1,2)),
    constraint pk_bsite_user_a primary key (site_id,user_id)
  );
  
  create table bsite_user_b (
    site                          uuid not null,
    usr                           uuid not null,
    access_level                  integer,
    constraint ck_bsite_user_b_access_level check ( access_level in (0,1,2)),
    constraint pk_bsite_user_b primary key (site,usr)
  );
  
  create table bsite_user_c (
    site_uid                      uuid not null,
    user_uid                      uuid not null,
    access_level                  integer,
    constraint ck_bsite_user_c_access_level check ( access_level in (0,1,2)),
    constraint pk_bsite_user_c primary key (site_uid,user_uid)
  );
  
  create table bsite_user_d (
    site_id                       uuid not null,
    user_id                       uuid not null,
    access_level                  integer,
    version                       bigint not null,
    constraint ck_bsite_user_d_access_level check ( access_level in (0,1,2)),
    constraint pk_bsite_user_d primary key (site_id,user_id)
  );
  
  create table bsite_user_dmany (
    site_id                       uuid not null,
    user_id                       uuid not null,
    name                          varchar(255) not null,
    many                          varchar(255),
    version                       bigint not null,
    constraint pk_bsite_user_dmany primary key (site_id,user_id,name)
  );
  
  create table bsite_user_e (
    site_id                       uuid not null,
    user_id                       uuid not null,
    access_level                  integer,
    constraint ck_bsite_user_e_access_level check ( access_level in (0,1,2))
  );
  
  create table buser (
    id                            uuid not null,
    name                          varchar(255),
    constraint pk_buser primary key (id)
  );
  
  create table bwith_qident (
    id                            integer generated by default as identity not null,
    "Name"                        varchar(191),
    "CODE"                        varchar(255),
    last_updated                  timestamp not null,
    constraint uq_bwith_qident_name unique ("Name"),
    constraint pk_bwith_qident primary key (id)
  );
  
  create table basic_draftable_bean (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_basic_draftable_bean primary key (id)
  );
  
  create table basic_draftable_bean_draft (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_basic_draftable_bean_draft primary key (id)
  );
  
  create table basic_joda_entity (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    period                        varchar(50),
    local_date                    date,
    created                       timestamp not null,
    updated                       timestamp not null,
    version                       timestamp not null,
    constraint pk_basic_joda_entity primary key (id)
  );
  
  create table bean_with_time_zone (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    timezone                      varchar(20),
    constraint pk_bean_with_time_zone primary key (id)
  );
  
  create table drel_booking (
    id                            bigint not null,
    booking_uid                   bigint,
    agent_invoice                 bigint,
    client_invoice                bigint,
    version                       integer not null,
    constraint uq_drel_booking_booking_uid unique (booking_uid),
    constraint uq_drel_booking_agent_invoice unique (agent_invoice),
    constraint uq_drel_booking_client_invoice unique (client_invoice),
    constraint pk_drel_booking primary key (id)
  );
  create sequence drel_booking_seq increment by 1;
  
  create table bw_bean (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    flags                         integer not null,
    version                       bigint not null,
    constraint pk_bw_bean primary key (id)
  );
  
  create table cepcategory (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_cepcategory primary key (id)
  );
  
  create table cepproduct (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_cepproduct primary key (id)
  );
  
  create table cepproduct_category (
    customer_id                   bigint not null,
    address_id                    bigint not null,
    category_id                   bigint not null,
    product_id                    bigint not null,
    priority                      integer
  );
  
  create table ciaddress (
    id                            bigint generated by default as identity not null,
    street_id                     bigint,
    constraint pk_ciaddress primary key (id)
  );
  
  create table cicustomer_parent (
    dtype                         integer(31) not null,
    id                            bigint generated by default as identity not null,
    address_id                    bigint,
    notes                         varchar(255),
    constraint pk_cicustomer_parent primary key (id)
  );
  
  create table cistreet_parent (
    dtype                         integer(31) not null,
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    num                           varchar(255),
    constraint pk_cistreet_parent primary key (id)
  );
  
  create table cinh_ref (
    id                            integer generated by default as identity not null,
    ref_id                        integer,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_cinh_ref primary key (id)
  );
  
  create table cinh_root (
    dtype                         varchar(3) not null,
    id                            integer generated by default as identity not null,
    license_number                varchar(255),
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    driver                        varchar(255),
    notes                         varchar(255),
    action                        varchar(255),
    constraint pk_cinh_root primary key (id)
  );
  
  create table ckey_assoc (
    id                            integer generated by default as identity not null,
    assoc_one                     varchar(255),
    constraint pk_ckey_assoc primary key (id)
  );
  
  create table ckey_detail (
    id                            integer generated by default as identity not null,
    something                     varchar(255),
    one_key                       integer,
    two_key                       varchar(127),
    constraint pk_ckey_detail primary key (id)
  );
  
  create table ckey_parent (
    one_key                       integer not null,
    two_key                       varchar(127) not null,
    name                          varchar(255),
    assoc_id                      integer,
    version                       integer not null,
    constraint pk_ckey_parent primary key (one_key,two_key)
  );
  
  create table coone (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_coone primary key (id)
  );
  
  create table coone_many (
    id                            bigint generated by default as identity not null,
    coone_id                      bigint not null,
    name                          varchar(255),
    deleted                       boolean default false not null,
    constraint pk_coone_many primary key (id)
  );
  
  create table coroot (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    one_id                        bigint,
    constraint uq_coroot_one_id unique (one_id),
    constraint pk_coroot primary key (id)
  );
  
  create table calcd_data (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    constraint pk_calcd_data primary key (id)
  );
  
  create table calcd_input (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    constraint pk_calcd_input primary key (id)
  );
  
  create table calculation_result (
    id                            integer generated by default as identity not null,
    charge                        double not null,
    product_configuration_id      integer,
    group_configuration_id        integer,
    constraint pk_calculation_result primary key (id)
  );
  
  create table cao_bean (
    x_cust_id                     integer not null,
    x_type_id                     integer not null,
    description                   varchar(255),
    version                       bigint not null,
    constraint pk_cao_bean primary key (x_cust_id,x_type_id)
  );
  
  create table sp_car_car (
    id                            bigint not null,
    name                          varchar(255),
    version                       integer not null,
    constraint pk_sp_car_car primary key (id)
  );
  create sequence sp_car_car_seq increment by 1;
  
  create table sp_car_car_wheels (
    car                           bigint not null,
    wheel                         bigint not null,
    constraint pk_sp_car_car_wheels primary key (car,wheel)
  );
  
  create table sp_car_car_doors (
    car                           bigint not null,
    door                          bigint not null,
    constraint pk_sp_car_car_doors primary key (car,door)
  );
  
  create table sa_car (
    id                            bigint not null,
    brand                         varchar(255),
    sold                          integer not null,
    version                       integer not null,
    constraint pk_sa_car primary key (id)
  );
  create sequence sa_car_seq increment by 1;
  
  create table car_accessory (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    fuse_id                       bigint not null,
    car_id                        integer,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_car_accessory primary key (id)
  );
  
  create table car_fuse (
    id                            bigint generated by default as identity not null,
    location_code                 varchar(255),
    constraint pk_car_fuse primary key (id)
  );
  
  create table category (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    surveyobjectid                bigint,
    sequence_number               integer not null,
    constraint pk_category primary key (id)
  );
  
  create table e_save_test_d (
    id                            bigint generated by default as identity not null,
    parent_id                     bigint,
    test_property                 boolean default false not null,
    version                       bigint not null,
    constraint uq_e_save_test_d_parent_id unique (parent_id),
    constraint pk_e_save_test_d primary key (id)
  );
  
  create table child_person (
    identifier                    integer generated by default as identity not null,
    name                          varchar(255),
    age                           integer,
    some_bean_id                  integer,
    parent_identifier             integer,
    family_name                   varchar(255),
    address                       varchar(255),
    constraint pk_child_person primary key (identifier)
  );
  
  create table child_with_cache (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    address                       varchar(255),
    constraint pk_child_with_cache primary key (id)
  );
  
  create table cke_client (
    cod_cpny                      integer not null,
    cod_client                    varchar(100) not null,
    username                      varchar(100) not null,
    notes                         varchar(255),
    constraint pk_cke_client primary key (cod_cpny,cod_client)
  );
  
  create table cke_user (
    username                      varchar(100) not null,
    cod_cpny                      integer not null,
    name                          varchar(255),
    constraint pk_cke_user primary key (username,cod_cpny)
  );
  
  create table class_super (
    dtype                         varchar(31) not null,
    sid                           bigint generated by default as identity not null,
    constraint pk_class_super primary key (sid)
  );
  
  create table class_super_monkey (
    class_super_sid               bigint not null,
    monkey_mid                    bigint not null,
    constraint uq_class_super_monkey_mid unique (monkey_mid),
    constraint pk_class_super_monkey primary key (class_super_sid,monkey_mid)
  );
  
  create table configuration (
    type                          varchar(21) not null,
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    configurations_id             integer,
    group_name                    varchar(255),
    product_name                  varchar(255),
    constraint pk_configuration primary key (id)
  );
  
  create table configurations (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    constraint pk_configurations primary key (id)
  );
  
  create table contact (
    id                            integer generated by default as identity not null,
    first_name                    varchar(127),
    last_name                     varchar(127),
    phone                         varchar(255),
    mobile                        varchar(255),
    email                         varchar(255),
    is_member                     boolean default false not null,
    customer_id                   integer not null,
    group_id                      integer,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    constraint pk_contact primary key (id)
  );
  
  create table contact_group (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_contact_group primary key (id)
  );
  
  create table contact_note (
    id                            integer generated by default as identity not null,
    contact_id                    integer,
    title                         varchar(255),
    note                          clob,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_contact_note primary key (id)
  );
  
  create table contract (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_contract primary key (id)
  );
  
  create table contract_costs (
    id                            bigint generated by default as identity not null,
    status                        varchar(255),
    position_id                   bigint not null,
    constraint pk_contract_costs primary key (id)
  );
  
  create table c_conversation (
    id                            bigint generated by default as identity not null,
    title                         varchar(255),
    isopen                        boolean default false not null,
    group_id                      bigint,
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_c_conversation primary key (id)
  );
  
  create table o_country (
    code                          varchar(2) not null,
    name                          varchar(60),
    constraint pk_o_country primary key (code)
  );
  
  create table cover (
    id                            bigint generated by default as identity not null,
    s3_url                        varchar(255),
    deleted                       boolean default false not null,
    constraint pk_cover primary key (id)
  );
  
  create table o_customer (
    id                            integer generated by default as identity not null,
    status                        varchar(1),
    name                          varchar(40) not null,
    smallnote                     varchar(100),
    anniversary                   date,
    billing_address_id            integer,
    shipping_address_id           integer,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint ck_o_customer_status check ( status in ('N','A','I')),
    constraint pk_o_customer primary key (id)
  );
  comment on table o_customer is 'Holds external customers';
  comment on column o_customer.status is 'status of the customer';
  comment on column o_customer.smallnote is 'Short notes regarding the customer';
  comment on column o_customer.anniversary is 'Join date of the customer';
  
  create table dcredit (
    id                            bigint generated by default as identity not null,
    credit                        varchar(255),
    constraint pk_dcredit primary key (id)
  );
  
  create table dcredit_drol (
    dcredit_id                    bigint not null,
    drol_id                       bigint not null,
    constraint pk_dcredit_drol primary key (dcredit_id,drol_id)
  );
  
  create table dexh_entity (
    oid                           bigint generated by default as identity not null,
    exhange                       varchar(255),
    an_enum_type                  varchar(255),
    last_updated                  timestamp not null,
    constraint pk_dexh_entity primary key (oid)
  );
  
  create table dint_parent (
    type                          integer(31) not null,
    id                            bigint generated by default as identity not null,
    val                           integer,
    more                          varchar(255),
    constraint pk_dint_parent primary key (id)
  );
  
  create table dmachine (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    organisation_id               bigint,
    version                       bigint not null,
    constraint pk_dmachine primary key (id)
  );
  
  create table d_machine_aux_use (
    id                            bigint generated by default as identity not null,
    machine_id                    bigint not null,
    name                          varchar(255),
    edate                         date,
    use_secs                      bigint not null,
    fuel                          decimal(16,3),
    version                       bigint not null,
    constraint pk_d_machine_aux_use primary key (id)
  );
  
  create table d_machine_stats (
    id                            bigint generated by default as identity not null,
    machine_id                    bigint not null,
    edate                         date,
    total_kms                     bigint not null,
    hours                         bigint not null,
    rate                          decimal(16,3),
    cost                          decimal(16,3),
    version                       bigint not null,
    constraint pk_d_machine_stats primary key (id)
  );
  
  create table d_machine_use (
    id                            bigint generated by default as identity not null,
    machine_id                    bigint not null,
    edate                         date,
    distance_kms                  bigint not null,
    time_secs                     bigint not null,
    fuel                          decimal(9,3),
    version                       bigint not null,
    constraint pk_d_machine_use primary key (id)
  );
  
  create table dorg (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_dorg primary key (id)
  );
  
  create table dperson (
    id                            bigint generated by default as identity not null,
    first_name                    varchar(255),
    last_name                     varchar(255),
    salary                        decimal(16,3),
    constraint pk_dperson primary key (id)
  );
  
  create table drol (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_drol primary key (id)
  );
  
  create table drot (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_drot primary key (id)
  );
  
  create table drot_drol (
    drot_id                       bigint not null,
    drol_id                       bigint not null,
    constraint pk_drot_drol primary key (drot_id,drol_id)
  );
  
  create table rawinherit_data (
    id                            bigint generated by default as identity not null,
    val                           integer,
    constraint pk_rawinherit_data primary key (id)
  );
  
  create table data_container (
    id                            uuid not null,
    content                       varchar(255),
    constraint pk_data_container primary key (id)
  );
  
  create table dc_detail (
    id                            bigint generated by default as identity not null,
    master_id                     bigint,
    description                   varchar(255),
    version                       bigint not null,
    constraint pk_dc_detail primary key (id)
  );
  
  create table dc_master (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_dc_master primary key (id)
  );
  
  create table defaults_model (
    id                            integer generated by default as identity not null,
    constraint pk_defaults_model primary key (id)
  );
  
  create table defaults_model_draft (
    id                            integer generated by default as identity not null,
    constraint pk_defaults_model_draft primary key (id)
  );
  
  create table dfk_cascade (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    one_id                        bigint,
    constraint pk_dfk_cascade primary key (id)
  );
  
  create table dfk_cascade_one (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_dfk_cascade_one primary key (id)
  );
  
  create table dfk_none (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    one_id                        bigint,
    constraint pk_dfk_none primary key (id)
  );
  
  create table dfk_none_via_join (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    one_id                        bigint,
    constraint pk_dfk_none_via_join primary key (id)
  );
  
  create table dfk_none_via_mto_m (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_dfk_none_via_mto_m primary key (id)
  );
  
  create table dfk_none_via_mto_m_dfk_one (
    dfk_none_via_mto_m_id         bigint not null,
    dfk_one_id                    bigint not null,
    constraint pk_dfk_none_via_mto_m_dfk_one primary key (dfk_none_via_mto_m_id,dfk_one_id)
  );
  
  create table dfk_one (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_dfk_one primary key (id)
  );
  
  create table dfk_set_null (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    one_id                        bigint,
    constraint pk_dfk_set_null primary key (id)
  );
  
  create table doc (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_doc primary key (id)
  );
  
  create table doc_link (
    doc_id                        bigint not null,
    link_id                       bigint not null,
    constraint pk_doc_link primary key (doc_id,link_id)
  );
  
  create table doc_link_draft (
    doc_id                        bigint not null,
    link_id                       bigint not null,
    constraint pk_doc_link_draft primary key (doc_id,link_id)
  );
  
  create table doc_draft (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_doc_draft primary key (id)
  );
  
  create table document (
    id                            bigint generated by default as identity not null,
    title                         varchar(127),
    body                          varchar(255),
    organisation_id               bigint,
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint uq_document_title unique (title),
    constraint pk_document primary key (id)
  );
  
  create table document_draft (
    id                            bigint generated by default as identity not null,
    title                         varchar(127),
    body                          varchar(255),
    when_publish                  timestamp,
    organisation_id               bigint,
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint uq_document_draft_title unique (title),
    constraint pk_document_draft primary key (id)
  );
  
  create table document_media (
    id                            bigint generated by default as identity not null,
    document_id                   bigint,
    name                          varchar(255),
    description                   varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_document_media primary key (id)
  );
  
  create table document_media_draft (
    id                            bigint generated by default as identity not null,
    document_id                   bigint,
    name                          varchar(255),
    description                   varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_document_media_draft primary key (id)
  );
  
  create table sp_car_door (
    id                            bigint not null,
    name                          varchar(255),
    version                       integer not null,
    constraint pk_sp_car_door primary key (id)
  );
  create sequence sp_car_door_seq increment by 1;
  
  create table earray_bean (
    id                            bigint generated by default as identity not null,
    foo                           integer,
    name                          varchar(255),
    phone_numbers                 array,
    uids                          array not null,
    other_ids                     array,
    doubs                         array,
    statuses                      array,
    vc_enums                      array,
    int_enums                     array,
    status2                       array,
    version                       bigint not null,
    constraint ck_earray_bean_foo check ( foo in (100,101,102)),
    constraint pk_earray_bean primary key (id)
  );
  
  create table earray_set_bean (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    phone_numbers                 array,
    uids                          array,
    other_ids                     array,
    doubs                         array,
    status                        array,
    version                       bigint not null,
    constraint pk_earray_set_bean primary key (id)
  );
  
  create table e_basic (
    id                            integer generated by default as identity not null,
    status                        varchar(1),
    name                          varchar(127),
    description                   varchar(255),
    some_date                     timestamp,
    constraint ck_e_basic_status check ( status in ('N','A','I')),
    constraint pk_e_basic primary key (id)
  );
  
  create table ebasic_change_log (
    id                            bigint generated by default as identity not null,
    name                          varchar(20),
    short_description             varchar(50),
    long_description              varchar(100),
    plain_bean                    varchar(500),
    who_created                   varchar(255) not null,
    who_modified                  varchar(255) not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    version                       bigint not null,
    constraint pk_ebasic_change_log primary key (id)
  );
  
  create table ebasic_clob (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    title                         varchar(255),
    description                   clob,
    last_update                   timestamp not null,
    constraint pk_ebasic_clob primary key (id)
  );
  
  create table ebasic_clob_fetch_eager (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    title                         varchar(255),
    description                   clob,
    last_update                   timestamp not null,
    constraint pk_ebasic_clob_fetch_eager primary key (id)
  );
  
  create table ebasic_clob_no_ver (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    description                   clob,
    constraint pk_ebasic_clob_no_ver primary key (id)
  );
  
  create table e_basicenc (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    description                   varbinary(80),
    dob                           varbinary(80),
    status                        varbinary(20),
    last_update                   timestamp,
    constraint pk_e_basicenc primary key (id)
  );
  
  create table e_basicenc_bin (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    description                   varchar(255),
    data                          blob,
    some_time                     varbinary(255),
    last_update                   timestamp not null,
    constraint pk_e_basicenc_bin primary key (id)
  );
  
  create table e_basicenc_client (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    description                   varbinary(80),
    dob                           varbinary(20),
    status                        varbinary(20),
    version                       bigint not null,
    constraint pk_e_basicenc_client primary key (id)
  );
  
  create table e_basicenc_relate (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    other_id                      integer,
    constraint pk_e_basicenc_relate primary key (id)
  );
  
  create table e_basic_enum_id (
    status                        varchar(1) not null,
    name                          varchar(255),
    description                   varchar(255),
    constraint ck_e_basic_enum_id_status check ( status in ('N','A','I')),
    constraint pk_e_basic_enum_id primary key (status)
  );
  
  create table e_basic_eni (
    id                            integer generated by default as identity not null,
    status                        integer,
    name                          varchar(255),
    description                   varchar(255),
    some_date                     timestamp,
    constraint ck_e_basic_eni_status check ( status in (1,2,3)),
    constraint pk_e_basic_eni primary key (id)
  );
  
  create table ebasic_hstore (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    map                           varchar(800),
    version                       bigint not null,
    constraint pk_ebasic_hstore primary key (id)
  );
  
  create table ebasic_json_jackson (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    value_set                     varchar(700),
    value_list                    clob,
    value_map                     varchar(700),
    plain_value                   varchar(500),
    version                       bigint not null,
    constraint pk_ebasic_json_jackson primary key (id)
  );
  
  create table ebasic_json_jackson2 (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    value_set                     varchar(700),
    value_list                    clob,
    value_map                     varchar(700),
    plain_value                   varchar(500),
    version                       bigint not null,
    constraint pk_ebasic_json_jackson2 primary key (id)
  );
  
  create table ebasic_json_jackson3 (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    plain_value                   varchar(500),
    plain_value2                  varchar(500),
    plain_value3                  varchar(500),
    version                       bigint not null,
    constraint pk_ebasic_json_jackson3 primary key (id)
  );
  
  create table ebasic_json_list (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    beans                         varchar(700),
    bean_list                     clob,
    bean_map                      varchar(700),
    plain_bean                    varchar(500),
    flags                         varchar(50),
    tags                          varchar(100),
    version                       bigint not null,
    constraint pk_ebasic_json_list primary key (id)
  );
  
  create table ebasic_json_map (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    content                       clob,
    version                       bigint not null,
    constraint pk_ebasic_json_map primary key (id)
  );
  
  create table ebasic_json_map_blob (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    content                       blob,
    version                       bigint not null,
    constraint pk_ebasic_json_map_blob primary key (id)
  );
  
  create table ebasic_json_map_clob (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    content                       clob,
    version                       bigint not null,
    constraint pk_ebasic_json_map_clob primary key (id)
  );
  
  create table ebasic_json_map_detail (
    id                            bigint generated by default as identity not null,
    owner_id                      bigint,
    name                          varchar(255),
    content                       clob,
    version                       bigint not null,
    constraint pk_ebasic_json_map_detail primary key (id)
  );
  
  create table ebasic_json_map_json_b (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    content                       clob,
    version                       bigint not null,
    constraint pk_ebasic_json_map_json_b primary key (id)
  );
  
  create table ebasic_json_map_varchar (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    content                       varchar(3000),
    version                       bigint not null,
    constraint pk_ebasic_json_map_varchar primary key (id)
  );
  
  create table ebasic_json_multi (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    plain_value1                  varchar(500),
    plain_value2                  varchar(500),
    plain_value3                  varchar(500),
    version                       bigint not null,
    constraint pk_ebasic_json_multi primary key (id)
  );
  
  create table ebasic_json_node (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    content                       clob,
    version                       bigint not null,
    constraint pk_ebasic_json_node primary key (id)
  );
  
  create table ebasic_json_node_blob (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    content                       blob,
    version                       bigint not null,
    constraint pk_ebasic_json_node_blob primary key (id)
  );
  
  create table ebasic_json_node_json_b (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    content                       clob,
    version                       bigint not null,
    constraint pk_ebasic_json_node_json_b primary key (id)
  );
  
  create table ebasic_json_node_varchar (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    content                       varchar(1000),
    version                       bigint not null,
    constraint pk_ebasic_json_node_varchar primary key (id)
  );
  
  create table ebasic_json_unmapped (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_ebasic_json_unmapped primary key (id)
  );
  
  create table e_basic_log (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_e_basic_log primary key (id)
  );
  
  create table e_basic_ndc (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    constraint pk_e_basic_ndc primary key (id)
  );
  
  create table ebasic_no_sdchild (
    id                            bigint generated by default as identity not null,
    owner_id                      bigint not null,
    child_name                    varchar(255),
    amount                        bigint not null,
    version                       bigint not null,
    constraint pk_ebasic_no_sdchild primary key (id)
  );
  
  create table ebasic_old_value (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    string_set                    clob,
    long_set                      clob,
    int_set                       clob,
    string_list                   clob,
    long_list                     clob,
    int_list                      clob,
    object_map                    clob,
    long_map                      clob,
    int_map                       clob,
    json_node                     clob,
    string_arr                    array,
    constraint pk_ebasic_old_value primary key (id)
  );
  
  create table ebasic_plain (
    id                            bigint generated by default as identity not null,
    attr                          varchar(255),
    plain_bean                    varchar(500),
    plain_bean2                   varchar(500),
    version                       bigint not null,
    constraint pk_ebasic_plain primary key (id)
  );
  
  create table ebasic_sdchild (
    id                            bigint generated by default as identity not null,
    owner_id                      bigint not null,
    child_name                    varchar(255),
    amount                        bigint not null,
    version                       bigint not null,
    deleted                       boolean default false not null,
    constraint pk_ebasic_sdchild primary key (id)
  );
  
  create table ebasic_soft_delete (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    description                   varchar(255),
    version                       bigint not null,
    deleted                       boolean default false not null,
    constraint pk_ebasic_soft_delete primary key (id)
  );
  
  create table e_basicver (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    description                   varchar(255),
    other                         varchar(255),
    last_update                   timestamp not null,
    constraint pk_e_basicver primary key (id)
  );
  
  create table e_basic_withlife (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    other                         varchar(255),
    deleted                       boolean default false not null,
    version                       bigint not null,
    constraint pk_e_basic_withlife primary key (id)
  );
  
  create table e_basic_with_ex (
    id                            bigint generated by default as identity not null,
    deleted                       boolean default false not null,
    version                       bigint not null,
    constraint pk_e_basic_with_ex primary key (id)
  );
  
  create table e_basic_withlog (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    deleted                       boolean default false not null,
    version                       bigint not null,
    constraint pk_e_basic_withlog primary key (id)
  );
  
  create table e_basicverucon (
    id                            integer generated by default as identity not null,
    name                          varchar(127),
    other                         varchar(127),
    other_one                     varchar(127),
    description                   varchar(255),
    last_update                   timestamp not null,
    constraint uq_e_basicverucon_name unique (name),
    constraint uq_e_basicverucon_other_other_one unique (other,other_one),
    constraint pk_e_basicverucon primary key (id)
  );
  
  create table ecache_child (
    id                            uuid not null,
    name                          varchar(100),
    root_id                       uuid not null,
    constraint pk_ecache_child primary key (id)
  );
  
  create table ecache_root (
    id                            uuid not null,
    name                          varchar(100),
    constraint pk_ecache_root primary key (id)
  );
  
  create table e_col_ab (
    id                            bigint generated by default as identity not null,
    column_a                      varchar(255),
    column_b                      varchar(255),
    constraint pk_e_col_ab primary key (id)
  );
  
  create table ecustom_id (
    id                            varchar(127) not null,
    name                          varchar(255),
    constraint pk_ecustom_id primary key (id)
  );
  
  create table edefault_prop (
    id                            integer generated by default as identity not null,
    e_simple_usertypeid           integer,
    name                          varchar(255),
    constraint uq_edefault_prop_e_simple_usertypeid unique (e_simple_usertypeid),
    constraint pk_edefault_prop primary key (id)
  );
  
  create table eemb_inner (
    id                            integer generated by default as identity not null,
    nome_inner                    varchar(255),
    outer_id                      integer,
    update_count                  integer not null,
    constraint pk_eemb_inner primary key (id)
  );
  
  create table eemb_outer (
    id                            integer generated by default as identity not null,
    nome_outer                    varchar(255),
    date1                         timestamp,
    date2                         timestamp,
    update_count                  integer not null,
    constraint pk_eemb_outer primary key (id)
  );
  
  create table efile2_no_fk (
    file_name                     varchar(64) not null,
    owner_id                      integer not null,
    constraint pk_efile2_no_fk primary key (file_name)
  );
  
  create table efile_no_fk (
    file_name                     varchar(64) not null,
    owner_user_id                 integer,
    owner_soft_del_user_id        integer,
    constraint pk_efile_no_fk primary key (file_name)
  );
  
  create table efile_no_fk_euser_no_fk (
    efile_no_fk_file_name         varchar(64) not null,
    euser_no_fk_user_id           integer not null,
    constraint pk_efile_no_fk_euser_no_fk primary key (efile_no_fk_file_name,euser_no_fk_user_id)
  );
  
  create table efile_no_fk_euser_no_fk_soft_del (
    efile_no_fk_file_name         varchar(64) not null,
    euser_no_fk_soft_del_user_id  integer not null,
    constraint pk_efile_no_fk_euser_no_fk_soft_del primary key (efile_no_fk_file_name,euser_no_fk_soft_del_user_id)
  );
  
  create table egen_props (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    ts_created                    timestamp not null,
    ts_updated                    timestamp not null,
    ldt_created                   timestamp not null,
    ldt_updated                   timestamp not null,
    odt_created                   timestamp not null,
    odt_updated                   timestamp not null,
    zdt_created                   timestamp not null,
    zdt_updated                   timestamp not null,
    instant_created               timestamp not null,
    instant_updated               timestamp not null,
    long_created                  bigint not null,
    long_updated                  bigint not null,
    constraint pk_egen_props primary key (id)
  );
  
  create table eid_uid_bean (
    id                            bigint generated by default as identity not null,
    uuid                          uuid not null,
    name                          varchar(255),
    constraint uq_eid_uid_bean_uuid unique (uuid),
    constraint pk_eid_uid_bean primary key (id)
  );
  
  create table einvoice (
    id                            bigint generated by default as identity not null,
    invoice_date                  timestamp,
    state                         integer,
    person_id                     bigint,
    ship_street                   varchar(255),
    ship_suburb                   varchar(255),
    ship_city                     varchar(255),
    ship_status                   varchar(3),
    ship_jbean                    clob,
    ship_jraw                     clob,
    bill_street                   varchar(255),
    bill_suburb                   varchar(255),
    bill_city                     varchar(255),
    bill_status                   varchar(3),
    bill_jbean                    clob,
    bill_jraw                     clob,
    version                       bigint not null,
    constraint ck_einvoice_state check ( state in (0,1,2)),
    constraint ck_einvoice_ship_status check ( ship_status in ('ONE','TWO')),
    constraint ck_einvoice_bill_status check ( bill_status in ('ONE','TWO')),
    constraint pk_einvoice primary key (id)
  );
  
  create table e_main (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    description                   varchar(255),
    version                       bigint not null,
    constraint pk_e_main primary key (id)
  );
  
  create table enull_collection (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    constraint pk_enull_collection primary key (id)
  );
  
  create table enull_collection_detail (
    id                            integer generated by default as identity not null,
    enull_collection_id           integer not null,
    something                     varchar(255),
    constraint pk_enull_collection_detail primary key (id)
  );
  
  create table eopt_one_a (
    id                            integer generated by default as identity not null,
    name_for_a                    varchar(255),
    b_id                          integer,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_eopt_one_a primary key (id)
  );
  
  create table eopt_one_b (
    id                            integer generated by default as identity not null,
    name_for_b                    varchar(255),
    c_id                          integer not null,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_eopt_one_b primary key (id)
  );
  
  create table eopt_one_c (
    id                            integer generated by default as identity not null,
    name_for_c                    varchar(255),
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_eopt_one_c primary key (id)
  );
  
  create table eper_addr (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    ma_street                     varchar(255),
    ma_suburb                     varchar(255),
    ma_city                       varchar(255),
    ma_country_code               varchar(2),
    version                       bigint not null,
    constraint pk_eper_addr primary key (id)
  );
  
  create table eperson (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    notes                         varchar(255),
    street                        varchar(255),
    suburb                        varchar(255),
    addr_city                     varchar(255),
    addr_status                   varchar(3),
    addr_jbean                    clob,
    jraw                          clob,
    version                       bigint not null,
    constraint ck_eperson_addr_status check ( addr_status in ('ONE','TWO')),
    constraint pk_eperson primary key (id)
  );
  
  create table eperson2 (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    notes                         varchar(255),
    street                        varchar(10),
    suburb                        varchar(100),
    city                          varchar(255),
    status                        varchar(3),
    jbean                         clob,
    jraw                          clob,
    version                       bigint not null,
    constraint ck_eperson2_status check ( status in ('ONE','TWO')),
    constraint pk_eperson2 primary key (id)
  );
  
  create table eperson3 (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    street                        varchar(255),
    suburb                        varchar(255),
    city                          varchar(255),
    status                        varchar(3),
    jbean                         clob,
    jraw                          clob,
    version                       bigint not null,
    constraint ck_eperson3_status check ( status in ('ONE','TWO')),
    constraint pk_eperson3 primary key (id)
  );
  
  create table e_person_online (
    id                            bigint generated by default as identity not null,
    email                         varchar(127),
    online_status                 boolean default false not null,
    when_updated                  timestamp not null,
    constraint uq_e_person_online_email unique (email),
    constraint pk_e_person_online primary key (id)
  );
  
  create table esimple (
    usertypeid                    integer generated by default as identity not null,
    name                          varchar(255),
    constraint pk_esimple primary key (usertypeid)
  );
  
  create table esoft_del_book (
    id                            bigint generated by default as identity not null,
    book_title                    varchar(255),
    lend_by_id                    bigint,
    version                       bigint not null,
    deleted                       boolean default false not null,
    constraint pk_esoft_del_book primary key (id)
  );
  
  create table esoft_del_book_esoft_del_user (
    esoft_del_book_id             bigint not null,
    esoft_del_user_id             bigint not null,
    constraint pk_esoft_del_book_esoft_del_user primary key (esoft_del_book_id,esoft_del_user_id)
  );
  
  create table esoft_del_down (
    id                            bigint generated by default as identity not null,
    esoft_del_mid_id              bigint not null,
    down                          varchar(255),
    version                       bigint not null,
    deleted                       boolean default false not null,
    constraint pk_esoft_del_down primary key (id)
  );
  
  create table esoft_del_mid (
    id                            bigint generated by default as identity not null,
    top_id                        bigint,
    mid                           varchar(255),
    up_id                         bigint,
    version                       bigint not null,
    deleted                       boolean default false not null,
    constraint pk_esoft_del_mid primary key (id)
  );
  
  create table esoft_del_one_a (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    oneb_id                       bigint,
    deleted                       boolean default false not null,
    version                       bigint not null,
    constraint uq_esoft_del_one_a_oneb_id unique (oneb_id),
    constraint pk_esoft_del_one_a primary key (id)
  );
  
  create table esoft_del_one_b (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_esoft_del_one_b primary key (id)
  );
  
  create table esoft_del_role (
    id                            bigint generated by default as identity not null,
    role_name                     varchar(255),
    version                       bigint not null,
    deleted                       boolean default false not null,
    constraint pk_esoft_del_role primary key (id)
  );
  
  create table esoft_del_role_esoft_del_user (
    esoft_del_role_id             bigint not null,
    esoft_del_user_id             bigint not null,
    constraint pk_esoft_del_role_esoft_del_user primary key (esoft_del_role_id,esoft_del_user_id)
  );
  
  create table esoft_del_top (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    deleted                       boolean default false not null,
    constraint pk_esoft_del_top primary key (id)
  );
  
  create table esoft_del_up (
    id                            bigint generated by default as identity not null,
    up                            varchar(255),
    version                       bigint not null,
    deleted                       boolean default false not null,
    constraint pk_esoft_del_up primary key (id)
  );
  
  create table esoft_del_user (
    id                            bigint generated by default as identity not null,
    user_name                     varchar(255),
    version                       bigint not null,
    deleted                       boolean default false not null,
    constraint pk_esoft_del_user primary key (id)
  );
  
  create table esoft_del_user_esoft_del_role (
    esoft_del_user_id             bigint not null,
    esoft_del_role_id             bigint not null,
    constraint pk_esoft_del_user_esoft_del_role primary key (esoft_del_user_id,esoft_del_role_id)
  );
  
  create table esoft_del_x (
    id                            uuid not null,
    y_id                          bigint,
    organization_id               bigint,
    deleted                       boolean default false not null,
    constraint uq_esoft_del_x_y_id unique (y_id),
    constraint pk_esoft_del_x primary key (id)
  );
  
  create table esoft_del_y (
    id                            bigint generated by default as identity not null,
    organization_id               bigint,
    deleted                       boolean default false not null,
    constraint pk_esoft_del_y primary key (id)
  );
  
  create table esoft_del_z (
    id                            bigint generated by default as identity not null,
    uuid                          uuid,
    deleted                       boolean default false not null,
    constraint pk_esoft_del_z primary key (id)
  );
  
  create table esome_convert_type (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    money                         decimal(16,3),
    constraint pk_esome_convert_type primary key (id)
  );
  
  create table esome_type (
    id                            integer generated by default as identity not null,
    currency                      varchar(3),
    locale                        varchar(20),
    time_zone                     varchar(20),
    constraint pk_esome_type primary key (id)
  );
  
  create table etrans_many (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    constraint pk_etrans_many primary key (id)
  );
  
  create table rawinherit_uncle (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    parent_id                     bigint not null,
    version                       bigint not null,
    constraint pk_rawinherit_uncle primary key (id)
  );
  
  create table euser_no_fk (
    user_id                       integer generated by default as identity not null,
    user_name                     varchar(255),
    constraint pk_euser_no_fk primary key (user_id)
  );
  
  create table euser_no_fk_soft_del (
    user_id                       integer generated by default as identity not null,
    user_name                     varchar(255),
    constraint pk_euser_no_fk_soft_del primary key (user_id)
  );
  
  create table evanilla_collection (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    constraint pk_evanilla_collection primary key (id)
  );
  
  create table evanilla_collection_detail (
    id                            integer generated by default as identity not null,
    evanilla_collection_id        integer not null,
    something                     varchar(255),
    constraint pk_evanilla_collection_detail primary key (id)
  );
  
  create table ewho_props (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    who_created                   varchar(255) not null,
    who_modified                  varchar(255) not null,
    constraint pk_ewho_props primary key (id)
  );
  
  create table e_withinet (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    inet_address                  varchar(50),
    inet2                         varchar(255),
    cidr                          varchar(50),
    version                       bigint not null,
    constraint pk_e_withinet primary key (id)
  );
  
  create table ec_enum_person (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_ec_enum_person primary key (id)
  );
  
  create table ec_enum_person_tags (
    ec_enum_person_id             bigint not null,
    value                         varchar(5) not null,
    constraint ck_ec_enum_person_tags_value check ( value in ('RED','BLUE','GREEN'))
  );
  
  create table ec_person (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_ec_person primary key (id)
  );
  
  create table ec_person_phone (
    owner_id                      bigint not null,
    phone                         varchar(255) not null
  );
  
  create table ec_top (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    person_id                     bigint,
    version                       bigint not null,
    constraint pk_ec_top primary key (id)
  );
  
  create table ec_top_ecs_person (
    ec_top_id                     bigint not null,
    ecs_person_id                 bigint not null,
    constraint pk_ec_top_ecs_person primary key (ec_top_id,ecs_person_id)
  );
  
  create table ecbl_person (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_ecbl_person primary key (id)
  );
  
  create table ecbl_person_phone_numbers (
    person_id                     bigint not null,
    country_code                  varchar(2),
    area                          varchar(6),
    phnum                         varchar(20)
  );
  
  create table ecbm_person (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_ecbm_person primary key (id)
  );
  
  create table ecbm_person_phone_numbers (
    person_id                     bigint not null,
    mkey                          varchar(255) not null,
    country_code                  varchar(2),
    area                          varchar(6),
    phnum                         varchar(20)
  );
  
  create table ecm_person (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_ecm_person primary key (id)
  );
  
  create table ecm_person_phone_numbers (
    ecm_person_id                 bigint not null,
    type                          varchar(4) not null,
    phnum                         varchar(10) not null
  );
  
  create table ecmc_person (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_ecmc_person primary key (id)
  );
  
  create table ecmc_person_phone_numbers (
    ecmc_person_id                bigint not null,
    type                          varchar(4) not null,
    value                         clob not null
  );
  
  create table ecs_person (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_ecs_person primary key (id)
  );
  
  create table ecs_person_phone (
    ecs_person_id                 bigint not null,
    phone                         varchar(255) not null
  );
  
  create table ecsm_child (
    one_id                        uuid not null,
    ecsm_parent_id                bigint not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_ecsm_child primary key (one_id)
  );
  
  create table ecsm_values (
    host_id                       uuid not null,
    value                         varchar(255) not null
  );
  
  create table ecsm_one (
    one_id                        uuid not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_ecsm_one primary key (one_id)
  );
  
  create table ecsm_parent (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_ecsm_parent primary key (id)
  );
  
  create table ecsm_two (
    id                            uuid not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_ecsm_two primary key (id)
  );
  
  create table td_child (
    child_id                      integer generated by default as identity not null,
    child_name                    varchar(255),
    parent_id                     integer not null,
    constraint pk_td_child primary key (child_id)
  );
  
  create table td_parent (
    parent_type                   varchar(31) not null,
    parent_id                     integer generated by default as identity not null,
    parent_name                   varchar(255),
    extended_name                 varchar(255),
    constraint pk_td_parent primary key (parent_id)
  );
  
  create table element_bean (
    id                            bigint generated by default as identity not null,
    complex_bean_id               uuid not null,
    value                         varchar(255) not null,
    constraint pk_element_bean primary key (id)
  );
  
  create table empl (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    age                           integer,
    default_address_id            bigint,
    constraint pk_empl primary key (id)
  );
  
  create table esd_detail (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    master_id                     bigint not null,
    version                       bigint not null,
    deleted                       boolean default false not null,
    constraint pk_esd_detail primary key (id)
  );
  
  create table esd_master (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    deleted                       boolean default false not null,
    constraint pk_esd_master primary key (id)
  );
  
  create table feature_desc (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    description                   varchar(255),
    constraint pk_feature_desc primary key (id)
  );
  
  create table f_first (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_f_first primary key (id)
  );
  
  create table foo (
    foo_id                        integer generated by default as identity not null,
    important_text                varchar(255),
    version                       integer not null,
    constraint pk_foo primary key (foo_id)
  );
  
  create table gen_key_identity (
    id                            bigint generated by default as identity not null,
    description                   varchar(255),
    constraint pk_gen_key_identity primary key (id)
  );
  
  create table gen_key_sequence (
    id                            bigint not null,
    description                   varchar(255),
    constraint pk_gen_key_sequence primary key (id)
  );
  create sequence SEQ_NAME increment by 1;
  
  create table grand_parent_person (
    identifier                    integer generated by default as identity not null,
    name                          varchar(255),
    age                           integer,
    some_bean_id                  integer,
    family_name                   varchar(255),
    address                       varchar(255),
    constraint pk_grand_parent_person primary key (identifier)
  );
  
  create table survey_group (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    categoryobjectid              bigint,
    sequence_number               integer not null,
    constraint pk_survey_group primary key (id)
  );
  
  create table c_group (
    id                            bigint generated by default as identity not null,
    inactive                      boolean default false not null,
    name                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_c_group primary key (id)
  );
  
  create table hembi_bean (
    part                          bigint not null,
    brand                         varchar(20) not null,
    name                          varchar(255),
    description                   varchar(255),
    version                       bigint not null,
    constraint pk_hembi_bean primary key (part,brand)
  );
  
  create table he_doc (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_he_doc primary key (id)
  );
  
  create table hx_link (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    location                      varchar(255),
    comments                      varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    deleted                       boolean default false not null,
    constraint pk_hx_link primary key (id)
  );
  
  create table hx_link_doc (
    hx_link_id                    bigint not null,
    he_doc_id                     bigint not null,
    constraint pk_hx_link_doc primary key (hx_link_id,he_doc_id)
  );
  
  create table hi_doc (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_hi_doc primary key (id)
  );
  
  create table hi_link (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    location                      varchar(255),
    comments                      varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_hi_link primary key (id)
  );
  
  create table hi_link_doc (
    hi_link_id                    bigint not null,
    hi_doc_id                     bigint not null,
    constraint pk_hi_link_doc primary key (hi_link_id,hi_doc_id)
  );
  
  create table hi_tone (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    comments                      varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_hi_tone primary key (id)
  );
  
  create table hi_tthree (
    id                            bigint generated by default as identity not null,
    hi_ttwo_id                    bigint not null,
    three                         varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_hi_tthree primary key (id)
  );
  
  create table hi_ttwo (
    id                            bigint generated by default as identity not null,
    hi_tone_id                    bigint not null,
    two                           varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_hi_ttwo primary key (id)
  );
  
  create table hsd_setting (
    id                            bigint generated by default as identity not null,
    code                          varchar(255),
    content                       varchar(255),
    user_id                       bigint,
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    deleted                       boolean default false not null,
    constraint uq_hsd_setting_user_id unique (user_id),
    constraint pk_hsd_setting primary key (id)
  );
  
  create table hsd_user (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    deleted                       boolean default false not null,
    constraint pk_hsd_user primary key (id)
  );
  
  create table iaf_segment (
    ptype                         varchar(31) not null,
    id                            bigint generated by default as identity not null,
    segment_id_zat                bigint not null,
    status_id                     bigint not null,
    constraint pk_iaf_segment primary key (id)
  );
  
  create table iaf_segment_status (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_iaf_segment_status primary key (id)
  );
  
  create table imrelated (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    owner_id                      bigint not null,
    constraint pk_imrelated primary key (id)
  );
  
  create table imroot (
    dtype                         varchar(31) not null,
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    title                         varchar(255),
    when_title                    timestamp,
    constraint pk_imroot primary key (id)
  );
  
  create table ixresource (
    dtype                         varchar(255),
    id                            uuid not null,
    name                          varchar(255),
    constraint pk_ixresource primary key (id)
  );
  
  create table info_company (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_info_company primary key (id)
  );
  
  create table info_contact (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    company_id                    bigint not null,
    version                       bigint not null,
    constraint pk_info_contact primary key (id)
  );
  
  create table info_customer (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    company_id                    bigint,
    version                       bigint not null,
    constraint uq_info_customer_company_id unique (company_id),
    constraint pk_info_customer primary key (id)
  );
  
  create table inner_report (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    forecast_id                   bigint,
    constraint uq_inner_report_forecast_id unique (forecast_id),
    constraint pk_inner_report primary key (id)
  );
  
  create table drel_invoice (
    id                            bigint not null,
    booking                       bigint,
    version                       integer not null,
    constraint pk_drel_invoice primary key (id)
  );
  create sequence drel_invoice_seq increment by 1;
  
  create table item (
    customer                      integer not null,
    itemnumber                    varchar(127) not null,
    description                   varchar(255),
    units                         varchar(255),
    type                          integer not null,
    region                        integer not null,
    date_modified                 timestamp,
    date_created                  timestamp,
    modified_by                   varchar(255),
    created_by                    varchar(255),
    version                       bigint not null,
    constraint pk_item primary key (customer,itemnumber)
  );
  
  create table monkey (
    mid                           bigint generated by default as identity not null,
    name                          varchar(255),
    food_preference               varchar(255),
    version                       bigint not null,
    constraint pk_monkey primary key (mid)
  );
  
  create table mkeygroup (
    pid                           bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_mkeygroup primary key (pid)
  );
  
  create table mkeygroup_monkey (
    mkeygroup_pid                 bigint not null,
    monkey_mid                    bigint not null,
    constraint uq_mkeygroup_monkey_mid unique (monkey_mid),
    constraint pk_mkeygroup_monkey primary key (mkeygroup_pid,monkey_mid)
  );
  
  create table trainer (
    tid                           bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_trainer primary key (tid)
  );
  
  create table trainer_monkey (
    trainer_tid                   bigint not null,
    monkey_mid                    bigint not null,
    constraint uq_trainer_monkey_mid unique (monkey_mid),
    constraint pk_trainer_monkey primary key (trainer_tid,monkey_mid)
  );
  
  create table troop (
    pid                           bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_troop primary key (pid)
  );
  
  create table troop_monkey (
    troop_pid                     bigint not null,
    monkey_mid                    bigint not null,
    constraint uq_troop_monkey_mid unique (monkey_mid),
    constraint pk_troop_monkey primary key (troop_pid,monkey_mid)
  );
  
  create table l2_cldf_reset_bean (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_l2_cldf_reset_bean primary key (id)
  );
  
  create table l2_cldf_reset_bean_child (
    id                            bigint generated by default as identity not null,
    parent_id                     bigint,
    constraint pk_l2_cldf_reset_bean_child primary key (id)
  );
  
  create table level1 (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_level1 primary key (id)
  );
  
  create table level1_level4 (
    level1_id                     bigint not null,
    level4_id                     bigint not null,
    constraint pk_level1_level4 primary key (level1_id,level4_id)
  );
  
  create table level1_level2 (
    level1_id                     bigint not null,
    level2_id                     bigint not null,
    constraint pk_level1_level2 primary key (level1_id,level2_id)
  );
  
  create table level2 (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_level2 primary key (id)
  );
  
  create table level2_level3 (
    level2_id                     bigint not null,
    level3_id                     bigint not null,
    constraint pk_level2_level3 primary key (level2_id,level3_id)
  );
  
  create table level3 (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_level3 primary key (id)
  );
  
  create table level4 (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_level4 primary key (id)
  );
  
  create table link (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    location                      varchar(255),
    when_publish                  timestamp,
    link_comment                  varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    deleted                       boolean default false not null,
    constraint pk_link primary key (id)
  );
  
  create table link_draft (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    location                      varchar(255),
    when_publish                  timestamp,
    link_comment                  varchar(255),
    dirty                         boolean default false not null,
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    deleted                       boolean default false not null,
    constraint pk_link_draft primary key (id)
  );
  
  create table la_attr_value (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_la_attr_value primary key (id)
  );
  
  create table la_attr_value_attribute (
    la_attr_value_id              integer not null,
    attribute_id                  integer not null,
    constraint pk_la_attr_value_attribute primary key (la_attr_value_id,attribute_id)
  );
  
  create table looney (
    id                            bigint generated by default as identity not null,
    tune_id                       bigint,
    name                          varchar(255),
    constraint pk_looney primary key (id)
  );
  
  create table m2_mcache_child (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    constraint pk_m2_mcache_child primary key (id)
  );
  
  create table m2_mcache_master (
    id                            integer generated by default as identity not null,
    constraint pk_m2_mcache_master primary key (id)
  );
  
  create table m2mcache_set1 (
    m2_mcache_master_id           integer not null,
    m2_mcache_child_id            integer not null,
    constraint pk_m2mcache_set1 primary key (m2_mcache_master_id,m2_mcache_child_id)
  );
  
  create table m2mcache_set2 (
    m2_mcache_master_id           integer not null,
    m2_mcache_child_id            integer not null,
    constraint pk_m2mcache_set2 primary key (m2_mcache_master_id,m2_mcache_child_id)
  );
  
  create table maddress (
    id                            uuid not null,
    street                        varchar(255),
    city                          varchar(255),
    version                       bigint not null,
    constraint pk_maddress primary key (id)
  );
  
  create table mcontact (
    id                            uuid not null,
    email                         varchar(255),
    first_name                    varchar(255),
    last_name                     varchar(255),
    customer_id                   uuid,
    version                       bigint not null,
    constraint pk_mcontact primary key (id)
  );
  
  create table mcontact_message (
    id                            uuid not null,
    title                         varchar(255),
    subject                       varchar(255),
    notes                         varchar(255),
    contact_id                    uuid not null,
    version                       bigint not null,
    constraint pk_mcontact_message primary key (id)
  );
  
  create table mcustomer (
    id                            uuid not null,
    name                          varchar(255),
    notes                         varchar(255),
    shipping_address_id           uuid,
    billing_address_id            uuid,
    version                       bigint not null,
    constraint pk_mcustomer primary key (id)
  );
  
  create table mgroup (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_mgroup primary key (id)
  );
  
  create table mmachine (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_mmachine primary key (id)
  );
  
  create table mmachine_mgroup (
    mmachine_id                   bigint not null,
    mgroup_id                     bigint not null,
    constraint pk_mmachine_mgroup primary key (mmachine_id,mgroup_id)
  );
  
  create table mmedia (
    type                          varchar(31) not null,
    id                            bigint generated by default as identity not null,
    url                           varchar(255),
    note                          varchar(255),
    constraint pk_mmedia primary key (id)
  );
  
  create table non_updateprop (
    id                            integer generated by default as identity not null,
    non_enum                      varchar(5),
    name                          varchar(255),
    note                          varchar(255),
    constraint ck_non_updateprop_non_enum check ( non_enum in ('BEGIN','END')),
    constraint pk_non_updateprop primary key (id)
  );
  
  create table mprinter (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    flags                         bigint not null,
    current_state_id              bigint,
    last_swap_cyan_id             bigint,
    last_swap_magenta_id          bigint,
    last_swap_yellow_id           bigint,
    last_swap_black_id            bigint,
    version                       bigint not null,
    constraint uq_mprinter_last_swap_cyan_id unique (last_swap_cyan_id),
    constraint uq_mprinter_last_swap_magenta_id unique (last_swap_magenta_id),
    constraint uq_mprinter_last_swap_yellow_id unique (last_swap_yellow_id),
    constraint uq_mprinter_last_swap_black_id unique (last_swap_black_id),
    constraint pk_mprinter primary key (id)
  );
  
  create table mprinter_state (
    id                            bigint generated by default as identity not null,
    flags                         bigint not null,
    printer_id                    bigint,
    version                       bigint not null,
    constraint pk_mprinter_state primary key (id)
  );
  
  create table mprofile (
    id                            bigint generated by default as identity not null,
    picture_id                    bigint,
    name                          varchar(255),
    constraint pk_mprofile primary key (id)
  );
  
  create table mprotected_construct_bean (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_mprotected_construct_bean primary key (id)
  );
  
  create table mrole (
    roleid                        integer generated by default as identity not null,
    role_name                     varchar(255),
    constraint pk_mrole primary key (roleid)
  );
  
  create table mrole_muser (
    mrole_roleid                  integer not null,
    muser_userid                  integer not null,
    constraint pk_mrole_muser primary key (mrole_roleid,muser_userid)
  );
  
  create table msome_other (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_msome_other primary key (id)
  );
  
  create table muser (
    userid                        integer generated by default as identity not null,
    user_name                     varchar(255),
    user_type_id                  integer,
    constraint pk_muser primary key (userid)
  );
  
  create table muser_type (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    constraint pk_muser_type primary key (id)
  );
  
  create table mail_box (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_mail_box primary key (id)
  );
  
  create table mail_user (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_mail_user primary key (id)
  );
  
  create table mail_user_inbox (
    mail_user_id                  bigint not null,
    mail_box_id                   bigint not null,
    constraint pk_mail_user_inbox primary key (mail_user_id,mail_box_id)
  );
  
  create table mail_user_outbox (
    mail_user_id                  bigint not null,
    mail_box_id                   bigint not null,
    constraint pk_mail_user_outbox primary key (mail_user_id,mail_box_id)
  );
  
  create table main_entity (
    id                            varchar(255) not null,
    attr1                         varchar(255),
    attr2                         varchar(255),
    constraint pk_main_entity primary key (id)
  );
  
  create table main_entity_relation (
    id                            uuid not null,
    id1                           varchar(255),
    id2                           varchar(255),
    attr1                         varchar(255),
    constraint pk_main_entity_relation primary key (id)
  );
  
  create table map_super_actual (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    when_created                  timestamp not null,
    when_updated                  timestamp not null,
    constraint pk_map_super_actual primary key (id)
  );
  
  create table c_message (
    id                            bigint generated by default as identity not null,
    title                         varchar(255),
    body                          varchar(255),
    conversation_id               bigint,
    user_id                       bigint,
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_c_message primary key (id)
  );
  
  create table meter_address_data (
    id                            uuid not null,
    street                        varchar(255) not null,
    constraint pk_meter_address_data primary key (id)
  );
  
  create table meter_contract_data (
    id                            uuid not null,
    special_needs_client_id       uuid not null,
    constraint uq_meter_contract_data_special_needs_client_id unique (special_needs_client_id),
    constraint pk_meter_contract_data primary key (id)
  );
  
  create table meter_special_needs_client (
    id                            uuid not null,
    name                          varchar(255),
    primary_id                    uuid,
    constraint uq_meter_special_needs_client_primary_id unique (primary_id),
    constraint pk_meter_special_needs_client primary key (id)
  );
  
  create table meter_special_needs_contact (
    id                            uuid not null,
    name                          varchar(255),
    constraint pk_meter_special_needs_contact primary key (id)
  );
  
  create table meter_version (
    id                            uuid not null,
    address_data_id               uuid,
    contract_data_id              uuid not null,
    constraint uq_meter_version_address_data_id unique (address_data_id),
    constraint uq_meter_version_contract_data_id unique (contract_data_id),
    constraint pk_meter_version primary key (id)
  );
  
  create table mnoc_role (
    role_id                       integer generated by default as identity not null,
    role_name                     varchar(255),
    version                       integer not null,
    constraint pk_mnoc_role primary key (role_id)
  );
  
  create table mnoc_user (
    user_id                       integer generated by default as identity not null,
    user_name                     varchar(255),
    version                       integer not null,
    constraint pk_mnoc_user primary key (user_id)
  );
  
  create table mnoc_user_mnoc_role (
    mnoc_user_user_id             integer not null,
    mnoc_role_role_id             integer not null,
    constraint pk_mnoc_user_mnoc_role primary key (mnoc_user_user_id,mnoc_role_role_id)
  );
  
  create table mny_a (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_mny_a primary key (id)
  );
  
  create table mny_b (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    a_id                          bigint,
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_mny_b primary key (id)
  );
  
  create table mny_b_mny_c (
    mny_b_id                      bigint not null,
    mny_c_id                      bigint not null,
    constraint pk_mny_b_mny_c primary key (mny_b_id,mny_c_id)
  );
  
  create table mny_c (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_mny_c primary key (id)
  );
  
  create table mny_edge (
    id                            integer generated by default as identity not null,
    from_id                       integer,
    to_id                         integer,
    flags                         integer not null,
    constraint uq_mny_edge_from_id_to_id unique (from_id,to_id),
    constraint uq_mny_edge_to_id_from_id unique (to_id,from_id),
    constraint pk_mny_edge primary key (id)
  );
  
  create table mny_node (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    constraint pk_mny_node primary key (id)
  );
  
  create table mny_topic (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_mny_topic primary key (id)
  );
  
  create table subtopics (
    topic                         bigint not null,
    subtopic                      bigint not null,
    constraint pk_subtopics primary key (topic,subtopic)
  );
  
  create table mp_role (
    id                            bigint generated by default as identity not null,
    mp_user_id                    bigint not null,
    code                          varchar(255),
    organization_id               bigint,
    constraint pk_mp_role primary key (id)
  );
  
  create table mp_user (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_mp_user primary key (id)
  );
  
  create table ms_many_a (
    aid                           bigint generated by default as identity not null,
    name                          varchar(255),
    ms_many_a_many_b              boolean default false not null,
    ms_many_b                     boolean default false not null,
    deleted                       boolean default false not null,
    constraint pk_ms_many_a primary key (aid)
  );
  
  create table ms_many_a_many_b (
    ms_many_a_aid                 bigint not null,
    ms_many_b_bid                 bigint not null,
    constraint pk_ms_many_a_many_b primary key (ms_many_a_aid,ms_many_b_bid)
  );
  
  create table ms_many_b (
    bid                           bigint generated by default as identity not null,
    name                          varchar(255),
    deleted                       boolean default false not null,
    constraint pk_ms_many_b primary key (bid)
  );
  
  create table ms_many_b_many_a (
    ms_many_b_bid                 bigint not null,
    ms_many_a_aid                 bigint not null,
    constraint pk_ms_many_b_many_a primary key (ms_many_b_bid,ms_many_a_aid)
  );
  
  create table my_lob_size (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    my_count                      integer not null,
    my_lob                        clob,
    constraint pk_my_lob_size primary key (id)
  );
  
  create table my_lob_size_join_many (
    id                            integer generated by default as identity not null,
    something                     varchar(255),
    other                         varchar(255),
    parent_id                     integer,
    constraint pk_my_lob_size_join_many primary key (id)
  );
  
  create table noidbean (
    name                          varchar(255),
    subject                       varchar(255),
    when_created                  timestamp not null
  );
  
  create table o_bean_child (
    id                            bigint generated by default as identity not null,
    cached_bean_id                bigint,
    constraint pk_o_bean_child primary key (id)
  );
  
  create table ocached_app (
    id                            bigint generated by default as identity not null,
    app_name                      varchar(255),
    version                       bigint not null,
    constraint uq_ocached_app_app_name unique (app_name),
    constraint pk_ocached_app primary key (id)
  );
  
  create table ocached_app_detail (
    id                            bigint generated by default as identity not null,
    app_id                        bigint not null,
    detail                        varchar(255),
    version                       bigint not null,
    constraint uq_ocached_app_detail_app_id_detail unique (app_id,detail),
    constraint pk_ocached_app_detail primary key (id)
  );
  
  create table o_cached_bean (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_o_cached_bean primary key (id)
  );
  
  create table o_cached_bean_country (
    o_cached_bean_id              bigint not null,
    o_country_code                varchar(2) not null,
    constraint pk_o_cached_bean_country primary key (o_cached_bean_id,o_country_code)
  );
  
  create table o_cached_bean_child (
    id                            bigint generated by default as identity not null,
    cached_bean_id                bigint,
    constraint pk_o_cached_bean_child primary key (id)
  );
  
  create table o_cached_inherit (
    dtype                         varchar(31) not null,
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    child_adata                   varchar(255),
    child_bdata                   varchar(255),
    constraint pk_o_cached_inherit primary key (id)
  );
  
  create table o_cached_natkey (
    id                            bigint generated by default as identity not null,
    store                         varchar(255),
    sku                           varchar(255),
    description                   varchar(255),
    constraint pk_o_cached_natkey primary key (id)
  );
  
  create table o_cached_natkey3 (
    id                            bigint generated by default as identity not null,
    store                         varchar(255),
    code                          integer not null,
    sku                           varchar(255),
    description                   varchar(255),
    constraint pk_o_cached_natkey3 primary key (id)
  );
  
  create table ocached_nkey_uid (
    id                            bigint generated by default as identity not null,
    cid                           uuid,
    other                         varchar(255),
    version                       bigint not null,
    constraint pk_ocached_nkey_uid primary key (id)
  );
  
  create table ocar (
    id                            integer generated by default as identity not null,
    vin                           varchar(255),
    name                          varchar(255),
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_ocar primary key (id)
  );
  
  create table ocompany (
    id                            integer generated by default as identity not null,
    corp_id                       varchar(50),
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint uq_ocompany_corp_id unique (corp_id),
    constraint pk_ocompany primary key (id)
  );
  
  create table oengine (
    engine_id                     uuid not null,
    short_desc                    varchar(255),
    car_id                        integer,
    version                       integer not null,
    constraint uq_oengine_car_id unique (car_id),
    constraint pk_oengine primary key (engine_id)
  );
  
  create table ogear_box (
    id                            uuid not null,
    box_desc                      varchar(255),
    box_size                      integer,
    car_id                        integer,
    version                       integer not null,
    constraint uq_ogear_box_car_id unique (car_id),
    constraint pk_ogear_box primary key (id)
  );
  
  create table omvertex (
    id                            uuid not null,
    constraint pk_omvertex primary key (id)
  );
  
  create table omvertex_other (
    id                            uuid not null,
    omvertex_id                   uuid not null,
    name                          varchar(255),
    constraint pk_omvertex_other primary key (id)
  );
  
  create table oroad_show_msg (
    id                            integer generated by default as identity not null,
    company_id                    integer not null,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint uq_oroad_show_msg_company_id unique (company_id),
    constraint pk_oroad_show_msg primary key (id)
  );
  
  create table om_account_child_dbo (
    id                            bigint generated by default as identity not null,
    description                   varchar(255),
    banana_rama_id                bigint,
    constraint pk_om_account_child_dbo primary key (id)
  );
  
  create table om_account_dbo (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_om_account_dbo primary key (id)
  );
  
  create table om_basic_child (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    parent_id                     bigint,
    version                       bigint not null,
    constraint pk_om_basic_child primary key (id)
  );
  
  create table om_basic_parent (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_om_basic_parent primary key (id)
  );
  
  create table om_bean_list_child (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    parent_id                     bigint,
    version                       bigint not null,
    constraint pk_om_bean_list_child primary key (id)
  );
  
  create table om_bean_list_parent (
    id                            bigint generated by default as identity not null,
    version                       bigint not null,
    constraint pk_om_bean_list_parent primary key (id)
  );
  
  create table om_ordered_detail (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    master_id                     bigint,
    version                       bigint not null,
    sort_order                    integer,
    constraint pk_om_ordered_detail primary key (id)
  );
  
  create table om_ordered_master (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_om_ordered_master primary key (id)
  );
  
  create table oml_bar (
    id                            bigint generated by default as identity not null,
    constraint pk_oml_bar primary key (id)
  );
  
  create table oml_baz (
    id                            bigint generated by default as identity not null,
    foo_id                        bigint not null,
    constraint pk_oml_baz primary key (id)
  );
  
  create table oml_foo (
    id                            bigint generated by default as identity not null,
    bar_id                        bigint not null,
    constraint pk_oml_foo primary key (id)
  );
  
  create table only_id_entity (
    id                            bigint generated by default as identity not null,
    constraint pk_only_id_entity primary key (id)
  );
  
  create table o_order (
    id                            integer generated by default as identity not null,
    status                        integer,
    order_date                    date,
    ship_date                     date,
    kcustomer_id                  integer not null,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    constraint ck_o_order_status check ( status in (0,1,2,3)),
    constraint pk_o_order primary key (id)
  );
  
  create table o_order_detail (
    id                            integer generated by default as identity not null,
    order_id                      integer not null,
    order_qty                     integer,
    ship_qty                      integer,
    unit_price                    double,
    product_id                    integer,
    cretime                       timestamp,
    updtime                       timestamp not null,
    constraint pk_o_order_detail primary key (id)
  );
  
  create table s_orders (
    uuid                          varchar(40) not null,
    constraint pk_s_orders primary key (uuid)
  );
  
  create table s_order_items (
    uuid                          varchar(40) not null,
    product_variant_uuid          varchar(255),
    order_uuid                    varchar(40),
    quantity                      integer not null,
    amount                        decimal(16,3),
    constraint pk_s_order_items primary key (uuid)
  );
  
  create table order_master (
    id                            bigint generated by default as identity not null,
    constraint pk_order_master primary key (id)
  );
  
  create table order_master_inheritance (
    id                            integer generated by default as identity not null,
    constraint pk_order_master_inheritance primary key (id)
  );
  
  create table order_referenced_parent (
    type                          varchar(31) not null,
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    child_name                    varchar(255),
    master_id                     bigint,
    sort_order                    integer,
    constraint pk_order_referenced_parent primary key (id)
  );
  
  create table or_order_ship (
    id                            integer generated by default as identity not null,
    order_id                      integer,
    ship_time                     timestamp,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_or_order_ship primary key (id)
  );
  
  create table order_toy (
    id                            integer generated by default as identity not null,
    title                         varchar(255),
    child_id                      bigint,
    sort_order                    integer,
    constraint pk_order_toy primary key (id)
  );
  
  create table ordered_parent (
    dtype                         varchar(31) not null,
    id                            integer generated by default as identity not null,
    order_master_inheritance_id   integer not null,
    common_name                   varchar(255),
    sort_order                    integer,
    ordered_aname                 varchar(255),
    ordered_bname                 varchar(255),
    constraint pk_ordered_parent primary key (id)
  );
  
  create table organisation (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_organisation primary key (id)
  );
  
  create table organization_node (
    kind                          varchar(31) not null,
    id                            bigint generated by default as identity not null,
    parent_tree_node_id           bigint not null,
    title                         varchar(255),
    constraint uq_organization_node_parent_tree_node_id unique (parent_tree_node_id),
    constraint pk_organization_node primary key (id)
  );
  
  create table organization_tree_node (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_organization_tree_node primary key (id)
  );
  
  create table orp_detail (
    id                            varchar(100) not null,
    detail                        varchar(255),
    master_id                     varchar(100),
    version                       bigint not null,
    constraint pk_orp_detail primary key (id)
  );
  
  create table orp_detail2 (
    id                            varchar(100) not null,
    orp_master2_id                varchar(100) not null,
    detail                        varchar(255),
    master_id                     varchar(255),
    version                       bigint not null,
    constraint pk_orp_detail2 primary key (id)
  );
  
  create table orp_master (
    id                            varchar(100) not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_orp_master primary key (id)
  );
  
  create table orp_master2 (
    id                            varchar(100) not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_orp_master2 primary key (id)
  );
  
  create table oto_aone (
    id                            varchar(100) not null,
    description                   varchar(255),
    constraint pk_oto_aone primary key (id)
  );
  
  create table oto_atwo (
    id                            varchar(100) not null,
    description                   varchar(255),
    aone_id                       varchar(100),
    constraint uq_oto_atwo_aone_id unique (aone_id),
    constraint pk_oto_atwo primary key (id)
  );
  
  create table oto_bchild (
    master_id                     bigint generated by default as identity not null,
    child                         varchar(255),
    constraint pk_oto_bchild primary key (master_id)
  );
  
  create table oto_bmaster (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_oto_bmaster primary key (id)
  );
  
  create table oto_child (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    master_id                     bigint,
    constraint uq_oto_child_master_id unique (master_id),
    constraint pk_oto_child primary key (id)
  );
  
  create table oto_cust (
    cid                           bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_oto_cust primary key (cid)
  );
  
  create table oto_cust_address (
    aid                           bigint generated by default as identity not null,
    line1                         varchar(255),
    line2                         varchar(255),
    line3                         varchar(255),
    customer_cid                  bigint,
    version                       bigint not null,
    constraint uq_oto_cust_address_customer_cid unique (customer_cid),
    constraint pk_oto_cust_address primary key (aid)
  );
  
  create table oto_level_a (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    b_id                          bigint,
    constraint uq_oto_level_a_b_id unique (b_id),
    constraint pk_oto_level_a primary key (id)
  );
  
  create table oto_level_b (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    c_id                          bigint,
    constraint uq_oto_level_b_c_id unique (c_id),
    constraint pk_oto_level_b primary key (id)
  );
  
  create table oto_level_c (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_oto_level_c primary key (id)
  );
  
  create table oto_master (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_oto_master primary key (id)
  );
  
  create table oto_prime (
    pid                           bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_oto_prime primary key (pid)
  );
  
  create table oto_prime_extra (
    eid                           bigint generated by default as identity not null,
    extra                         varchar(255),
    version                       bigint not null,
    constraint pk_oto_prime_extra primary key (eid)
  );
  
  create table oto_sd_child (
    id                            bigint generated by default as identity not null,
    child                         varchar(255),
    master_id                     bigint,
    deleted                       boolean default false not null,
    version                       bigint not null,
    constraint uq_oto_sd_child_master_id unique (master_id),
    constraint pk_oto_sd_child primary key (id)
  );
  
  create table oto_sd_master (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_oto_sd_master primary key (id)
  );
  
  create table oto_th_many (
    id                            bigint generated by default as identity not null,
    oto_th_top_id                 bigint not null,
    many                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_oto_th_many primary key (id)
  );
  
  create table oto_th_one (
    id                            bigint generated by default as identity not null,
    one                           boolean default false not null,
    many_id                       bigint,
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint uq_oto_th_one_many_id unique (many_id),
    constraint pk_oto_th_one primary key (id)
  );
  
  create table oto_th_top (
    id                            bigint generated by default as identity not null,
    topp                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_oto_th_top primary key (id)
  );
  
  create table oto_ubprime (
    pid                           uuid not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_oto_ubprime primary key (pid)
  );
  
  create table oto_ubprime_extra (
    eid                           uuid not null,
    extra                         varchar(255),
    version                       bigint not null,
    constraint pk_oto_ubprime_extra primary key (eid)
  );
  
  create table oto_uprime (
    pid                           uuid not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_oto_uprime primary key (pid)
  );
  
  create table oto_uprime_extra (
    eid                           uuid not null,
    extra                         varchar(255),
    version                       bigint not null,
    constraint pk_oto_uprime_extra primary key (eid)
  );
  
  create table oto_user_model (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    user_optional_id              bigint,
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint uq_oto_user_model_user_optional_id unique (user_optional_id),
    constraint pk_oto_user_model primary key (id)
  );
  
  create table oto_user_model_optional (
    id                            bigint generated by default as identity not null,
    optional                      varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_oto_user_model_optional primary key (id)
  );
  
  create table pfile (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    file_content_id               integer,
    file_content2_id              integer,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint uq_pfile_file_content_id unique (file_content_id),
    constraint uq_pfile_file_content2_id unique (file_content2_id),
    constraint pk_pfile primary key (id)
  );
  
  create table pfile_content (
    id                            integer generated by default as identity not null,
    content                       blob,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_pfile_content primary key (id)
  );
  
  create table paggview (
    pview_id                      uuid,
    amount                        integer not null,
    constraint uq_paggview_pview_id unique (pview_id)
  );
  
  create table pallet_location (
    type                          varchar(31) not null,
    id                            integer generated by default as identity not null,
    zone_sid                      integer not null,
    attribute                     varchar(255),
    constraint pk_pallet_location primary key (id)
  );
  
  create table parcel (
    parcelid                      bigint generated by default as identity not null,
    description                   varchar(255),
    constraint pk_parcel primary key (parcelid)
  );
  
  create table parcel_location (
    parcellocid                   bigint generated by default as identity not null,
    location                      varchar(255),
    parcelid                      bigint,
    constraint uq_parcel_location_parcelid unique (parcelid),
    constraint pk_parcel_location primary key (parcellocid)
  );
  
  create table rawinherit_parent (
    type                          varchar(31) not null,
    id                            bigint generated by default as identity not null,
    val                           integer,
    more                          varchar(255),
    constraint pk_rawinherit_parent primary key (id)
  );
  
  create table rawinherit_parent_rawinherit_data (
    rawinherit_parent_id          bigint not null,
    rawinherit_data_id            bigint not null,
    constraint pk_rawinherit_parent_rawinherit_data primary key (rawinherit_parent_id,rawinherit_data_id)
  );
  
  create table e_save_test_c (
    id                            bigint generated by default as identity not null,
    version                       bigint not null,
    constraint pk_e_save_test_c primary key (id)
  );
  
  create table parent_a (
    id                            bigint generated by default as identity not null,
    child_id                      bigint,
    name                          varchar(255),
    constraint pk_parent_a primary key (id)
  );
  
  create table parent_b (
    id                            bigint generated by default as identity not null,
    child_id                      bigint,
    constraint pk_parent_b primary key (id)
  );
  
  create table parent_person (
    identifier                    integer generated by default as identity not null,
    name                          varchar(255),
    age                           integer,
    some_bean_id                  integer,
    parent_identifier             integer,
    family_name                   varchar(255),
    address                       varchar(255),
    constraint pk_parent_person primary key (identifier)
  );
  
  create table c_participation (
    id                            bigint generated by default as identity not null,
    rating                        integer,
    type                          integer,
    conversation_id               bigint not null,
    user_id                       bigint not null,
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint ck_c_participation_type check ( type in (0,1)),
    constraint pk_c_participation primary key (id)
  );
  
  create table password_store_model (
    id                            bigint generated by default as identity not null,
    enc1                          varchar(30),
    enc2                          varchar(40),
    enc3                          clob,
    enc4                          varbinary(30),
    enc5                          varbinary(40),
    enc6                          blob,
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_password_store_model primary key (id)
  );
  
  create table pcf_calendar (
    id                            bigint generated by default as identity not null,
    pcf_person_id                 bigint not null,
    version                       bigint not null,
    constraint pk_pcf_calendar primary key (id)
  );
  
  create table pcf_city (
    id                            bigint generated by default as identity not null,
    pcf_country_id                bigint not null,
    name                          varchar(255),
    mayor_id                      bigint not null,
    vice_mayor_id                 bigint not null,
    version                       bigint not null,
    constraint uq_pcf_city_mayor_id unique (mayor_id),
    constraint uq_pcf_city_vice_mayor_id unique (vice_mayor_id),
    constraint pk_pcf_city primary key (id)
  );
  
  create table pcf_country (
    id                            bigint generated by default as identity not null,
    version                       bigint not null,
    constraint pk_pcf_country primary key (id)
  );
  
  create table pcf_event (
    id                            bigint generated by default as identity not null,
    pcf_calendar_id               bigint not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_pcf_event primary key (id)
  );
  
  create table pcf_person (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_pcf_person primary key (id)
  );
  
  create table mt_permission (
    id                            uuid not null,
    name                          varchar(255),
    constraint pk_mt_permission primary key (id)
  );
  
  create table persistent_file (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_persistent_file primary key (id)
  );
  
  create table persistent_file_content (
    id                            integer generated by default as identity not null,
    persistent_file_id            integer,
    content                       blob,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint uq_persistent_file_content_persistent_file_id unique (persistent_file_id),
    constraint pk_persistent_file_content primary key (id)
  );
  
  create table person (
    oid                           bigint generated by default as identity not null,
    default_address_oid           bigint,
    version                       integer not null,
    constraint pk_person primary key (oid)
  );
  
  create table persons (
    id                            bigint generated by default as identity (start with 1000 increment by 40) not null,
    surname                       varchar(64) not null,
    name                          varchar(64) not null,
    constraint pk_persons primary key (id)
  );
  
  create table person_cache_email (
    id                            varchar(128) not null,
    person_info_person_id         varchar(128),
    email                         varchar(255),
    constraint pk_person_cache_email primary key (id)
  );
  
  create table person_cache_info (
    person_id                     varchar(128) not null,
    name                          varchar(255),
    constraint pk_person_cache_info primary key (person_id)
  );
  
  create table person_other (
    id                            varchar(128) not null,
    email                         varchar(255),
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    version                       bigint not null,
    constraint pk_person_other primary key (id)
  );
  
  create table persona (
    id                            bigint generated by default as identity not null,
    persona                       varchar(255),
    person_oid                    bigint,
    version                       integer not null,
    constraint uq_persona_person_oid unique (person_oid),
    constraint pk_persona primary key (id)
  );
  
  create table phones (
    id                            bigint generated by default as identity not null,
    phone_number                  varchar(7) not null,
    person_id                     bigint not null,
    constraint uq_phones_phone_number unique (phone_number),
    constraint pk_phones primary key (id)
  );
  
  create table e_position (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    contract_id                   bigint not null,
    constraint pk_e_position primary key (id)
  );
  
  create table primary_revision (
    id                            bigint not null,
    revision                      integer not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_primary_revision primary key (id,revision)
  );
  
  create table o_product (
    id                            integer generated by default as identity not null,
    sku                           varchar(20),
    name                          varchar(255),
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    constraint pk_o_product primary key (id)
  );
  
  create table pp (
    id                            uuid not null,
    name                          varchar(255),
    value                         varchar(100) not null,
    constraint pk_pp primary key (id)
  );
  
  create table pp_to_ww (
    pp_id                         uuid not null,
    ww_id                         uuid not null,
    constraint pk_pp_to_ww primary key (pp_id,ww_id)
  );
  
  create table question (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    groupobjectid                 bigint,
    sequence_number               integer not null,
    constraint pk_question primary key (id)
  );
  
  create table rcustomer (
    company                       varchar(127) not null,
    name                          varchar(127) not null,
    description                   varchar(255),
    constraint pk_rcustomer primary key (company,name)
  );
  
  create table r_orders (
    company                       varchar(127) not null,
    order_number                  integer not null,
    customername                  varchar(127),
    item                          varchar(255),
    constraint pk_r_orders primary key (company,order_number)
  );
  
  create table referenced_defaults_model (
    id                            integer generated by default as identity not null,
    defaults_model_id             integer not null,
    name                          varchar(255),
    constraint pk_referenced_defaults_model primary key (id)
  );
  
  create table referenced_defaults_model_draft (
    id                            integer generated by default as identity not null,
    defaults_model_id             integer not null,
    name                          varchar(255),
    constraint pk_referenced_defaults_model_draft primary key (id)
  );
  
  create table referencing_bean (
    id                            uuid not null,
    constraint pk_referencing_bean primary key (id)
  );
  
  create table region (
    customer                      integer not null,
    type                          integer not null,
    description                   varchar(255),
    version                       bigint not null,
    constraint pk_region primary key (customer,type)
  );
  
  create table rel_detail (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       integer not null,
    constraint pk_rel_detail primary key (id)
  );
  
  create table rel_master (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    detail_id                     bigint,
    version                       integer not null,
    constraint pk_rel_master primary key (id)
  );
  
  create table app_config_re (
    id                            integer generated by default as identity not null,
    config_id                     integer,
    constraint pk_app_config_re primary key (id)
  );
  
  create table resourcefile (
    id                            varchar(64) not null,
    parentresourcefileid          varchar(64),
    name                          varchar(128) not null,
    constraint pk_resourcefile primary key (id)
  );
  
  create table mt_role (
    id                            uuid not null,
    name                          varchar(50),
    tenant_id                     uuid,
    version                       bigint not null,
    constraint pk_mt_role primary key (id)
  );
  
  create table mt_role_permission (
    mt_role_id                    uuid not null,
    mt_permission_id              uuid not null,
    constraint pk_mt_role_permission primary key (mt_role_id,mt_permission_id)
  );
  
  create table em_role (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_em_role primary key (id)
  );
  
  create table root_bean (
    dtype                         varchar(31) not null,
    id                            uuid not null,
    referencing_bean_id           uuid not null,
    value                         varchar(255),
    constraint pk_root_bean primary key (id)
  );
  
  create table f_second (
    id                            bigint generated by default as identity not null,
    mod_name                      varchar(255),
    first                         bigint,
    title                         varchar(255),
    constraint uq_f_second_first unique (first),
    constraint pk_f_second primary key (id)
  );
  
  create table section (
    id                            integer generated by default as identity not null,
    article_id                    integer,
    type                          integer,
    content                       clob,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint ck_section_type check ( type in (0,1)),
    constraint pk_section primary key (id)
  );
  
  create table self_many_many (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_self_many_many primary key (id)
  );
  
  create table self_many_bridge (
    self_1_id                     bigint not null,
    self_2_id                     bigint not null,
    constraint pk_self_many_bridge primary key (self_1_id,self_2_id)
  );
  
  create table self_parent (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    parent_id                     bigint,
    version                       bigint not null,
    constraint pk_self_parent primary key (id)
  );
  
  create table self_ref_customer (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    referred_by_id                bigint,
    constraint pk_self_ref_customer primary key (id)
  );
  
  create table self_ref_example (
    id                            bigint generated by default as identity not null,
    name                          varchar(255) not null,
    parent_id                     bigint,
    constraint pk_self_ref_example primary key (id)
  );
  
  create table e_save_test_a (
    id                            bigint generated by default as identity not null,
    version                       bigint not null,
    constraint pk_e_save_test_a primary key (id)
  );
  
  create table e_save_test_b (
    id                            bigint generated by default as identity not null,
    sibling_a_id                  bigint,
    test_property                 boolean default false not null,
    version                       bigint not null,
    constraint uq_e_save_test_b_sibling_a_id unique (sibling_a_id),
    constraint pk_e_save_test_b primary key (id)
  );
  
  create table site (
    id                            uuid not null,
    name                          varchar(255),
    parent_id                     uuid,
    data_container_id             uuid,
    site_address_id               uuid,
    constraint uq_site_data_container_id unique (data_container_id),
    constraint uq_site_site_address_id unique (site_address_id),
    constraint pk_site primary key (id)
  );
  
  create table site_address (
    id                            uuid not null,
    street                        varchar(255),
    city                          varchar(255),
    zip_code                      varchar(255),
    constraint pk_site_address primary key (id)
  );
  
  create table some_enum_bean (
    id                            bigint generated by default as identity not null,
    some_enum                     integer,
    name                          varchar(255),
    constraint ck_some_enum_bean_some_enum check ( some_enum in (0,1)),
    constraint pk_some_enum_bean primary key (id)
  );
  
  create table some_file_bean (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    content                       blob,
    version                       bigint not null,
    constraint pk_some_file_bean primary key (id)
  );
  
  create table some_new_types_bean (
    id                            bigint generated by default as identity not null,
    dow                           integer(1),
    mth                           integer(1),
    yr                            integer,
    yr_mth                        date,
    month_day                     date,
    sql_date                      date,
    sql_time                      time,
    local_date                    date,
    local_date_time               timestamp,
    offset_date_time              timestamp,
    zoned_date_time               timestamp,
    local_time                    time,
    instant                       timestamp,
    zone_id                       varchar(60),
    zone_offset                   varchar(60),
    path                          varchar(255),
    period                        varchar(20),
    duration                      bigint,
    version                       bigint not null,
    constraint ck_some_new_types_bean_dow check ( dow in (1,2,3,4,5,6,7)),
    constraint ck_some_new_types_bean_mth check ( mth in (1,2,3,4,5,6,7,8,9,10,11,12)),
    constraint pk_some_new_types_bean primary key (id)
  );
  
  create table some_period_bean (
    id                            bigint generated by default as identity not null,
    anniversary                   date,
    version                       bigint not null,
    constraint pk_some_period_bean primary key (id)
  );
  
  create table source_base (
    dtype                         varchar(31) not null,
    id                            uuid not null,
    name                          varchar(255),
    pos                           integer not null,
    target_id                     uuid,
    constraint pk_source_base primary key (id)
  );
  
  create table stockforecast (
    type                          varchar(31) not null,
    id                            bigint generated by default as identity not null,
    inner_report_id               bigint,
    constraint pk_stockforecast primary key (id)
  );
  
  create table sub_section (
    id                            integer generated by default as identity not null,
    section_id                    integer,
    title                         varchar(255),
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_sub_section primary key (id)
  );
  
  create table sub_type (
    sub_type_id                   integer generated by default as identity not null,
    description                   varchar(255),
    version                       bigint not null,
    constraint pk_sub_type primary key (sub_type_id)
  );
  
  create table survey (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_survey primary key (id)
  );
  
  create table tbytes_only (
    id                            integer generated by default as identity not null,
    content                       blob,
    constraint pk_tbytes_only primary key (id)
  );
  
  create table tcar (
    type                          varchar(31) not null,
    plate_no                      varchar(32) not null,
    deleted                       boolean default false not null,
    truckload                     bigint,
    constraint pk_tcar primary key (plate_no)
  );
  
  create table tevent (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_tevent primary key (id)
  );
  
  create table tevent_many (
    id                            bigint generated by default as identity not null,
    description                   varchar(255),
    event_id                      bigint,
    my_units                      integer not null,
    amount                        double not null,
    version                       bigint not null,
    constraint pk_tevent_many primary key (id)
  );
  
  create table tevent_one (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    status                        integer,
    event_id                      bigint,
    version                       bigint not null,
    constraint ck_tevent_one_status check ( status in (0,1)),
    constraint uq_tevent_one_event_id unique (event_id),
    constraint pk_tevent_one primary key (id)
  );
  
  create table tint_root (
    my_type                       integer(3) not null,
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    child_property                varchar(255),
    constraint pk_tint_root primary key (id)
  );
  
  create table tjoda_entity (
    id                            integer generated by default as identity not null,
    local_time                    time,
    constraint pk_tjoda_entity primary key (id)
  );
  
  create table t_mapsuper1 (
    id                            integer generated by default as identity not null,
    something                     varchar(255),
    name                          varchar(255),
    version                       integer not null,
    constraint pk_t_mapsuper1 primary key (id)
  );
  
  create table t_oneb (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    description                   varchar(255),
    active                        boolean default false not null,
    constraint pk_t_oneb primary key (id)
  );
  
  create table t_detail_with_other_namexxxyy (
    id                            integer not null,
    name                          varchar(255),
    description                   varchar(255),
    some_unique_value             varchar(127),
    active                        boolean default false not null,
    master_id                     integer,
    constraint uq_t_detail_with_other_namexxxyy_some_unique_value unique (some_unique_value),
    constraint pk_t_detail_with_other_namexxxyy primary key (id)
  );
  create sequence t_atable_detail_seq increment by 1;
  
  create table t_atable_thatisrelatively (
    id                            integer not null,
    name                          varchar(255),
    description                   varchar(255),
    active                        boolean default false not null,
    constraint pk_t_atable_thatisrelatively primary key (id)
  );
  create sequence t_atable_master_seq increment by 1;
  
  create table ttruck_holder (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    truck_plate_no                varchar(32) not null,
    basic_id                      integer,
    version                       bigint not null,
    constraint pk_ttruck_holder primary key (id)
  );
  
  create table ttruck_holder_item (
    id                            bigint generated by default as identity not null,
    some_uid                      uuid,
    foo                           varchar(255),
    owner_id                      bigint not null,
    constraint pk_ttruck_holder_item primary key (id)
  );
  
  create table tuuid_entity (
    id                            uuid not null,
    name                          varchar(255),
    constraint pk_tuuid_entity primary key (id)
  );
  
  create table twheel (
    id                            bigint generated by default as identity not null,
    owner_plate_no                varchar(32) not null,
    constraint pk_twheel primary key (id)
  );
  
  create table twith_pre_insert (
    id                            integer generated by default as identity not null,
    name                          varchar(255) not null,
    title                         varchar(255),
    constraint pk_twith_pre_insert primary key (id)
  );
  
  create table target_base (
    dtype                         varchar(31) not null,
    id                            uuid not null,
    name                          varchar(255),
    constraint pk_target_base primary key (id)
  );
  
  create table mt_tenant (
    id                            uuid not null,
    name                          varchar(255),
    version                       bigint not null,
    constraint pk_mt_tenant primary key (id)
  );
  
  create table test_annotation_base_entity (
    direct                        varchar(255),
    meta                          varchar(255),
    mixed                         varchar(255),
    constraint_annotation         varchar(40),
    null1                         varchar(255) not null,
    null2                         varchar(255),
    null3                         varchar(255)
  );
  
  create table test_jakarta_annotation_base_entity (
    direct                        varchar(255),
    meta                          varchar(255),
    mixed                         varchar(255),
    constraint_annotation         varchar(40),
    null1                         varchar(255) not null,
    null2                         varchar(255),
    null3                         varchar(255)
  );
  
  create table tire (
    id                            bigint not null,
    wheel                         bigint,
    version                       integer not null,
    constraint uq_tire_wheel unique (wheel),
    constraint pk_tire primary key (id)
  );
  create sequence tire_seq increment by 1;
  
  create table sa_tire (
    id                            bigint not null,
    version                       integer not null,
    constraint pk_sa_tire primary key (id)
  );
  create sequence sa_tire_seq increment by 1;
  
  create table tree_entity (
    id                            integer generated by default as identity not null,
    text                          varchar(255),
    parent_id                     integer,
    constraint pk_tree_entity primary key (id)
  );
  
  create table trip (
    id                            integer generated by default as identity not null,
    vehicle_driver_id             integer,
    destination                   varchar(255),
    address_id                    integer,
    star_date                     timestamp,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_trip primary key (id)
  );
  
  create table truck_ref (
    id                            integer generated by default as identity not null,
    something                     varchar(255),
    constraint pk_truck_ref primary key (id)
  );
  
  create table tune (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_tune primary key (id)
  );
  
  create table "type" (
    customer                      integer not null,
    type                          integer not null,
    description                   varchar(255),
    sub_type_id                   integer,
    version                       bigint not null,
    constraint pk_type primary key (customer,type)
  );
  
  create table tz_bean (
    id                            bigint generated by default as identity not null,
    moda                          varchar(255),
    ts                            timestamp,
    tstz                          timestamp,
    constraint pk_tz_bean primary key (id)
  );
  
  create table usib_child (
    id                            uuid not null,
    parent_id                     bigint,
    deleted                       boolean default false not null,
    constraint pk_usib_child primary key (id)
  );
  
  create table usib_child_sibling (
    id                            bigint generated by default as identity not null,
    child_id                      uuid,
    deleted                       boolean default false not null,
    constraint uq_usib_child_sibling_child_id unique (child_id),
    constraint pk_usib_child_sibling primary key (id)
  );
  
  create table usib_parent (
    id                            bigint generated by default as identity not null,
    deleted                       boolean default false not null,
    constraint pk_usib_parent primary key (id)
  );
  
  create table ut_detail (
    id                            integer generated by default as identity not null,
    utmaster_id                   integer not null,
    name                          varchar(255),
    qty                           integer,
    amount                        double,
    version                       integer not null,
    constraint pk_ut_detail primary key (id)
  );
  
  create table ut_master (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    description                   varchar(255),
    event_date                    date,
    version                       integer not null,
    constraint pk_ut_master primary key (id)
  );
  
  create table uuone (
    id                            uuid not null,
    name                          varchar(255),
    description                   varchar(255),
    version                       bigint not null,
    constraint pk_uuone primary key (id)
  );
  
  create table uutwo (
    id                            uuid not null,
    name                          varchar(255),
    notes                         varchar(255),
    master_id                     uuid,
    version                       bigint not null,
    constraint pk_uutwo primary key (id)
  );
  
  create table oto_user (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    account_id                    bigint not null,
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint uq_oto_user_account_id unique (account_id),
    constraint pk_oto_user primary key (id)
  );
  
  create table c_user (
    id                            bigint generated by default as identity not null,
    inactive                      boolean default false not null,
    name                          varchar(255),
    email                         varchar(255),
    password_hash                 varchar(255),
    group_id                      bigint,
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    constraint pk_c_user primary key (id)
  );
  
  create table tx_user (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_tx_user primary key (id)
  );
  
  create table g_user (
    id                            bigint generated by default as identity not null,
    username                      varchar(255),
    version                       bigint not null,
    constraint pk_g_user primary key (id)
  );
  
  create table em_user (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    constraint pk_em_user primary key (id)
  );
  
  create table user_interest_live (
    user_id                       bigint not null,
    live_id                       bigint not null,
    created_at                    timestamp not null,
    constraint pk_user_interest_live primary key (user_id,live_id)
  );
  
  create table em_user_role (
    user_id                       bigint not null,
    role_id                       bigint not null,
    constraint pk_em_user_role primary key (user_id,role_id)
  );
  
  create table vehicle (
    dtype                         varchar(3) not null,
    id                            integer generated by default as identity not null,
    license_number                varchar(255),
    registration_date             timestamp,
    lease_id                      bigint,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    siz                           varchar(3),
    driver                        varchar(255),
    car_ref_id                    integer,
    notes                         varchar(255),
    truck_ref_id                  integer,
    capacity                      double,
    constraint ck_vehicle_siz check ( siz in ('S','M','L','H')),
    constraint pk_vehicle primary key (id)
  );
  
  create table vehicle_driver (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    vehicle_id                    integer,
    address_id                    integer,
    license_issued_on             timestamp,
    cretime                       timestamp not null,
    updtime                       timestamp not null,
    version                       bigint not null,
    constraint pk_vehicle_driver primary key (id)
  );
  
  create table vehicle_lease (
    dtype                         varchar(31) not null,
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    active_start                  date,
    active_end                    date,
    version                       bigint not null,
    bond                          decimal(16,3),
    min_duration                  integer not null,
    day_rate                      decimal(16,3),
    max_days                      integer,
    constraint pk_vehicle_lease primary key (id)
  );
  
  create table version_child (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    parent_id                     integer,
    version                       integer not null,
    position                      integer,
    constraint pk_version_child primary key (id)
  );
  
  create table version_parent (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    version                       integer not null,
    constraint pk_version_parent primary key (id)
  );
  
  create table version_toy (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    child_id                      integer,
    version                       integer not null,
    position                      integer,
    constraint pk_version_toy primary key (id)
  );
  
  create table warehouses (
    id                            integer generated by default as identity not null,
    officezoneid                  integer,
    constraint pk_warehouses primary key (id)
  );
  
  create table warehousesshippingzones (
    warehouseid                   integer not null,
    shippingzoneid                integer not null,
    constraint pk_warehousesshippingzones primary key (warehouseid,shippingzoneid)
  );
  
  create table wheel (
    id                            bigint not null,
    version                       integer not null,
    constraint pk_wheel primary key (id)
  );
  create sequence wheel_seq increment by 1;
  
  create table sa_wheel (
    id                            bigint not null,
    tire                          bigint,
    car                           bigint,
    version                       integer not null,
    constraint pk_sa_wheel primary key (id)
  );
  create sequence sa_wheel_seq increment by 1;
  
  create table sp_car_wheel (
    id                            bigint not null,
    name                          varchar(255),
    version                       integer not null,
    constraint pk_sp_car_wheel primary key (id)
  );
  create sequence sp_car_wheel_seq increment by 1;
  
  create table g_who_props_otm (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    version                       bigint not null,
    when_created                  timestamp not null,
    when_modified                 timestamp not null,
    who_created_id                bigint,
    who_modified_id               bigint,
    constraint pk_g_who_props_otm primary key (id)
  );
  
  create table with_zero (
    id                            bigint generated by default as identity not null,
    name                          varchar(255),
    parent_id                     integer,
    lang                          varchar(2) default 'en' not null,
    version                       bigint not null,
    constraint pk_with_zero primary key (id)
  );
  
  create table parent (
    id                            integer generated by default as identity not null,
    name                          varchar(255),
    constraint pk_parent primary key (id)
  );
  
  create table wview (
    id                            uuid not null,
    name                          varchar(127) not null,
    constraint uq_wview_name unique (name),
    constraint pk_wview primary key (id)
  );
  
  create table zones (
    type                          varchar(31) not null,
    id                            integer generated by default as identity not null,
    attribute                     varchar(255),
    constraint pk_zones primary key (id)
  );
  
  create index ix_contact_last_name_first_name on contact (last_name,first_name);
  create index ix_e_basic_name on e_basic (name);
  create index ix_efile2_no_fk_owner_id on efile2_no_fk (owner_id);
  create index ix_ecsm_values_host_id on ecsm_values (host_id);
  create index ix_order_referenced_parent_type on order_referenced_parent (type);
  create index ix_organization_node_kind on organization_node (kind);
  create index ano_3 on test_annotation_base_entity (direct);
  create index ano_1 on test_jakarta_annotation_base_entity (direct);
  create index ano_2 on test_jakarta_annotation_base_entity (direct);
  create index ix_bar_foo_id on bar (foo_id);
  alter table bar add constraint fk_bar_foo_id foreign key (foo_id) references foo (foo_id) on delete restrict on update restrict;
  
  create index ix_acl_container_relation_container_id on acl_container_relation (container_id);
  alter table acl_container_relation add constraint fk_acl_container_relation_container_id foreign key (container_id) references contract (id) on delete restrict on update restrict;
  
  create index ix_acl_container_relation_acl_entry_id on acl_container_relation (acl_entry_id);
  alter table acl_container_relation add constraint fk_acl_container_relation_acl_entry_id foreign key (acl_entry_id) references acl (id) on delete restrict on update restrict;
  
  create index ix_addr_employee_id on addr (employee_id);
  alter table addr add constraint fk_addr_employee_id foreign key (employee_id) references empl (id) on delete restrict on update restrict;
  
  create index ix_o_address_country_code on o_address (country_code);
  alter table o_address add constraint fk_o_address_country_code foreign key (country_code) references o_country (code) on delete restrict on update restrict;
  
  alter table album add constraint fk_album_cover_id foreign key (cover_id) references cover (id) on delete restrict on update restrict;
  
  create index ix_animal_shelter_id on animal (shelter_id);
  alter table animal add constraint fk_animal_shelter_id foreign key (shelter_id) references animal_shelter (id) on delete restrict on update restrict;
  
  create index ix_app_config_control_config_id on app_config_control (config_id);
  alter table app_config_control add constraint fk_app_config_control_config_id foreign key (config_id) references app_config (id) on delete restrict on update restrict;
  
  create index ix_attribute_attribute_holder_id on attribute (attribute_holder_id);
  alter table attribute add constraint fk_attribute_attribute_holder_id foreign key (attribute_holder_id) references attribute_holder (id) on delete restrict on update restrict;
  
  create index ix_bbookmark_user_id on bbookmark (user_id);
  alter table bbookmark add constraint fk_bbookmark_user_id foreign key (user_id) references bbookmark_user (id) on delete restrict on update restrict;
  
  create index ix_bbookmark_user_org_id on bbookmark_user (org_id);
  alter table bbookmark_user add constraint fk_bbookmark_user_org_id foreign key (org_id) references bbookmark_org (id) on delete restrict on update restrict;
  
  create index ix_bsite_user_a_site_id on bsite_user_a (site_id);
  alter table bsite_user_a add constraint fk_bsite_user_a_site_id foreign key (site_id) references bsite (id) on delete restrict on update restrict;
  
  create index ix_bsite_user_a_user_id on bsite_user_a (user_id);
  alter table bsite_user_a add constraint fk_bsite_user_a_user_id foreign key (user_id) references buser (id) on delete restrict on update restrict;
  
  create index ix_bsite_user_b_site on bsite_user_b (site);
  alter table bsite_user_b add constraint fk_bsite_user_b_site foreign key (site) references bsite (id) on delete restrict on update restrict;
  
  create index ix_bsite_user_b_usr on bsite_user_b (usr);
  alter table bsite_user_b add constraint fk_bsite_user_b_usr foreign key (usr) references buser (id) on delete restrict on update restrict;
  
  create index ix_bsite_user_c_site_uid on bsite_user_c (site_uid);
  alter table bsite_user_c add constraint fk_bsite_user_c_site_uid foreign key (site_uid) references bsite (id) on delete restrict on update restrict;
  
  create index ix_bsite_user_c_user_uid on bsite_user_c (user_uid);
  alter table bsite_user_c add constraint fk_bsite_user_c_user_uid foreign key (user_uid) references buser (id) on delete restrict on update restrict;
  
  create index ix_bsite_user_dmany_bsite_user_d on bsite_user_dmany (site_id,user_id);
  alter table bsite_user_dmany add constraint fk_bsite_user_dmany_bsite_user_d foreign key (site_id,user_id) references bsite_user_d (site_id,user_id) on delete restrict on update restrict;
  
  create index ix_bsite_user_e_site_id on bsite_user_e (site_id);
  alter table bsite_user_e add constraint fk_bsite_user_e_site_id foreign key (site_id) references bsite (id) on delete restrict on update restrict;
  
  create index ix_bsite_user_e_user_id on bsite_user_e (user_id);
  alter table bsite_user_e add constraint fk_bsite_user_e_user_id foreign key (user_id) references buser (id) on delete restrict on update restrict;
  
  alter table basic_draftable_bean add constraint fk_basic_draftable_bean_id foreign key (id) references basic_draftable_bean_draft (id) on delete restrict on update restrict;
  
  alter table drel_booking add constraint fk_drel_booking_agent_invoice foreign key (agent_invoice) references drel_invoice (id) on delete restrict on update restrict;
  
  alter table drel_booking add constraint fk_drel_booking_client_invoice foreign key (client_invoice) references drel_invoice (id) on delete restrict on update restrict;
  
  create index ix_cepproduct_category_category_id on cepproduct_category (category_id);
  alter table cepproduct_category add constraint fk_cepproduct_category_category_id foreign key (category_id) references cepcategory (id) on delete restrict on update restrict;
  
  create index ix_cepproduct_category_product_id on cepproduct_category (product_id);
  alter table cepproduct_category add constraint fk_cepproduct_category_product_id foreign key (product_id) references cepproduct (id) on delete restrict on update restrict;
  
  create index ix_ciaddress_street_id on ciaddress (street_id);
  alter table ciaddress add constraint fk_ciaddress_street_id foreign key (street_id) references cistreet_parent (id) on delete restrict on update restrict;
  
  create index ix_cicustomer_parent_address_id on cicustomer_parent (address_id);
  alter table cicustomer_parent add constraint fk_cicustomer_parent_address_id foreign key (address_id) references ciaddress (id) on delete restrict on update restrict;
  
  create index ix_cinh_ref_ref_id on cinh_ref (ref_id);
  alter table cinh_ref add constraint fk_cinh_ref_ref_id foreign key (ref_id) references cinh_root (id) on delete restrict on update restrict;
  
  create index ix_ckey_detail_parent on ckey_detail (one_key,two_key);
  alter table ckey_detail add constraint fk_ckey_detail_parent foreign key (one_key,two_key) references ckey_parent (one_key,two_key) on delete restrict on update restrict;
  
  create index ix_ckey_parent_assoc_id on ckey_parent (assoc_id);
  alter table ckey_parent add constraint fk_ckey_parent_assoc_id foreign key (assoc_id) references ckey_assoc (id) on delete restrict on update restrict;
  
  create index ix_coone_many_coone_id on coone_many (coone_id);
  alter table coone_many add constraint fk_coone_many_coone_id foreign key (coone_id) references coone (id) on delete restrict on update restrict;
  
  alter table coroot add constraint fk_coroot_one_id foreign key (one_id) references coone (id) on delete restrict on update restrict;
  
  alter table calcd_data add constraint fk_calcd_data_id foreign key (id) references calcd_input (id) on delete cascade on update restrict;
  
  create index ix_calculation_result_product_configuration_id on calculation_result (product_configuration_id);
  alter table calculation_result add constraint fk_calculation_result_product_configuration_id foreign key (product_configuration_id) references configuration (id) on delete restrict on update restrict;
  
  create index ix_calculation_result_group_configuration_id on calculation_result (group_configuration_id);
  alter table calculation_result add constraint fk_calculation_result_group_configuration_id foreign key (group_configuration_id) references configuration (id) on delete restrict on update restrict;
  
  create index ix_sp_car_car_wheels_sp_car_car on sp_car_car_wheels (car);
  alter table sp_car_car_wheels add constraint fk_sp_car_car_wheels_sp_car_car foreign key (car) references sp_car_car (id) on delete restrict on update restrict;
  
  create index ix_sp_car_car_wheels_sp_car_wheel on sp_car_car_wheels (wheel);
  alter table sp_car_car_wheels add constraint fk_sp_car_car_wheels_sp_car_wheel foreign key (wheel) references sp_car_wheel (id) on delete restrict on update restrict;
  
  create index ix_sp_car_car_doors_sp_car_car on sp_car_car_doors (car);
  alter table sp_car_car_doors add constraint fk_sp_car_car_doors_sp_car_car foreign key (car) references sp_car_car (id) on delete restrict on update restrict;
  
  create index ix_sp_car_car_doors_sp_car_door on sp_car_car_doors (door);
  alter table sp_car_car_doors add constraint fk_sp_car_car_doors_sp_car_door foreign key (door) references sp_car_door (id) on delete restrict on update restrict;
  
  create index ix_car_accessory_fuse_id on car_accessory (fuse_id);
  alter table car_accessory add constraint fk_car_accessory_fuse_id foreign key (fuse_id) references car_fuse (id) on delete restrict on update restrict;
  
  create index ix_car_accessory_car_id on car_accessory (car_id);
  alter table car_accessory add constraint fk_car_accessory_car_id foreign key (car_id) references vehicle (id) on delete restrict on update restrict;
  
  create index ix_category_surveyobjectid on category (surveyobjectid);
  alter table category add constraint fk_category_surveyobjectid foreign key (surveyobjectid) references survey (id) on delete restrict on update restrict;
  
  alter table e_save_test_d add constraint fk_e_save_test_d_parent_id foreign key (parent_id) references e_save_test_c (id) on delete restrict on update restrict;
  
  create index ix_child_person_some_bean_id on child_person (some_bean_id);
  alter table child_person add constraint fk_child_person_some_bean_id foreign key (some_bean_id) references e_basic (id) on delete restrict on update restrict;
  
  create index ix_child_person_parent_identifier on child_person (parent_identifier);
  alter table child_person add constraint fk_child_person_parent_identifier foreign key (parent_identifier) references parent_person (identifier) on delete restrict on update restrict;
  
  create index ix_cke_client_user on cke_client (username,cod_cpny);
  alter table cke_client add constraint fk_cke_client_user foreign key (username,cod_cpny) references cke_user (username,cod_cpny) on delete restrict on update restrict;
  
  alter table class_super_monkey add constraint fk_class_super_monkey_class_super foreign key (class_super_sid) references class_super (sid) on delete restrict on update restrict;
  
  alter table class_super_monkey add constraint fk_class_super_monkey_monkey foreign key (monkey_mid) references monkey (mid) on delete restrict on update restrict;
  
  create index ix_configuration_configurations_id on configuration (configurations_id);
  alter table configuration add constraint fk_configuration_configurations_id foreign key (configurations_id) references configurations (id) on delete restrict on update restrict;
  
  create index ix_contact_customer_id on contact (customer_id);
  alter table contact add constraint fk_contact_customer_id foreign key (customer_id) references o_customer (id) on delete restrict on update restrict;
  
  create index ix_contact_group_id on contact (group_id);
  alter table contact add constraint fk_contact_group_id foreign key (group_id) references contact_group (id) on delete restrict on update restrict;
  
  create index ix_contact_note_contact_id on contact_note (contact_id);
  alter table contact_note add constraint fk_contact_note_contact_id foreign key (contact_id) references contact (id) on delete restrict on update restrict;
  
  create index ix_contract_costs_position_id on contract_costs (position_id);
  alter table contract_costs add constraint fk_contract_costs_position_id foreign key (position_id) references e_position (id) on delete restrict on update restrict;
  
  create index ix_c_conversation_group_id on c_conversation (group_id);
  alter table c_conversation add constraint fk_c_conversation_group_id foreign key (group_id) references c_group (id) on delete restrict on update restrict;
  
  create index ix_o_customer_billing_address_id on o_customer (billing_address_id);
  alter table o_customer add constraint fk_o_customer_billing_address_id foreign key (billing_address_id) references o_address (id) on delete restrict on update restrict;
  
  create index ix_o_customer_shipping_address_id on o_customer (shipping_address_id);
  alter table o_customer add constraint fk_o_customer_shipping_address_id foreign key (shipping_address_id) references o_address (id) on delete restrict on update restrict;
  
  create index ix_dcredit_drol_dcredit on dcredit_drol (dcredit_id);
  alter table dcredit_drol add constraint fk_dcredit_drol_dcredit foreign key (dcredit_id) references dcredit (id) on delete restrict on update restrict;
  
  create index ix_dcredit_drol_drol on dcredit_drol (drol_id);
  alter table dcredit_drol add constraint fk_dcredit_drol_drol foreign key (drol_id) references drol (id) on delete restrict on update restrict;
  
  create index ix_dmachine_organisation_id on dmachine (organisation_id);
  alter table dmachine add constraint fk_dmachine_organisation_id foreign key (organisation_id) references dorg (id) on delete restrict on update restrict;
  
  create index ix_d_machine_aux_use_machine_id on d_machine_aux_use (machine_id);
  alter table d_machine_aux_use add constraint fk_d_machine_aux_use_machine_id foreign key (machine_id) references dmachine (id) on delete restrict on update restrict;
  
  create index ix_d_machine_stats_machine_id on d_machine_stats (machine_id);
  alter table d_machine_stats add constraint fk_d_machine_stats_machine_id foreign key (machine_id) references dmachine (id) on delete restrict on update restrict;
  
  create index ix_d_machine_use_machine_id on d_machine_use (machine_id);
  alter table d_machine_use add constraint fk_d_machine_use_machine_id foreign key (machine_id) references dmachine (id) on delete restrict on update restrict;
  
  create index ix_drot_drol_drot on drot_drol (drot_id);
  alter table drot_drol add constraint fk_drot_drol_drot foreign key (drot_id) references drot (id) on delete restrict on update restrict;
  
  create index ix_drot_drol_drol on drot_drol (drol_id);
  alter table drot_drol add constraint fk_drot_drol_drol foreign key (drol_id) references drol (id) on delete restrict on update restrict;
  
  create index ix_dc_detail_master_id on dc_detail (master_id);
  alter table dc_detail add constraint fk_dc_detail_master_id foreign key (master_id) references dc_master (id) on delete restrict on update restrict;
  
  alter table defaults_model add constraint fk_defaults_model_id foreign key (id) references defaults_model_draft (id) on delete restrict on update restrict;
  
  create index ix_dfk_cascade_one_id on dfk_cascade (one_id);
  alter table dfk_cascade add constraint fk_dfk_cascade_one_id foreign key (one_id) references dfk_cascade_one (id) on delete cascade on update restrict;
  
  create index ix_dfk_set_null_one_id on dfk_set_null (one_id);
  alter table dfk_set_null add constraint fk_dfk_set_null_one_id foreign key (one_id) references dfk_one (id) on delete set null on update restrict;
  
  alter table doc add constraint fk_doc_id foreign key (id) references doc_draft (id) on delete restrict on update restrict;
  
  create index ix_doc_link_doc on doc_link (doc_id);
  alter table doc_link add constraint fk_doc_link_doc foreign key (doc_id) references doc (id) on delete restrict on update restrict;
  
  create index ix_doc_link_link on doc_link (link_id);
  alter table doc_link add constraint fk_doc_link_link foreign key (link_id) references link (id) on delete restrict on update restrict;
  
  alter table document add constraint fk_document_id foreign key (id) references document_draft (id) on delete restrict on update restrict;
  
  create index ix_document_organisation_id on document (organisation_id);
  alter table document add constraint fk_document_organisation_id foreign key (organisation_id) references organisation (id) on delete restrict on update restrict;
  
  create index ix_document_draft_organisation_id on document_draft (organisation_id);
  alter table document_draft add constraint fk_document_draft_organisation_id foreign key (organisation_id) references organisation (id) on delete restrict on update restrict;
  
  create index ix_document_media_document_id on document_media (document_id);
  alter table document_media add constraint fk_document_media_document_id foreign key (document_id) references document (id) on delete restrict on update restrict;
  
  create index ix_document_media_draft_document_id on document_media_draft (document_id);
  alter table document_media_draft add constraint fk_document_media_draft_document_id foreign key (document_id) references document_draft (id) on delete restrict on update restrict;
  
  create index ix_e_basicenc_relate_other_id on e_basicenc_relate (other_id);
  alter table e_basicenc_relate add constraint fk_e_basicenc_relate_other_id foreign key (other_id) references e_basicenc (id) on delete restrict on update restrict;
  
  create index ix_ebasic_json_map_detail_owner_id on ebasic_json_map_detail (owner_id);
  alter table ebasic_json_map_detail add constraint fk_ebasic_json_map_detail_owner_id foreign key (owner_id) references ebasic_json_map (id) on delete restrict on update restrict;
  
  create index ix_ebasic_no_sdchild_owner_id on ebasic_no_sdchild (owner_id);
  alter table ebasic_no_sdchild add constraint fk_ebasic_no_sdchild_owner_id foreign key (owner_id) references ebasic_soft_delete (id) on delete restrict on update restrict;
  
  create index ix_ebasic_sdchild_owner_id on ebasic_sdchild (owner_id);
  alter table ebasic_sdchild add constraint fk_ebasic_sdchild_owner_id foreign key (owner_id) references ebasic_soft_delete (id) on delete restrict on update restrict;
  
  create index ix_ecache_child_root_id on ecache_child (root_id);
  alter table ecache_child add constraint fk_ecache_child_root_id foreign key (root_id) references ecache_root (id) on delete restrict on update restrict;
  
  alter table edefault_prop add constraint fk_edefault_prop_e_simple_usertypeid foreign key (e_simple_usertypeid) references esimple (usertypeid) on delete restrict on update restrict;
  
  create index ix_eemb_inner_outer_id on eemb_inner (outer_id);
  alter table eemb_inner add constraint fk_eemb_inner_outer_id foreign key (outer_id) references eemb_outer (id) on delete restrict on update restrict;
  
  create index ix_einvoice_person_id on einvoice (person_id);
  alter table einvoice add constraint fk_einvoice_person_id foreign key (person_id) references eperson (id) on delete restrict on update restrict;
  
  create index ix_enull_collection_detail_enull_collection_id on enull_collection_detail (enull_collection_id);
  alter table enull_collection_detail add constraint fk_enull_collection_detail_enull_collection_id foreign key (enull_collection_id) references enull_collection (id) on delete restrict on update restrict;
  
  create index ix_eopt_one_a_b_id on eopt_one_a (b_id);
  alter table eopt_one_a add constraint fk_eopt_one_a_b_id foreign key (b_id) references eopt_one_b (id) on delete restrict on update restrict;
  
  create index ix_eopt_one_b_c_id on eopt_one_b (c_id);
  alter table eopt_one_b add constraint fk_eopt_one_b_c_id foreign key (c_id) references eopt_one_c (id) on delete restrict on update restrict;
  
  create index ix_eper_addr_ma_country_code on eper_addr (ma_country_code);
  alter table eper_addr add constraint fk_eper_addr_ma_country_code foreign key (ma_country_code) references o_country (code) on delete restrict on update restrict;
  
  create index ix_esoft_del_book_lend_by_id on esoft_del_book (lend_by_id);
  alter table esoft_del_book add constraint fk_esoft_del_book_lend_by_id foreign key (lend_by_id) references esoft_del_user (id) on delete restrict on update restrict;
  
  create index ix_esoft_del_book_esoft_del_user_esoft_del_book on esoft_del_book_esoft_del_user (esoft_del_book_id);
  alter table esoft_del_book_esoft_del_user add constraint fk_esoft_del_book_esoft_del_user_esoft_del_book foreign key (esoft_del_book_id) references esoft_del_book (id) on delete restrict on update restrict;
  
  create index ix_esoft_del_book_esoft_del_user_esoft_del_user on esoft_del_book_esoft_del_user (esoft_del_user_id);
  alter table esoft_del_book_esoft_del_user add constraint fk_esoft_del_book_esoft_del_user_esoft_del_user foreign key (esoft_del_user_id) references esoft_del_user (id) on delete restrict on update restrict;
  
  create index ix_esoft_del_down_esoft_del_mid_id on esoft_del_down (esoft_del_mid_id);
  alter table esoft_del_down add constraint fk_esoft_del_down_esoft_del_mid_id foreign key (esoft_del_mid_id) references esoft_del_mid (id) on delete restrict on update restrict;
  
  create index ix_esoft_del_mid_top_id on esoft_del_mid (top_id);
  alter table esoft_del_mid add constraint fk_esoft_del_mid_top_id foreign key (top_id) references esoft_del_top (id) on delete restrict on update restrict;
  
  create index ix_esoft_del_mid_up_id on esoft_del_mid (up_id);
  alter table esoft_del_mid add constraint fk_esoft_del_mid_up_id foreign key (up_id) references esoft_del_up (id) on delete restrict on update restrict;
  
  alter table esoft_del_one_a add constraint fk_esoft_del_one_a_oneb_id foreign key (oneb_id) references esoft_del_one_b (id) on delete restrict on update restrict;
  
  create index ix_esoft_del_role_esoft_del_user_esoft_del_role on esoft_del_role_esoft_del_user (esoft_del_role_id);
  alter table esoft_del_role_esoft_del_user add constraint fk_esoft_del_role_esoft_del_user_esoft_del_role foreign key (esoft_del_role_id) references esoft_del_role (id) on delete restrict on update restrict;
  
  create index ix_esoft_del_role_esoft_del_user_esoft_del_user on esoft_del_role_esoft_del_user (esoft_del_user_id);
  alter table esoft_del_role_esoft_del_user add constraint fk_esoft_del_role_esoft_del_user_esoft_del_user foreign key (esoft_del_user_id) references esoft_del_user (id) on delete restrict on update restrict;
  
  create index ix_esoft_del_user_esoft_del_role_esoft_del_user on esoft_del_user_esoft_del_role (esoft_del_user_id);
  alter table esoft_del_user_esoft_del_role add constraint fk_esoft_del_user_esoft_del_role_esoft_del_user foreign key (esoft_del_user_id) references esoft_del_user (id) on delete restrict on update restrict;
  
  create index ix_esoft_del_user_esoft_del_role_esoft_del_role on esoft_del_user_esoft_del_role (esoft_del_role_id);
  alter table esoft_del_user_esoft_del_role add constraint fk_esoft_del_user_esoft_del_role_esoft_del_role foreign key (esoft_del_role_id) references esoft_del_role (id) on delete restrict on update restrict;
  
  alter table esoft_del_x add constraint fk_esoft_del_x_y_id foreign key (y_id) references esoft_del_y (id) on delete restrict on update restrict;
  
  create index ix_esoft_del_x_organization_id on esoft_del_x (organization_id);
  alter table esoft_del_x add constraint fk_esoft_del_x_organization_id foreign key (organization_id) references esoft_del_z (id) on delete restrict on update restrict;
  
  create index ix_esoft_del_y_organization_id on esoft_del_y (organization_id);
  alter table esoft_del_y add constraint fk_esoft_del_y_organization_id foreign key (organization_id) references esoft_del_z (id) on delete restrict on update restrict;
  
  create index ix_rawinherit_uncle_parent_id on rawinherit_uncle (parent_id);
  alter table rawinherit_uncle add constraint fk_rawinherit_uncle_parent_id foreign key (parent_id) references rawinherit_parent (id) on delete restrict on update restrict;
  
  create index ix_evanilla_collection_detail_evanilla_collection_id on evanilla_collection_detail (evanilla_collection_id);
  alter table evanilla_collection_detail add constraint fk_evanilla_collection_detail_evanilla_collection_id foreign key (evanilla_collection_id) references evanilla_collection (id) on delete restrict on update restrict;
  
  create index ix_ec_enum_person_tags_ec_enum_person_id on ec_enum_person_tags (ec_enum_person_id);
  alter table ec_enum_person_tags add constraint fk_ec_enum_person_tags_ec_enum_person_id foreign key (ec_enum_person_id) references ec_enum_person (id) on delete restrict on update restrict;
  
  create index ix_ec_person_phone_owner_id on ec_person_phone (owner_id);
  alter table ec_person_phone add constraint fk_ec_person_phone_owner_id foreign key (owner_id) references ec_person (id) on delete restrict on update restrict;
  
  create index ix_ec_top_person_id on ec_top (person_id);
  alter table ec_top add constraint fk_ec_top_person_id foreign key (person_id) references ecs_person (id) on delete restrict on update restrict;
  
  create index ix_ec_top_ecs_person_ec_top on ec_top_ecs_person (ec_top_id);
  alter table ec_top_ecs_person add constraint fk_ec_top_ecs_person_ec_top foreign key (ec_top_id) references ec_top (id) on delete restrict on update restrict;
  
  create index ix_ec_top_ecs_person_ecs_person on ec_top_ecs_person (ecs_person_id);
  alter table ec_top_ecs_person add constraint fk_ec_top_ecs_person_ecs_person foreign key (ecs_person_id) references ecs_person (id) on delete restrict on update restrict;
  
  create index ix_ecbl_person_phone_numbers_person_id on ecbl_person_phone_numbers (person_id);
  alter table ecbl_person_phone_numbers add constraint fk_ecbl_person_phone_numbers_person_id foreign key (person_id) references ecbl_person (id) on delete restrict on update restrict;
  
  create index ix_ecbm_person_phone_numbers_person_id on ecbm_person_phone_numbers (person_id);
  alter table ecbm_person_phone_numbers add constraint fk_ecbm_person_phone_numbers_person_id foreign key (person_id) references ecbm_person (id) on delete restrict on update restrict;
  
  create index ix_ecm_person_phone_numbers_ecm_person_id on ecm_person_phone_numbers (ecm_person_id);
  alter table ecm_person_phone_numbers add constraint fk_ecm_person_phone_numbers_ecm_person_id foreign key (ecm_person_id) references ecm_person (id) on delete restrict on update restrict;
  
  create index ix_ecmc_person_phone_numbers_ecmc_person_id on ecmc_person_phone_numbers (ecmc_person_id);
  alter table ecmc_person_phone_numbers add constraint fk_ecmc_person_phone_numbers_ecmc_person_id foreign key (ecmc_person_id) references ecmc_person (id) on delete restrict on update restrict;
  
  create index ix_ecs_person_phone_ecs_person_id on ecs_person_phone (ecs_person_id);
  alter table ecs_person_phone add constraint fk_ecs_person_phone_ecs_person_id foreign key (ecs_person_id) references ecs_person (id) on delete restrict on update restrict;
  
  create index ix_ecsm_child_ecsm_parent_id on ecsm_child (ecsm_parent_id);
  alter table ecsm_child add constraint fk_ecsm_child_ecsm_parent_id foreign key (ecsm_parent_id) references ecsm_parent (id) on delete restrict on update restrict;
  
  create index ix_td_child_parent_id on td_child (parent_id);
  alter table td_child add constraint fk_td_child_parent_id foreign key (parent_id) references td_parent (parent_id) on delete restrict on update restrict;
  
  create index ix_element_bean_complex_bean_id on element_bean (complex_bean_id);
  alter table element_bean add constraint fk_element_bean_complex_bean_id foreign key (complex_bean_id) references root_bean (id) on delete restrict on update restrict;
  
  create index ix_empl_default_address_id on empl (default_address_id);
  alter table empl add constraint fk_empl_default_address_id foreign key (default_address_id) references addr (id) on delete restrict on update restrict;
  
  create index ix_esd_detail_master_id on esd_detail (master_id);
  alter table esd_detail add constraint fk_esd_detail_master_id foreign key (master_id) references esd_master (id) on delete restrict on update restrict;
  
  create index ix_grand_parent_person_some_bean_id on grand_parent_person (some_bean_id);
  alter table grand_parent_person add constraint fk_grand_parent_person_some_bean_id foreign key (some_bean_id) references e_basic (id) on delete restrict on update restrict;
  
  create index ix_survey_group_categoryobjectid on survey_group (categoryobjectid);
  alter table survey_group add constraint fk_survey_group_categoryobjectid foreign key (categoryobjectid) references category (id) on delete restrict on update restrict;
  
  create index ix_hx_link_doc_hx_link on hx_link_doc (hx_link_id);
  alter table hx_link_doc add constraint fk_hx_link_doc_hx_link foreign key (hx_link_id) references hx_link (id) on delete restrict on update restrict;
  
  create index ix_hx_link_doc_he_doc on hx_link_doc (he_doc_id);
  alter table hx_link_doc add constraint fk_hx_link_doc_he_doc foreign key (he_doc_id) references he_doc (id) on delete restrict on update restrict;
  
  create index ix_hi_link_doc_hi_link on hi_link_doc (hi_link_id);
  alter table hi_link_doc add constraint fk_hi_link_doc_hi_link foreign key (hi_link_id) references hi_link (id) on delete restrict on update restrict;
  
  create index ix_hi_link_doc_hi_doc on hi_link_doc (hi_doc_id);
  alter table hi_link_doc add constraint fk_hi_link_doc_hi_doc foreign key (hi_doc_id) references hi_doc (id) on delete restrict on update restrict;
  
  create index ix_hi_tthree_hi_ttwo_id on hi_tthree (hi_ttwo_id);
  alter table hi_tthree add constraint fk_hi_tthree_hi_ttwo_id foreign key (hi_ttwo_id) references hi_ttwo (id) on delete restrict on update restrict;
  
  create index ix_hi_ttwo_hi_tone_id on hi_ttwo (hi_tone_id);
  alter table hi_ttwo add constraint fk_hi_ttwo_hi_tone_id foreign key (hi_tone_id) references hi_tone (id) on delete restrict on update restrict;
  
  alter table hsd_setting add constraint fk_hsd_setting_user_id foreign key (user_id) references hsd_user (id) on delete restrict on update restrict;
  
  create index ix_iaf_segment_status_id on iaf_segment (status_id);
  alter table iaf_segment add constraint fk_iaf_segment_status_id foreign key (status_id) references iaf_segment_status (id) on delete restrict on update restrict;
  
  create index ix_imrelated_owner_id on imrelated (owner_id);
  alter table imrelated add constraint fk_imrelated_owner_id foreign key (owner_id) references imroot (id) on delete restrict on update restrict;
  
  create index ix_info_contact_company_id on info_contact (company_id);
  alter table info_contact add constraint fk_info_contact_company_id foreign key (company_id) references info_company (id) on delete restrict on update restrict;
  
  alter table info_customer add constraint fk_info_customer_company_id foreign key (company_id) references info_company (id) on delete restrict on update restrict;
  
  alter table inner_report add constraint fk_inner_report_forecast_id foreign key (forecast_id) references stockforecast (id) on delete restrict on update restrict;
  
  create index ix_drel_invoice_booking on drel_invoice (booking);
  alter table drel_invoice add constraint fk_drel_invoice_booking foreign key (booking) references drel_booking (id) on delete restrict on update restrict;
  
  create index ix_item_etype on item (customer,type);
  alter table item add constraint fk_item_etype foreign key (customer,type) references "type" (customer,type) on delete restrict on update restrict;
  
  create index ix_item_eregion on item (customer,region);
  alter table item add constraint fk_item_eregion foreign key (customer,region) references region (customer,type) on delete restrict on update restrict;
  
  alter table mkeygroup_monkey add constraint fk_mkeygroup_monkey_mkeygroup foreign key (mkeygroup_pid) references mkeygroup (pid) on delete restrict on update restrict;
  
  alter table mkeygroup_monkey add constraint fk_mkeygroup_monkey_monkey foreign key (monkey_mid) references monkey (mid) on delete restrict on update restrict;
  
  alter table trainer_monkey add constraint fk_trainer_monkey_trainer foreign key (trainer_tid) references trainer (tid) on delete restrict on update restrict;
  
  alter table trainer_monkey add constraint fk_trainer_monkey_monkey foreign key (monkey_mid) references monkey (mid) on delete restrict on update restrict;
  
  alter table troop_monkey add constraint fk_troop_monkey_troop foreign key (troop_pid) references troop (pid) on delete restrict on update restrict;
  
  alter table troop_monkey add constraint fk_troop_monkey_monkey foreign key (monkey_mid) references monkey (mid) on delete restrict on update restrict;
  
  create index ix_l2_cldf_reset_bean_child_parent_id on l2_cldf_reset_bean_child (parent_id);
  alter table l2_cldf_reset_bean_child add constraint fk_l2_cldf_reset_bean_child_parent_id foreign key (parent_id) references l2_cldf_reset_bean (id) on delete restrict on update restrict;
  
  create index ix_level1_level4_level1 on level1_level4 (level1_id);
  alter table level1_level4 add constraint fk_level1_level4_level1 foreign key (level1_id) references level1 (id) on delete restrict on update restrict;
  
  create index ix_level1_level4_level4 on level1_level4 (level4_id);
  alter table level1_level4 add constraint fk_level1_level4_level4 foreign key (level4_id) references level4 (id) on delete restrict on update restrict;
  
  create index ix_level1_level2_level1 on level1_level2 (level1_id);
  alter table level1_level2 add constraint fk_level1_level2_level1 foreign key (level1_id) references level1 (id) on delete restrict on update restrict;
  
  create index ix_level1_level2_level2 on level1_level2 (level2_id);
  alter table level1_level2 add constraint fk_level1_level2_level2 foreign key (level2_id) references level2 (id) on delete restrict on update restrict;
  
  create index ix_level2_level3_level2 on level2_level3 (level2_id);
  alter table level2_level3 add constraint fk_level2_level3_level2 foreign key (level2_id) references level2 (id) on delete restrict on update restrict;
  
  create index ix_level2_level3_level3 on level2_level3 (level3_id);
  alter table level2_level3 add constraint fk_level2_level3_level3 foreign key (level3_id) references level3 (id) on delete restrict on update restrict;
  
  alter table link add constraint fk_link_id foreign key (id) references link_draft (id) on delete restrict on update restrict;
  
  create index ix_la_attr_value_attribute_la_attr_value on la_attr_value_attribute (la_attr_value_id);
  alter table la_attr_value_attribute add constraint fk_la_attr_value_attribute_la_attr_value foreign key (la_attr_value_id) references la_attr_value (id) on delete restrict on update restrict;
  
  create index ix_la_attr_value_attribute_attribute on la_attr_value_attribute (attribute_id);
  alter table la_attr_value_attribute add constraint fk_la_attr_value_attribute_attribute foreign key (attribute_id) references attribute (id) on delete restrict on update restrict;
  
  create index ix_looney_tune_id on looney (tune_id);
  alter table looney add constraint fk_looney_tune_id foreign key (tune_id) references tune (id) on delete restrict on update restrict;
  
  create index ix_m2mcache_set1_m2_mcache_master on m2mcache_set1 (m2_mcache_master_id);
  alter table m2mcache_set1 add constraint fk_m2mcache_set1_m2_mcache_master foreign key (m2_mcache_master_id) references m2_mcache_master (id) on delete restrict on update restrict;
  
  create index ix_m2mcache_set1_m2_mcache_child on m2mcache_set1 (m2_mcache_child_id);
  alter table m2mcache_set1 add constraint fk_m2mcache_set1_m2_mcache_child foreign key (m2_mcache_child_id) references m2_mcache_child (id) on delete restrict on update restrict;
  
  create index ix_m2mcache_set2_m2_mcache_master on m2mcache_set2 (m2_mcache_master_id);
  alter table m2mcache_set2 add constraint fk_m2mcache_set2_m2_mcache_master foreign key (m2_mcache_master_id) references m2_mcache_master (id) on delete restrict on update restrict;
  
  create index ix_m2mcache_set2_m2_mcache_child on m2mcache_set2 (m2_mcache_child_id);
  alter table m2mcache_set2 add constraint fk_m2mcache_set2_m2_mcache_child foreign key (m2_mcache_child_id) references m2_mcache_child (id) on delete restrict on update restrict;
  
  create index ix_mcontact_customer_id on mcontact (customer_id);
  alter table mcontact add constraint fk_mcontact_customer_id foreign key (customer_id) references mcustomer (id) on delete restrict on update restrict;
  
  create index ix_mcontact_message_contact_id on mcontact_message (contact_id);
  alter table mcontact_message add constraint fk_mcontact_message_contact_id foreign key (contact_id) references mcontact (id) on delete restrict on update restrict;
  
  create index ix_mcustomer_shipping_address_id on mcustomer (shipping_address_id);
  alter table mcustomer add constraint fk_mcustomer_shipping_address_id foreign key (shipping_address_id) references maddress (id) on delete restrict on update restrict;
  
  create index ix_mcustomer_billing_address_id on mcustomer (billing_address_id);
  alter table mcustomer add constraint fk_mcustomer_billing_address_id foreign key (billing_address_id) references maddress (id) on delete restrict on update restrict;
  
  create index ix_mmachine_mgroup_mmachine on mmachine_mgroup (mmachine_id);
  alter table mmachine_mgroup add constraint fk_mmachine_mgroup_mmachine foreign key (mmachine_id) references mmachine (id) on delete restrict on update restrict;
  
  create index ix_mmachine_mgroup_mgroup on mmachine_mgroup (mgroup_id);
  alter table mmachine_mgroup add constraint fk_mmachine_mgroup_mgroup foreign key (mgroup_id) references mgroup (id) on delete restrict on update restrict;
  
  create index ix_mprinter_current_state_id on mprinter (current_state_id);
  alter table mprinter add constraint fk_mprinter_current_state_id foreign key (current_state_id) references mprinter_state (id) on delete restrict on update restrict;
  
  alter table mprinter add constraint fk_mprinter_last_swap_cyan_id foreign key (last_swap_cyan_id) references mprinter_state (id) on delete restrict on update restrict;
  
  alter table mprinter add constraint fk_mprinter_last_swap_magenta_id foreign key (last_swap_magenta_id) references mprinter_state (id) on delete restrict on update restrict;
  
  alter table mprinter add constraint fk_mprinter_last_swap_yellow_id foreign key (last_swap_yellow_id) references mprinter_state (id) on delete restrict on update restrict;
  
  alter table mprinter add constraint fk_mprinter_last_swap_black_id foreign key (last_swap_black_id) references mprinter_state (id) on delete restrict on update restrict;
  
  create index ix_mprinter_state_printer_id on mprinter_state (printer_id);
  alter table mprinter_state add constraint fk_mprinter_state_printer_id foreign key (printer_id) references mprinter (id) on delete restrict on update restrict;
  
  create index ix_mprofile_picture_id on mprofile (picture_id);
  alter table mprofile add constraint fk_mprofile_picture_id foreign key (picture_id) references mmedia (id) on delete restrict on update restrict;
  
  create index ix_mrole_muser_mrole on mrole_muser (mrole_roleid);
  alter table mrole_muser add constraint fk_mrole_muser_mrole foreign key (mrole_roleid) references mrole (roleid) on delete restrict on update restrict;
  
  create index ix_mrole_muser_muser on mrole_muser (muser_userid);
  alter table mrole_muser add constraint fk_mrole_muser_muser foreign key (muser_userid) references muser (userid) on delete restrict on update restrict;
  
  create index ix_muser_user_type_id on muser (user_type_id);
  alter table muser add constraint fk_muser_user_type_id foreign key (user_type_id) references muser_type (id) on delete restrict on update restrict;
  
  create index ix_mail_user_inbox_mail_user on mail_user_inbox (mail_user_id);
  alter table mail_user_inbox add constraint fk_mail_user_inbox_mail_user foreign key (mail_user_id) references mail_user (id) on delete restrict on update restrict;
  
  create index ix_mail_user_inbox_mail_box on mail_user_inbox (mail_box_id);
  alter table mail_user_inbox add constraint fk_mail_user_inbox_mail_box foreign key (mail_box_id) references mail_box (id) on delete restrict on update restrict;
  
  create index ix_mail_user_outbox_mail_user on mail_user_outbox (mail_user_id);
  alter table mail_user_outbox add constraint fk_mail_user_outbox_mail_user foreign key (mail_user_id) references mail_user (id) on delete restrict on update restrict;
  
  create index ix_mail_user_outbox_mail_box on mail_user_outbox (mail_box_id);
  alter table mail_user_outbox add constraint fk_mail_user_outbox_mail_box foreign key (mail_box_id) references mail_box (id) on delete restrict on update restrict;
  
  create index ix_c_message_conversation_id on c_message (conversation_id);
  alter table c_message add constraint fk_c_message_conversation_id foreign key (conversation_id) references c_conversation (id) on delete restrict on update restrict;
  
  create index ix_c_message_user_id on c_message (user_id);
  alter table c_message add constraint fk_c_message_user_id foreign key (user_id) references c_user (id) on delete restrict on update restrict;
  
  alter table meter_contract_data add constraint fk_meter_contract_data_special_needs_client_id foreign key (special_needs_client_id) references meter_special_needs_client (id) on delete restrict on update restrict;
  
  alter table meter_special_needs_client add constraint fk_meter_special_needs_client_primary_id foreign key (primary_id) references meter_special_needs_contact (id) on delete restrict on update restrict;
  
  alter table meter_version add constraint fk_meter_version_address_data_id foreign key (address_data_id) references meter_address_data (id) on delete restrict on update restrict;
  
  alter table meter_version add constraint fk_meter_version_contract_data_id foreign key (contract_data_id) references meter_contract_data (id) on delete restrict on update restrict;
  
  create index ix_mnoc_user_mnoc_role_mnoc_user on mnoc_user_mnoc_role (mnoc_user_user_id);
  alter table mnoc_user_mnoc_role add constraint fk_mnoc_user_mnoc_role_mnoc_user foreign key (mnoc_user_user_id) references mnoc_user (user_id) on delete restrict on update restrict;
  
  create index ix_mnoc_user_mnoc_role_mnoc_role on mnoc_user_mnoc_role (mnoc_role_role_id);
  alter table mnoc_user_mnoc_role add constraint fk_mnoc_user_mnoc_role_mnoc_role foreign key (mnoc_role_role_id) references mnoc_role (role_id) on delete restrict on update restrict;
  
  create index ix_mny_b_a_id on mny_b (a_id);
  alter table mny_b add constraint fk_mny_b_a_id foreign key (a_id) references mny_a (id) on delete restrict on update restrict;
  
  create index ix_mny_b_mny_c_mny_b on mny_b_mny_c (mny_b_id);
  alter table mny_b_mny_c add constraint fk_mny_b_mny_c_mny_b foreign key (mny_b_id) references mny_b (id) on delete restrict on update restrict;
  
  create index ix_mny_b_mny_c_mny_c on mny_b_mny_c (mny_c_id);
  alter table mny_b_mny_c add constraint fk_mny_b_mny_c_mny_c foreign key (mny_c_id) references mny_c (id) on delete restrict on update restrict;
  
  create index ix_mny_edge_from_id on mny_edge (from_id);
  alter table mny_edge add constraint fk_mny_edge_from_id foreign key (from_id) references mny_node (id) on delete restrict on update restrict;
  
  create index ix_mny_edge_to_id on mny_edge (to_id);
  alter table mny_edge add constraint fk_mny_edge_to_id foreign key (to_id) references mny_node (id) on delete restrict on update restrict;
  
  create index ix_subtopics_mny_topic_1 on subtopics (topic);
  alter table subtopics add constraint fk_subtopics_mny_topic_1 foreign key (topic) references mny_topic (id) on delete restrict on update restrict;
  
  create index ix_subtopics_mny_topic_2 on subtopics (subtopic);
  alter table subtopics add constraint fk_subtopics_mny_topic_2 foreign key (subtopic) references mny_topic (id) on delete restrict on update restrict;
  
  create index ix_mp_role_mp_user_id on mp_role (mp_user_id);
  alter table mp_role add constraint fk_mp_role_mp_user_id foreign key (mp_user_id) references mp_user (id) on delete restrict on update restrict;
  
  create index ix_ms_many_a_many_b_ms_many_a on ms_many_a_many_b (ms_many_a_aid);
  alter table ms_many_a_many_b add constraint fk_ms_many_a_many_b_ms_many_a foreign key (ms_many_a_aid) references ms_many_a (aid) on delete restrict on update restrict;
  
  create index ix_ms_many_a_many_b_ms_many_b on ms_many_a_many_b (ms_many_b_bid);
  alter table ms_many_a_many_b add constraint fk_ms_many_a_many_b_ms_many_b foreign key (ms_many_b_bid) references ms_many_b (bid) on delete restrict on update restrict;
  
  create index ix_ms_many_b_many_a_ms_many_b on ms_many_b_many_a (ms_many_b_bid);
  alter table ms_many_b_many_a add constraint fk_ms_many_b_many_a_ms_many_b foreign key (ms_many_b_bid) references ms_many_b (bid) on delete restrict on update restrict;
  
  create index ix_ms_many_b_many_a_ms_many_a on ms_many_b_many_a (ms_many_a_aid);
  alter table ms_many_b_many_a add constraint fk_ms_many_b_many_a_ms_many_a foreign key (ms_many_a_aid) references ms_many_a (aid) on delete restrict on update restrict;
  
  create index ix_my_lob_size_join_many_parent_id on my_lob_size_join_many (parent_id);
  alter table my_lob_size_join_many add constraint fk_my_lob_size_join_many_parent_id foreign key (parent_id) references my_lob_size (id) on delete restrict on update restrict;
  
  create index ix_o_bean_child_cached_bean_id on o_bean_child (cached_bean_id);
  alter table o_bean_child add constraint fk_o_bean_child_cached_bean_id foreign key (cached_bean_id) references o_cached_bean (id) on delete restrict on update restrict;
  
  create index ix_ocached_app_detail_app_id on ocached_app_detail (app_id);
  alter table ocached_app_detail add constraint fk_ocached_app_detail_app_id foreign key (app_id) references ocached_app (id) on delete restrict on update restrict;
  
  create index ix_o_cached_bean_country_o_cached_bean on o_cached_bean_country (o_cached_bean_id);
  alter table o_cached_bean_country add constraint fk_o_cached_bean_country_o_cached_bean foreign key (o_cached_bean_id) references o_cached_bean (id) on delete restrict on update restrict;
  
  create index ix_o_cached_bean_country_o_country on o_cached_bean_country (o_country_code);
  alter table o_cached_bean_country add constraint fk_o_cached_bean_country_o_country foreign key (o_country_code) references o_country (code) on delete restrict on update restrict;
  
  create index ix_o_cached_bean_child_cached_bean_id on o_cached_bean_child (cached_bean_id);
  alter table o_cached_bean_child add constraint fk_o_cached_bean_child_cached_bean_id foreign key (cached_bean_id) references o_cached_bean (id) on delete restrict on update restrict;
  
  alter table oengine add constraint fk_oengine_car_id foreign key (car_id) references ocar (id) on delete restrict on update restrict;
  
  alter table ogear_box add constraint fk_ogear_box_car_id foreign key (car_id) references ocar (id) on delete restrict on update restrict;
  
  create index ix_omvertex_other_omvertex_id on omvertex_other (omvertex_id);
  alter table omvertex_other add constraint fk_omvertex_other_omvertex_id foreign key (omvertex_id) references omvertex (id) on delete restrict on update restrict;
  
  alter table oroad_show_msg add constraint fk_oroad_show_msg_company_id foreign key (company_id) references ocompany (id) on delete restrict on update restrict;
  
  create index ix_om_account_child_dbo_banana_rama_id on om_account_child_dbo (banana_rama_id);
  alter table om_account_child_dbo add constraint fk_om_account_child_dbo_banana_rama_id foreign key (banana_rama_id) references om_account_dbo (id) on delete restrict on update restrict;
  
  create index ix_om_basic_child_parent_id on om_basic_child (parent_id);
  alter table om_basic_child add constraint fk_om_basic_child_parent_id foreign key (parent_id) references om_basic_parent (id) on delete restrict on update restrict;
  
  create index ix_om_bean_list_child_parent_id on om_bean_list_child (parent_id);
  alter table om_bean_list_child add constraint fk_om_bean_list_child_parent_id foreign key (parent_id) references om_bean_list_parent (id) on delete restrict on update restrict;
  
  create index ix_om_ordered_detail_master_id on om_ordered_detail (master_id);
  alter table om_ordered_detail add constraint fk_om_ordered_detail_master_id foreign key (master_id) references om_ordered_master (id) on delete restrict on update restrict;
  
  create index ix_oml_baz_foo_id on oml_baz (foo_id);
  alter table oml_baz add constraint fk_oml_baz_foo_id foreign key (foo_id) references oml_foo (id) on delete restrict on update restrict;
  
  create index ix_oml_foo_bar_id on oml_foo (bar_id);
  alter table oml_foo add constraint fk_oml_foo_bar_id foreign key (bar_id) references oml_bar (id) on delete restrict on update restrict;
  
  create index ix_o_order_kcustomer_id on o_order (kcustomer_id);
  alter table o_order add constraint fk_o_order_kcustomer_id foreign key (kcustomer_id) references o_customer (id) on delete restrict on update restrict;
  
  create index ix_o_order_detail_order_id on o_order_detail (order_id);
  alter table o_order_detail add constraint fk_o_order_detail_order_id foreign key (order_id) references o_order (id) on delete restrict on update restrict;
  
  create index ix_o_order_detail_product_id on o_order_detail (product_id);
  alter table o_order_detail add constraint fk_o_order_detail_product_id foreign key (product_id) references o_product (id) on delete restrict on update restrict;
  
  create index ix_s_order_items_order_uuid on s_order_items (order_uuid);
  alter table s_order_items add constraint fk_s_order_items_order_uuid foreign key (order_uuid) references s_orders (uuid) on delete restrict on update restrict;
  
  create index ix_order_referenced_parent_master_id on order_referenced_parent (master_id);
  alter table order_referenced_parent add constraint fk_order_referenced_parent_master_id foreign key (master_id) references order_master (id) on delete restrict on update restrict;
  
  create index ix_or_order_ship_order_id on or_order_ship (order_id);
  alter table or_order_ship add constraint fk_or_order_ship_order_id foreign key (order_id) references o_order (id) on delete restrict on update restrict;
  
  create index ix_order_toy_child_id on order_toy (child_id);
  alter table order_toy add constraint fk_order_toy_child_id foreign key (child_id) references order_referenced_parent (id) on delete restrict on update restrict;
  
  create index ix_ordered_parent_order_master_inheritance_id on ordered_parent (order_master_inheritance_id);
  alter table ordered_parent add constraint fk_ordered_parent_order_master_inheritance_id foreign key (order_master_inheritance_id) references order_master_inheritance (id) on delete restrict on update restrict;
  
  alter table organization_node add constraint fk_organization_node_parent_tree_node_id foreign key (parent_tree_node_id) references organization_tree_node (id) on delete restrict on update restrict;
  
  create index ix_orp_detail_master_id on orp_detail (master_id);
  alter table orp_detail add constraint fk_orp_detail_master_id foreign key (master_id) references orp_master (id) on delete restrict on update restrict;
  
  create index ix_orp_detail2_orp_master2_id on orp_detail2 (orp_master2_id);
  alter table orp_detail2 add constraint fk_orp_detail2_orp_master2_id foreign key (orp_master2_id) references orp_master2 (id) on delete restrict on update restrict;
  
  alter table oto_atwo add constraint fk_oto_atwo_aone_id foreign key (aone_id) references oto_aone (id) on delete restrict on update restrict;
  
  alter table oto_bchild add constraint fk_oto_bchild_master_id foreign key (master_id) references oto_bmaster (id) on delete restrict on update restrict;
  
  alter table oto_child add constraint fk_oto_child_master_id foreign key (master_id) references oto_master (id) on delete restrict on update restrict;
  
  alter table oto_cust_address add constraint fk_oto_cust_address_customer_cid foreign key (customer_cid) references oto_cust (cid) on delete restrict on update restrict;
  
  alter table oto_level_a add constraint fk_oto_level_a_b_id foreign key (b_id) references oto_level_b (id) on delete restrict on update restrict;
  
  alter table oto_level_b add constraint fk_oto_level_b_c_id foreign key (c_id) references oto_level_c (id) on delete restrict on update restrict;
  
  alter table oto_prime_extra add constraint fk_oto_prime_extra_eid foreign key (eid) references oto_prime (pid) on delete restrict on update restrict;
  
  alter table oto_sd_child add constraint fk_oto_sd_child_master_id foreign key (master_id) references oto_sd_master (id) on delete restrict on update restrict;
  
  create index ix_oto_th_many_oto_th_top_id on oto_th_many (oto_th_top_id);
  alter table oto_th_many add constraint fk_oto_th_many_oto_th_top_id foreign key (oto_th_top_id) references oto_th_top (id) on delete restrict on update restrict;
  
  alter table oto_th_one add constraint fk_oto_th_one_many_id foreign key (many_id) references oto_th_many (id) on delete restrict on update restrict;
  
  alter table oto_ubprime_extra add constraint fk_oto_ubprime_extra_eid foreign key (eid) references oto_ubprime (pid) on delete restrict on update restrict;
  
  alter table oto_user_model add constraint fk_oto_user_model_user_optional_id foreign key (user_optional_id) references oto_user_model_optional (id) on delete restrict on update restrict;
  
  alter table pfile add constraint fk_pfile_file_content_id foreign key (file_content_id) references pfile_content (id) on delete restrict on update restrict;
  
  alter table pfile add constraint fk_pfile_file_content2_id foreign key (file_content2_id) references pfile_content (id) on delete restrict on update restrict;
  
  alter table paggview add constraint fk_paggview_pview_id foreign key (pview_id) references pp (id) on delete restrict on update restrict;
  
  create index ix_pallet_location_zone_sid on pallet_location (zone_sid);
  alter table pallet_location add constraint fk_pallet_location_zone_sid foreign key (zone_sid) references zones (id) on delete restrict on update restrict;
  
  alter table parcel_location add constraint fk_parcel_location_parcelid foreign key (parcelid) references parcel (parcelid) on delete restrict on update restrict;
  
  create index ix_rawinherit_parent_rawinherit_data_rawinherit_parent on rawinherit_parent_rawinherit_data (rawinherit_parent_id);
  alter table rawinherit_parent_rawinherit_data add constraint fk_rawinherit_parent_rawinherit_data_rawinherit_parent foreign key (rawinherit_parent_id) references rawinherit_parent (id) on delete restrict on update restrict;
  
  create index ix_rawinherit_parent_rawinherit_data_rawinherit_data on rawinherit_parent_rawinherit_data (rawinherit_data_id);
  alter table rawinherit_parent_rawinherit_data add constraint fk_rawinherit_parent_rawinherit_data_rawinherit_data foreign key (rawinherit_data_id) references rawinherit_data (id) on delete restrict on update restrict;
  
  create index ix_parent_a_child_id on parent_a (child_id);
  alter table parent_a add constraint fk_parent_a_child_id foreign key (child_id) references child_with_cache (id) on delete restrict on update restrict;
  
  create index ix_parent_b_child_id on parent_b (child_id);
  alter table parent_b add constraint fk_parent_b_child_id foreign key (child_id) references child_with_cache (id) on delete restrict on update restrict;
  
  create index ix_parent_person_some_bean_id on parent_person (some_bean_id);
  alter table parent_person add constraint fk_parent_person_some_bean_id foreign key (some_bean_id) references e_basic (id) on delete restrict on update restrict;
  
  create index ix_parent_person_parent_identifier on parent_person (parent_identifier);
  alter table parent_person add constraint fk_parent_person_parent_identifier foreign key (parent_identifier) references grand_parent_person (identifier) on delete restrict on update restrict;
  
  create index ix_c_participation_conversation_id on c_participation (conversation_id);
  alter table c_participation add constraint fk_c_participation_conversation_id foreign key (conversation_id) references c_conversation (id) on delete restrict on update restrict;
  
  create index ix_c_participation_user_id on c_participation (user_id);
  alter table c_participation add constraint fk_c_participation_user_id foreign key (user_id) references c_user (id) on delete restrict on update restrict;
  
  create index ix_pcf_calendar_pcf_person_id on pcf_calendar (pcf_person_id);
  alter table pcf_calendar add constraint fk_pcf_calendar_pcf_person_id foreign key (pcf_person_id) references pcf_person (id) on delete restrict on update restrict;
  
  create index ix_pcf_city_pcf_country_id on pcf_city (pcf_country_id);
  alter table pcf_city add constraint fk_pcf_city_pcf_country_id foreign key (pcf_country_id) references pcf_country (id) on delete restrict on update restrict;
  
  alter table pcf_city add constraint fk_pcf_city_mayor_id foreign key (mayor_id) references pcf_person (id) on delete restrict on update restrict;
  
  alter table pcf_city add constraint fk_pcf_city_vice_mayor_id foreign key (vice_mayor_id) references pcf_person (id) on delete restrict on update restrict;
  
  create index ix_pcf_event_pcf_calendar_id on pcf_event (pcf_calendar_id);
  alter table pcf_event add constraint fk_pcf_event_pcf_calendar_id foreign key (pcf_calendar_id) references pcf_calendar (id) on delete restrict on update restrict;
  
  alter table persistent_file_content add constraint fk_persistent_file_content_persistent_file_id foreign key (persistent_file_id) references persistent_file (id) on delete restrict on update restrict;
  
  create index ix_person_default_address_oid on person (default_address_oid);
  alter table person add constraint fk_person_default_address_oid foreign key (default_address_oid) references address (oid) on delete restrict on update restrict;
  
  create index ix_person_cache_email_person_info_person_id on person_cache_email (person_info_person_id);
  alter table person_cache_email add constraint fk_person_cache_email_person_info_person_id foreign key (person_info_person_id) references person_cache_info (person_id) on delete restrict on update restrict;
  
  alter table persona add constraint fk_persona_person_oid foreign key (person_oid) references person (oid) on delete restrict on update restrict;
  
  create index ix_phones_person_id on phones (person_id);
  alter table phones add constraint fk_phones_person_id foreign key (person_id) references persons (id) on delete restrict on update restrict;
  
  create index ix_e_position_contract_id on e_position (contract_id);
  alter table e_position add constraint fk_e_position_contract_id foreign key (contract_id) references contract (id) on delete restrict on update restrict;
  
  create index ix_pp_to_ww_pp on pp_to_ww (pp_id);
  alter table pp_to_ww add constraint fk_pp_to_ww_pp foreign key (pp_id) references pp (id) on delete restrict on update restrict;
  
  create index ix_pp_to_ww_wview on pp_to_ww (ww_id);
  alter table pp_to_ww add constraint fk_pp_to_ww_wview foreign key (ww_id) references wview (id) on delete restrict on update restrict;
  
  create index ix_question_groupobjectid on question (groupobjectid);
  alter table question add constraint fk_question_groupobjectid foreign key (groupobjectid) references survey_group (id) on delete restrict on update restrict;
  
  create index ix_r_orders_customer on r_orders (company,customername);
  alter table r_orders add constraint fk_r_orders_customer foreign key (company,customername) references rcustomer (company,name) on delete restrict on update restrict;
  
  alter table referenced_defaults_model add constraint fk_referenced_defaults_model_id foreign key (id) references referenced_defaults_model_draft (id) on delete restrict on update restrict;
  
  create index ix_referenced_defaults_model_defaults_model_id on referenced_defaults_model (defaults_model_id);
  alter table referenced_defaults_model add constraint fk_referenced_defaults_model_defaults_model_id foreign key (defaults_model_id) references defaults_model (id) on delete restrict on update restrict;
  
  create index ix_referenced_defaults_model_draft_defaults_model_id on referenced_defaults_model_draft (defaults_model_id);
  alter table referenced_defaults_model_draft add constraint fk_referenced_defaults_model_draft_defaults_model_id foreign key (defaults_model_id) references defaults_model_draft (id) on delete restrict on update restrict;
  
  create index ix_rel_master_detail_id on rel_master (detail_id);
  alter table rel_master add constraint fk_rel_master_detail_id foreign key (detail_id) references rel_detail (id) on delete restrict on update restrict;
  
  create index ix_app_config_re_config_id on app_config_re (config_id);
  alter table app_config_re add constraint fk_app_config_re_config_id foreign key (config_id) references app_config (id) on delete restrict on update restrict;
  
  create index ix_resourcefile_parentresourcefileid on resourcefile (parentresourcefileid);
  alter table resourcefile add constraint fk_resourcefile_parentresourcefileid foreign key (parentresourcefileid) references resourcefile (id) on delete restrict on update restrict;
  
  create index ix_mt_role_tenant_id on mt_role (tenant_id);
  alter table mt_role add constraint fk_mt_role_tenant_id foreign key (tenant_id) references mt_tenant (id) on delete restrict on update restrict;
  
  create index ix_mt_role_permission_mt_role on mt_role_permission (mt_role_id);
  alter table mt_role_permission add constraint fk_mt_role_permission_mt_role foreign key (mt_role_id) references mt_role (id) on delete restrict on update restrict;
  
  create index ix_mt_role_permission_mt_permission on mt_role_permission (mt_permission_id);
  alter table mt_role_permission add constraint fk_mt_role_permission_mt_permission foreign key (mt_permission_id) references mt_permission (id) on delete restrict on update restrict;
  
  create index ix_root_bean_referencing_bean_id on root_bean (referencing_bean_id);
  alter table root_bean add constraint fk_root_bean_referencing_bean_id foreign key (referencing_bean_id) references referencing_bean (id) on delete restrict on update restrict;
  
  alter table f_second add constraint fk_f_second_first foreign key (first) references f_first (id) on delete restrict on update restrict;
  
  create index ix_section_article_id on section (article_id);
  alter table section add constraint fk_section_article_id foreign key (article_id) references article (id) on delete restrict on update restrict;
  
  create index ix_self_many_bridge_self_many_many_1 on self_many_bridge (self_1_id);
  alter table self_many_bridge add constraint fk_self_many_bridge_self_many_many_1 foreign key (self_1_id) references self_many_many (id) on delete restrict on update restrict;
  
  create index ix_self_many_bridge_self_many_many_2 on self_many_bridge (self_2_id);
  alter table self_many_bridge add constraint fk_self_many_bridge_self_many_many_2 foreign key (self_2_id) references self_many_many (id) on delete restrict on update restrict;
  
  create index ix_self_parent_parent_id on self_parent (parent_id);
  alter table self_parent add constraint fk_self_parent_parent_id foreign key (parent_id) references self_parent (id) on delete restrict on update restrict;
  
  create index ix_self_ref_customer_referred_by_id on self_ref_customer (referred_by_id);
  alter table self_ref_customer add constraint fk_self_ref_customer_referred_by_id foreign key (referred_by_id) references self_ref_customer (id) on delete restrict on update restrict;
  
  create index ix_self_ref_example_parent_id on self_ref_example (parent_id);
  alter table self_ref_example add constraint fk_self_ref_example_parent_id foreign key (parent_id) references self_ref_example (id) on delete restrict on update restrict;
  
  alter table e_save_test_b add constraint fk_e_save_test_b_sibling_a_id foreign key (sibling_a_id) references e_save_test_a (id) on delete restrict on update restrict;
  
  create index ix_site_parent_id on site (parent_id);
  alter table site add constraint fk_site_parent_id foreign key (parent_id) references site (id) on delete restrict on update restrict;
  
  alter table site add constraint fk_site_data_container_id foreign key (data_container_id) references data_container (id) on delete restrict on update restrict;
  
  alter table site add constraint fk_site_site_address_id foreign key (site_address_id) references site_address (id) on delete restrict on update restrict;
  
  create index ix_source_base_target_id on source_base (target_id);
  alter table source_base add constraint fk_source_base_target_id foreign key (target_id) references target_base (id) on delete restrict on update restrict;
  
  create index ix_stockforecast_inner_report_id on stockforecast (inner_report_id);
  alter table stockforecast add constraint fk_stockforecast_inner_report_id foreign key (inner_report_id) references inner_report (id) on delete restrict on update restrict;
  
  create index ix_sub_section_section_id on sub_section (section_id);
  alter table sub_section add constraint fk_sub_section_section_id foreign key (section_id) references section (id) on delete restrict on update restrict;
  
  create index ix_tevent_many_event_id on tevent_many (event_id);
  alter table tevent_many add constraint fk_tevent_many_event_id foreign key (event_id) references tevent_one (id) on delete restrict on update restrict;
  
  alter table tevent_one add constraint fk_tevent_one_event_id foreign key (event_id) references tevent (id) on delete restrict on update restrict;
  
  create index ix_t_detail_with_other_namexxxyy_master_id on t_detail_with_other_namexxxyy (master_id);
  alter table t_detail_with_other_namexxxyy add constraint fk_t_detail_with_other_namexxxyy_master_id foreign key (master_id) references t_atable_thatisrelatively (id) on delete restrict on update restrict;
  
  create index ix_ttruck_holder_truck_plate_no on ttruck_holder (truck_plate_no);
  alter table ttruck_holder add constraint fk_ttruck_holder_truck_plate_no foreign key (truck_plate_no) references tcar (plate_no) on delete restrict on update restrict;
  
  create index ix_ttruck_holder_basic_id on ttruck_holder (basic_id);
  alter table ttruck_holder add constraint fk_ttruck_holder_basic_id foreign key (basic_id) references e_basic (id) on delete restrict on update restrict;
  
  create index ix_ttruck_holder_item_owner_id on ttruck_holder_item (owner_id);
  alter table ttruck_holder_item add constraint fk_ttruck_holder_item_owner_id foreign key (owner_id) references ttruck_holder (id) on delete restrict on update restrict;
  
  create index ix_twheel_owner_plate_no on twheel (owner_plate_no);
  alter table twheel add constraint fk_twheel_owner_plate_no foreign key (owner_plate_no) references tcar (plate_no) on delete restrict on update restrict;
  
  alter table tire add constraint fk_tire_wheel foreign key (wheel) references wheel (id) on delete restrict on update restrict;
  
  create index ix_tree_entity_parent_id on tree_entity (parent_id);
  alter table tree_entity add constraint fk_tree_entity_parent_id foreign key (parent_id) references tree_entity (id) on delete restrict on update restrict;
  
  create index ix_trip_vehicle_driver_id on trip (vehicle_driver_id);
  alter table trip add constraint fk_trip_vehicle_driver_id foreign key (vehicle_driver_id) references vehicle_driver (id) on delete restrict on update restrict;
  
  create index ix_trip_address_id on trip (address_id);
  alter table trip add constraint fk_trip_address_id foreign key (address_id) references o_address (id) on delete restrict on update restrict;
  
  create index ix_type_sub_type_id on "type" (sub_type_id);
  alter table "type" add constraint fk_type_sub_type_id foreign key (sub_type_id) references sub_type (sub_type_id) on delete restrict on update restrict;
  
  create index ix_usib_child_parent_id on usib_child (parent_id);
  alter table usib_child add constraint fk_usib_child_parent_id foreign key (parent_id) references usib_parent (id) on delete restrict on update restrict;
  
  alter table usib_child_sibling add constraint fk_usib_child_sibling_child_id foreign key (child_id) references usib_child (id) on delete restrict on update restrict;
  
  create index ix_ut_detail_utmaster_id on ut_detail (utmaster_id);
  alter table ut_detail add constraint fk_ut_detail_utmaster_id foreign key (utmaster_id) references ut_master (id) on delete restrict on update restrict;
  
  create index ix_uutwo_master_id on uutwo (master_id);
  alter table uutwo add constraint fk_uutwo_master_id foreign key (master_id) references uuone (id) on delete restrict on update restrict;
  
  alter table oto_user add constraint fk_oto_user_account_id foreign key (account_id) references oto_account (id) on delete restrict on update restrict;
  
  create index ix_c_user_group_id on c_user (group_id);
  alter table c_user add constraint fk_c_user_group_id foreign key (group_id) references c_group (id) on delete restrict on update restrict;
  
  create index ix_em_user_role_user_id on em_user_role (user_id);
  alter table em_user_role add constraint fk_em_user_role_user_id foreign key (user_id) references em_user (id) on delete restrict on update restrict;
  
  create index ix_em_user_role_role_id on em_user_role (role_id);
  alter table em_user_role add constraint fk_em_user_role_role_id foreign key (role_id) references em_role (id) on delete restrict on update restrict;
  
  create index ix_vehicle_lease_id on vehicle (lease_id);
  alter table vehicle add constraint fk_vehicle_lease_id foreign key (lease_id) references vehicle_lease (id) on delete restrict on update restrict;
  
  create index ix_vehicle_car_ref_id on vehicle (car_ref_id);
  alter table vehicle add constraint fk_vehicle_car_ref_id foreign key (car_ref_id) references truck_ref (id) on delete restrict on update restrict;
  
  create index ix_vehicle_truck_ref_id on vehicle (truck_ref_id);
  alter table vehicle add constraint fk_vehicle_truck_ref_id foreign key (truck_ref_id) references truck_ref (id) on delete restrict on update restrict;
  
  create index ix_vehicle_driver_vehicle_id on vehicle_driver (vehicle_id);
  alter table vehicle_driver add constraint fk_vehicle_driver_vehicle_id foreign key (vehicle_id) references vehicle (id) on delete restrict on update restrict;
  
  create index ix_vehicle_driver_address_id on vehicle_driver (address_id);
  alter table vehicle_driver add constraint fk_vehicle_driver_address_id foreign key (address_id) references o_address (id) on delete restrict on update restrict;
  
  create index ix_version_child_parent_id on version_child (parent_id);
  alter table version_child add constraint fk_version_child_parent_id foreign key (parent_id) references version_parent (id) on delete restrict on update restrict;
  
  create index ix_version_toy_child_id on version_toy (child_id);
  alter table version_toy add constraint fk_version_toy_child_id foreign key (child_id) references version_child (id) on delete restrict on update restrict;
  
  create index ix_warehouses_officezoneid on warehouses (officezoneid);
  alter table warehouses add constraint fk_warehouses_officezoneid foreign key (officezoneid) references zones (id) on delete restrict on update restrict;
  
  create index ix_warehousesshippingzones_warehouses on warehousesshippingzones (warehouseid);
  alter table warehousesshippingzones add constraint fk_warehousesshippingzones_warehouses foreign key (warehouseid) references warehouses (id) on delete restrict on update restrict;
  
  create index ix_warehousesshippingzones_zones on warehousesshippingzones (shippingzoneid);
  alter table warehousesshippingzones add constraint fk_warehousesshippingzones_zones foreign key (shippingzoneid) references zones (id) on delete restrict on update restrict;
  
  create index ix_sa_wheel_tire on sa_wheel (tire);
  alter table sa_wheel add constraint fk_sa_wheel_tire foreign key (tire) references sa_tire (id) on delete restrict on update restrict;
  
  create index ix_sa_wheel_car on sa_wheel (car);
  alter table sa_wheel add constraint fk_sa_wheel_car foreign key (car) references sa_car (id) on delete restrict on update restrict;
  
  create index ix_g_who_props_otm_who_created_id on g_who_props_otm (who_created_id);
  alter table g_who_props_otm add constraint fk_g_who_props_otm_who_created_id foreign key (who_created_id) references g_user (id) on delete restrict on update restrict;
  
  create index ix_g_who_props_otm_who_modified_id on g_who_props_otm (who_modified_id);
  alter table g_who_props_otm add constraint fk_g_who_props_otm_who_modified_id foreign key (who_modified_id) references g_user (id) on delete restrict on update restrict;
  
  create index ix_with_zero_parent_id on with_zero (parent_id);
  alter table with_zero add constraint fk_with_zero_parent_id foreign key (parent_id) references parent (id) on delete restrict on update restrict;
  
  alter table hembi_bean add column sys_period_start timestamp default now();
  alter table hembi_bean add column sys_period_end timestamp;
  create table hembi_bean_history(
    part                          bigint,
    brand                         varchar(20),
    name                          varchar(255),
    description                   varchar(255),
    version                       bigint,
    sys_period_start              timestamp,
    sys_period_end                timestamp
  );
  create view hembi_bean_with_history as select * from hembi_bean union all select * from hembi_bean_history;
  
  alter table hx_link add column sys_period_start timestamp default now();
  alter table hx_link add column sys_period_end timestamp;
  update hx_link set sys_period_start = when_created;
  create table hx_link_history(
    id                            bigint,
    name                          varchar(255),
    location                      varchar(255),
    comments                      varchar(255),
    version                       bigint,
    when_created                  timestamp,
    when_modified                 timestamp,
    deleted                       boolean,
    sys_period_start              timestamp,
    sys_period_end                timestamp
  );
  create view hx_link_with_history as select * from hx_link union all select * from hx_link_history;
  
  alter table hi_link add column sys_period_start timestamp default now();
  alter table hi_link add column sys_period_end timestamp;
  update hi_link set sys_period_start = when_created;
  create table hi_link_history(
    id                            bigint,
    name                          varchar(255),
    location                      varchar(255),
    comments                      varchar(255),
    version                       bigint,
    when_created                  timestamp,
    when_modified                 timestamp,
    sys_period_start              timestamp,
    sys_period_end                timestamp
  );
  create view hi_link_with_history as select * from hi_link union all select * from hi_link_history;
  
  alter table hi_link_doc add column sys_period_start timestamp default now();
  alter table hi_link_doc add column sys_period_end timestamp;
  create table hi_link_doc_history(
    hi_link_id                    bigint,
    hi_doc_id                     bigint,
    sys_period_start              timestamp,
    sys_period_end                timestamp
  );
  create view hi_link_doc_with_history as select * from hi_link_doc union all select * from hi_link_doc_history;
  
  alter table hi_tone add column sys_period_start timestamp default now();
  alter table hi_tone add column sys_period_end timestamp;
  update hi_tone set sys_period_start = when_created;
  create table hi_tone_history(
    id                            bigint,
    name                          varchar(255),
    comments                      varchar(255),
    version                       bigint,
    when_created                  timestamp,
    when_modified                 timestamp,
    sys_period_start              timestamp,
    sys_period_end                timestamp
  );
  create view hi_tone_with_history as select * from hi_tone union all select * from hi_tone_history;
  
  alter table hi_tthree add column sys_period_start timestamp default now();
  alter table hi_tthree add column sys_period_end timestamp;
  update hi_tthree set sys_period_start = when_created;
  create table hi_tthree_history(
    id                            bigint,
    hi_ttwo_id                    bigint,
    three                         varchar(255),
    version                       bigint,
    when_created                  timestamp,
    when_modified                 timestamp,
    sys_period_start              timestamp,
    sys_period_end                timestamp
  );
  create view hi_tthree_with_history as select * from hi_tthree union all select * from hi_tthree_history;
  
  alter table hi_ttwo add column sys_period_start timestamp default now();
  alter table hi_ttwo add column sys_period_end timestamp;
  update hi_ttwo set sys_period_start = when_created;
  create table hi_ttwo_history(
    id                            bigint,
    hi_tone_id                    bigint,
    two                           varchar(255),
    version                       bigint,
    when_created                  timestamp,
    when_modified                 timestamp,
    sys_period_start              timestamp,
    sys_period_end                timestamp
  );
  create view hi_ttwo_with_history as select * from hi_ttwo union all select * from hi_ttwo_history;
  
  alter table hsd_setting add column sys_period_start timestamp default now();
  alter table hsd_setting add column sys_period_end timestamp;
  update hsd_setting set sys_period_start = when_created;
  create table hsd_setting_history(
    id                            bigint,
    code                          varchar(255),
    content                       varchar(255),
    user_id                       bigint,
    version                       bigint,
    when_created                  timestamp,
    when_modified                 timestamp,
    deleted                       boolean,
    sys_period_start              timestamp,
    sys_period_end                timestamp
  );
  create view hsd_setting_with_history as select * from hsd_setting union all select * from hsd_setting_history;
  
  alter table hsd_user add column sys_period_start timestamp default now();
  alter table hsd_user add column sys_period_end timestamp;
  update hsd_user set sys_period_start = when_created;
  create table hsd_user_history(
    id                            bigint,
    name                          varchar(255),
    version                       bigint,
    when_created                  timestamp,
    when_modified                 timestamp,
    deleted                       boolean,
    sys_period_start              timestamp,
    sys_period_end                timestamp
  );
  create view hsd_user_with_history as select * from hsd_user union all select * from hsd_user_history;
  
  alter table link add column sys_period_start timestamp default now();
  alter table link add column sys_period_end timestamp;
  update link set sys_period_start = when_created;
  create table link_history(
    id                            bigint,
    name                          varchar(255),
    location                      varchar(255),
    when_publish                  timestamp,
    link_comment                  varchar(255),
    version                       bigint,
    when_created                  timestamp,
    when_modified                 timestamp,
    deleted                       boolean,
    sys_period_start              timestamp,
    sys_period_end                timestamp
  );
  create view link_with_history as select * from link union all select * from link_history;
  
  alter table c_user add column sys_period_start timestamp default now();
  alter table c_user add column sys_period_end timestamp;
  update c_user set sys_period_start = when_created;
  create table c_user_history(
    id                            bigint,
    inactive                      boolean,
    name                          varchar(255),
    email                         varchar(255),
    password_hash                 varchar(255),
    group_id                      bigint,
    version                       bigint,
    when_created                  timestamp,
    when_modified                 timestamp,
    sys_period_start              timestamp,
    sys_period_end                timestamp
  );
  create view c_user_with_history as select * from c_user union all select * from c_user_history;
  
  create trigger hembi_bean_history_upd before update,delete on hembi_bean for each row call "io.ebean.config.dbplatform.h2.H2HistoryTrigger";
  create trigger hx_link_history_upd before update,delete on hx_link for each row call "io.ebean.config.dbplatform.h2.H2HistoryTrigger";
  create trigger hi_link_history_upd before update,delete on hi_link for each row call "io.ebean.config.dbplatform.h2.H2HistoryTrigger";
  create trigger hi_link_doc_history_upd before update,delete on hi_link_doc for each row call "io.ebean.config.dbplatform.h2.H2HistoryTrigger";
  create trigger hi_tone_history_upd before update,delete on hi_tone for each row call "io.ebean.config.dbplatform.h2.H2HistoryTrigger";
  create trigger hi_tthree_history_upd before update,delete on hi_tthree for each row call "io.ebean.config.dbplatform.h2.H2HistoryTrigger";
  create trigger hi_ttwo_history_upd before update,delete on hi_ttwo for each row call "io.ebean.config.dbplatform.h2.H2HistoryTrigger";
  create trigger hsd_setting_history_upd before update,delete on hsd_setting for each row call "io.ebean.config.dbplatform.h2.H2HistoryTrigger";
  create trigger hsd_user_history_upd before update,delete on hsd_user for each row call "io.ebean.config.dbplatform.h2.H2HistoryTrigger";
  create trigger link_history_upd before update,delete on link for each row call "io.ebean.config.dbplatform.h2.H2HistoryTrigger";
  create trigger c_user_history_upd before update,delete on c_user for each row call "io.ebean.config.dbplatform.h2.H2HistoryTrigger";
  