From 0b24d635adf65c7295ee9c9a0c20582f40ae8fcd Mon Sep 17 00:00:00 2001 From: rob bygrave Date: Mon, 7 Dec 2020 22:48:32 +1300 Subject: [PATCH] Tests only - update ddl review --- .../src/test/ddl-review/h2-create-all.sql | 5188 ++++++++++++++++ .../src/test/ddl-review/h2-drop-all.sql | 1959 ++++++ .../test/ddl-review/mariadb-create-all.sql | 4909 +++++++++++++++ .../src/test/ddl-review/mariadb-drop-all.sql | 1868 ++++++ .../src/test/ddl-review/mysql-create-all.sql | 5008 ++++++++++++++++ .../src/test/ddl-review/mysql-drop-all.sql | 1867 ++++++ .../src/test/ddl-review/oracle-create-all.sql | 4826 +++++++++++++++ .../src/test/ddl-review/oracle-drop-all.sql | 1821 ++++++ .../src/test/ddl-review/pg-create-all.sql | 5236 ++++++++++++++++ .../src/test/ddl-review/pg-drop-all.sql | 1957 ++++++ .../test/ddl-review/sqlserver-create-all.sql | 5308 +++++++++++++++++ .../test/ddl-review/sqlserver-drop-all.sql | 2234 +++++++ 12 files changed, 42181 insertions(+) create mode 100644 ebean-core/src/test/ddl-review/h2-create-all.sql create mode 100644 ebean-core/src/test/ddl-review/h2-drop-all.sql create mode 100644 ebean-core/src/test/ddl-review/mariadb-create-all.sql create mode 100644 ebean-core/src/test/ddl-review/mariadb-drop-all.sql create mode 100644 ebean-core/src/test/ddl-review/mysql-create-all.sql create mode 100644 ebean-core/src/test/ddl-review/mysql-drop-all.sql create mode 100644 ebean-core/src/test/ddl-review/oracle-create-all.sql create mode 100644 ebean-core/src/test/ddl-review/oracle-drop-all.sql create mode 100644 ebean-core/src/test/ddl-review/pg-create-all.sql create mode 100644 ebean-core/src/test/ddl-review/pg-drop-all.sql create mode 100644 ebean-core/src/test/ddl-review/sqlserver-create-all.sql create mode 100644 ebean-core/src/test/ddl-review/sqlserver-drop-all.sql diff --git a/ebean-core/src/test/ddl-review/h2-create-all.sql b/ebean-core/src/test/ddl-review/h2-create-all.sql new file mode 100644 index 000000000..dc5f4879f --- /dev/null +++ b/ebean-core/src/test/ddl-review/h2-create-all.sql @@ -0,0 +1,5188 @@ +-- Generated by ebean unknown at 2020-12-07T09:40:50.461215Z +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 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)) +); + +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 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 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, + 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), + 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(20), + 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), + 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_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_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_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_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) not null, + ship_suburb varchar(255), + ship_city varchar(255), + ship_status varchar(3), + bill_street varchar(255) not null, + bill_suburb varchar(255), + bill_city varchar(255), + bill_status varchar(3), + 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) not null, + suburb varchar(255), + addr_city varchar(255), + addr_status varchar(3), + 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) not null, + status varchar(3) not null, + 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), + 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 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 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_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_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_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 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 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_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, + 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 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_annotation_base_entity (direct); +create index ano_2 on test_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_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_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; + +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 cascade; + +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 set null; + +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; + +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_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_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_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_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; + +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_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_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"; diff --git a/ebean-core/src/test/ddl-review/h2-drop-all.sql b/ebean-core/src/test/ddl-review/h2-drop-all.sql new file mode 100644 index 000000000..16a4f3c7a --- /dev/null +++ b/ebean-core/src/test/ddl-review/h2-drop-all.sql @@ -0,0 +1,1959 @@ +-- Generated by ebean unknown at 2020-12-07T09:40:50.461215Z +alter table bar drop constraint if exists fk_bar_foo_id; +drop index if exists ix_bar_foo_id; + +alter table acl_container_relation drop constraint if exists fk_acl_container_relation_container_id; +drop index if exists ix_acl_container_relation_container_id; + +alter table acl_container_relation drop constraint if exists fk_acl_container_relation_acl_entry_id; +drop index if exists ix_acl_container_relation_acl_entry_id; + +alter table addr drop constraint if exists fk_addr_employee_id; +drop index if exists ix_addr_employee_id; + +alter table o_address drop constraint if exists fk_o_address_country_code; +drop index if exists ix_o_address_country_code; + +alter table album drop constraint if exists fk_album_cover_id; + +alter table animal drop constraint if exists fk_animal_shelter_id; +drop index if exists ix_animal_shelter_id; + +alter table attribute drop constraint if exists fk_attribute_attribute_holder_id; +drop index if exists ix_attribute_attribute_holder_id; + +alter table bbookmark drop constraint if exists fk_bbookmark_user_id; +drop index if exists ix_bbookmark_user_id; + +alter table bbookmark_user drop constraint if exists fk_bbookmark_user_org_id; +drop index if exists ix_bbookmark_user_org_id; + +alter table bsite_user_a drop constraint if exists fk_bsite_user_a_site_id; +drop index if exists ix_bsite_user_a_site_id; + +alter table bsite_user_a drop constraint if exists fk_bsite_user_a_user_id; +drop index if exists ix_bsite_user_a_user_id; + +alter table bsite_user_b drop constraint if exists fk_bsite_user_b_site; +drop index if exists ix_bsite_user_b_site; + +alter table bsite_user_b drop constraint if exists fk_bsite_user_b_usr; +drop index if exists ix_bsite_user_b_usr; + +alter table bsite_user_c drop constraint if exists fk_bsite_user_c_site_uid; +drop index if exists ix_bsite_user_c_site_uid; + +alter table bsite_user_c drop constraint if exists fk_bsite_user_c_user_uid; +drop index if exists ix_bsite_user_c_user_uid; + +alter table bsite_user_e drop constraint if exists fk_bsite_user_e_site_id; +drop index if exists ix_bsite_user_e_site_id; + +alter table bsite_user_e drop constraint if exists fk_bsite_user_e_user_id; +drop index if exists ix_bsite_user_e_user_id; + +alter table basic_draftable_bean drop constraint if exists fk_basic_draftable_bean_id; + +alter table drel_booking drop constraint if exists fk_drel_booking_agent_invoice; + +alter table drel_booking drop constraint if exists fk_drel_booking_client_invoice; + +alter table cepproduct_category drop constraint if exists fk_cepproduct_category_category_id; +drop index if exists ix_cepproduct_category_category_id; + +alter table cepproduct_category drop constraint if exists fk_cepproduct_category_product_id; +drop index if exists ix_cepproduct_category_product_id; + +alter table ciaddress drop constraint if exists fk_ciaddress_street_id; +drop index if exists ix_ciaddress_street_id; + +alter table cicustomer_parent drop constraint if exists fk_cicustomer_parent_address_id; +drop index if exists ix_cicustomer_parent_address_id; + +alter table cinh_ref drop constraint if exists fk_cinh_ref_ref_id; +drop index if exists ix_cinh_ref_ref_id; + +alter table ckey_detail drop constraint if exists fk_ckey_detail_parent; +drop index if exists ix_ckey_detail_parent; + +alter table ckey_parent drop constraint if exists fk_ckey_parent_assoc_id; +drop index if exists ix_ckey_parent_assoc_id; + +alter table coone_many drop constraint if exists fk_coone_many_coone_id; +drop index if exists ix_coone_many_coone_id; + +alter table coroot drop constraint if exists fk_coroot_one_id; + +alter table calculation_result drop constraint if exists fk_calculation_result_product_configuration_id; +drop index if exists ix_calculation_result_product_configuration_id; + +alter table calculation_result drop constraint if exists fk_calculation_result_group_configuration_id; +drop index if exists ix_calculation_result_group_configuration_id; + +alter table sp_car_car_wheels drop constraint if exists fk_sp_car_car_wheels_sp_car_car; +drop index if exists ix_sp_car_car_wheels_sp_car_car; + +alter table sp_car_car_wheels drop constraint if exists fk_sp_car_car_wheels_sp_car_wheel; +drop index if exists ix_sp_car_car_wheels_sp_car_wheel; + +alter table sp_car_car_doors drop constraint if exists fk_sp_car_car_doors_sp_car_car; +drop index if exists ix_sp_car_car_doors_sp_car_car; + +alter table sp_car_car_doors drop constraint if exists fk_sp_car_car_doors_sp_car_door; +drop index if exists ix_sp_car_car_doors_sp_car_door; + +alter table car_accessory drop constraint if exists fk_car_accessory_fuse_id; +drop index if exists ix_car_accessory_fuse_id; + +alter table car_accessory drop constraint if exists fk_car_accessory_car_id; +drop index if exists ix_car_accessory_car_id; + +alter table category drop constraint if exists fk_category_surveyobjectid; +drop index if exists ix_category_surveyobjectid; + +alter table e_save_test_d drop constraint if exists fk_e_save_test_d_parent_id; + +alter table child_person drop constraint if exists fk_child_person_some_bean_id; +drop index if exists ix_child_person_some_bean_id; + +alter table child_person drop constraint if exists fk_child_person_parent_identifier; +drop index if exists ix_child_person_parent_identifier; + +alter table cke_client drop constraint if exists fk_cke_client_user; +drop index if exists ix_cke_client_user; + +alter table class_super_monkey drop constraint if exists fk_class_super_monkey_class_super; + +alter table class_super_monkey drop constraint if exists fk_class_super_monkey_monkey; + +alter table configuration drop constraint if exists fk_configuration_configurations_id; +drop index if exists ix_configuration_configurations_id; + +alter table contact drop constraint if exists fk_contact_customer_id; +drop index if exists ix_contact_customer_id; + +alter table contact drop constraint if exists fk_contact_group_id; +drop index if exists ix_contact_group_id; + +alter table contact_note drop constraint if exists fk_contact_note_contact_id; +drop index if exists ix_contact_note_contact_id; + +alter table contract_costs drop constraint if exists fk_contract_costs_position_id; +drop index if exists ix_contract_costs_position_id; + +alter table c_conversation drop constraint if exists fk_c_conversation_group_id; +drop index if exists ix_c_conversation_group_id; + +alter table o_customer drop constraint if exists fk_o_customer_billing_address_id; +drop index if exists ix_o_customer_billing_address_id; + +alter table o_customer drop constraint if exists fk_o_customer_shipping_address_id; +drop index if exists ix_o_customer_shipping_address_id; + +alter table dcredit_drol drop constraint if exists fk_dcredit_drol_dcredit; +drop index if exists ix_dcredit_drol_dcredit; + +alter table dcredit_drol drop constraint if exists fk_dcredit_drol_drol; +drop index if exists ix_dcredit_drol_drol; + +alter table dmachine drop constraint if exists fk_dmachine_organisation_id; +drop index if exists ix_dmachine_organisation_id; + +alter table d_machine_aux_use drop constraint if exists fk_d_machine_aux_use_machine_id; +drop index if exists ix_d_machine_aux_use_machine_id; + +alter table d_machine_stats drop constraint if exists fk_d_machine_stats_machine_id; +drop index if exists ix_d_machine_stats_machine_id; + +alter table d_machine_use drop constraint if exists fk_d_machine_use_machine_id; +drop index if exists ix_d_machine_use_machine_id; + +alter table drot_drol drop constraint if exists fk_drot_drol_drot; +drop index if exists ix_drot_drol_drot; + +alter table drot_drol drop constraint if exists fk_drot_drol_drol; +drop index if exists ix_drot_drol_drol; + +alter table dc_detail drop constraint if exists fk_dc_detail_master_id; +drop index if exists ix_dc_detail_master_id; + +alter table defaults_model drop constraint if exists fk_defaults_model_id; + +alter table dfk_cascade drop constraint if exists fk_dfk_cascade_one_id; +drop index if exists ix_dfk_cascade_one_id; + +alter table dfk_set_null drop constraint if exists fk_dfk_set_null_one_id; +drop index if exists ix_dfk_set_null_one_id; + +alter table doc drop constraint if exists fk_doc_id; + +alter table doc_link drop constraint if exists fk_doc_link_doc; +drop index if exists ix_doc_link_doc; + +alter table doc_link drop constraint if exists fk_doc_link_link; +drop index if exists ix_doc_link_link; + +alter table document drop constraint if exists fk_document_id; + +alter table document drop constraint if exists fk_document_organisation_id; +drop index if exists ix_document_organisation_id; + +alter table document_draft drop constraint if exists fk_document_draft_organisation_id; +drop index if exists ix_document_draft_organisation_id; + +alter table document_media drop constraint if exists fk_document_media_document_id; +drop index if exists ix_document_media_document_id; + +alter table document_media_draft drop constraint if exists fk_document_media_draft_document_id; +drop index if exists ix_document_media_draft_document_id; + +alter table e_basicenc_relate drop constraint if exists fk_e_basicenc_relate_other_id; +drop index if exists ix_e_basicenc_relate_other_id; + +alter table ebasic_json_map_detail drop constraint if exists fk_ebasic_json_map_detail_owner_id; +drop index if exists ix_ebasic_json_map_detail_owner_id; + +alter table ebasic_no_sdchild drop constraint if exists fk_ebasic_no_sdchild_owner_id; +drop index if exists ix_ebasic_no_sdchild_owner_id; + +alter table ebasic_sdchild drop constraint if exists fk_ebasic_sdchild_owner_id; +drop index if exists ix_ebasic_sdchild_owner_id; + +alter table ecache_child drop constraint if exists fk_ecache_child_root_id; +drop index if exists ix_ecache_child_root_id; + +alter table edefault_prop drop constraint if exists fk_edefault_prop_e_simple_usertypeid; + +alter table eemb_inner drop constraint if exists fk_eemb_inner_outer_id; +drop index if exists ix_eemb_inner_outer_id; + +alter table einvoice drop constraint if exists fk_einvoice_person_id; +drop index if exists ix_einvoice_person_id; + +alter table enull_collection_detail drop constraint if exists fk_enull_collection_detail_enull_collection_id; +drop index if exists ix_enull_collection_detail_enull_collection_id; + +alter table eopt_one_a drop constraint if exists fk_eopt_one_a_b_id; +drop index if exists ix_eopt_one_a_b_id; + +alter table eopt_one_b drop constraint if exists fk_eopt_one_b_c_id; +drop index if exists ix_eopt_one_b_c_id; + +alter table eper_addr drop constraint if exists fk_eper_addr_ma_country_code; +drop index if exists ix_eper_addr_ma_country_code; + +alter table esoft_del_book drop constraint if exists fk_esoft_del_book_lend_by_id; +drop index if exists ix_esoft_del_book_lend_by_id; + +alter table esoft_del_book_esoft_del_user drop constraint if exists fk_esoft_del_book_esoft_del_user_esoft_del_book; +drop index if exists ix_esoft_del_book_esoft_del_user_esoft_del_book; + +alter table esoft_del_book_esoft_del_user drop constraint if exists fk_esoft_del_book_esoft_del_user_esoft_del_user; +drop index if exists ix_esoft_del_book_esoft_del_user_esoft_del_user; + +alter table esoft_del_down drop constraint if exists fk_esoft_del_down_esoft_del_mid_id; +drop index if exists ix_esoft_del_down_esoft_del_mid_id; + +alter table esoft_del_mid drop constraint if exists fk_esoft_del_mid_top_id; +drop index if exists ix_esoft_del_mid_top_id; + +alter table esoft_del_mid drop constraint if exists fk_esoft_del_mid_up_id; +drop index if exists ix_esoft_del_mid_up_id; + +alter table esoft_del_one_a drop constraint if exists fk_esoft_del_one_a_oneb_id; + +alter table esoft_del_role_esoft_del_user drop constraint if exists fk_esoft_del_role_esoft_del_user_esoft_del_role; +drop index if exists ix_esoft_del_role_esoft_del_user_esoft_del_role; + +alter table esoft_del_role_esoft_del_user drop constraint if exists fk_esoft_del_role_esoft_del_user_esoft_del_user; +drop index if exists ix_esoft_del_role_esoft_del_user_esoft_del_user; + +alter table esoft_del_user_esoft_del_role drop constraint if exists fk_esoft_del_user_esoft_del_role_esoft_del_user; +drop index if exists ix_esoft_del_user_esoft_del_role_esoft_del_user; + +alter table esoft_del_user_esoft_del_role drop constraint if exists fk_esoft_del_user_esoft_del_role_esoft_del_role; +drop index if exists ix_esoft_del_user_esoft_del_role_esoft_del_role; + +alter table rawinherit_uncle drop constraint if exists fk_rawinherit_uncle_parent_id; +drop index if exists ix_rawinherit_uncle_parent_id; + +alter table evanilla_collection_detail drop constraint if exists fk_evanilla_collection_detail_evanilla_collection_id; +drop index if exists ix_evanilla_collection_detail_evanilla_collection_id; + +alter table ec_enum_person_tags drop constraint if exists fk_ec_enum_person_tags_ec_enum_person_id; +drop index if exists ix_ec_enum_person_tags_ec_enum_person_id; + +alter table ec_person_phone drop constraint if exists fk_ec_person_phone_owner_id; +drop index if exists ix_ec_person_phone_owner_id; + +alter table ec_top drop constraint if exists fk_ec_top_person_id; +drop index if exists ix_ec_top_person_id; + +alter table ec_top_ecs_person drop constraint if exists fk_ec_top_ecs_person_ec_top; +drop index if exists ix_ec_top_ecs_person_ec_top; + +alter table ec_top_ecs_person drop constraint if exists fk_ec_top_ecs_person_ecs_person; +drop index if exists ix_ec_top_ecs_person_ecs_person; + +alter table ecbl_person_phone_numbers drop constraint if exists fk_ecbl_person_phone_numbers_person_id; +drop index if exists ix_ecbl_person_phone_numbers_person_id; + +alter table ecbm_person_phone_numbers drop constraint if exists fk_ecbm_person_phone_numbers_person_id; +drop index if exists ix_ecbm_person_phone_numbers_person_id; + +alter table ecm_person_phone_numbers drop constraint if exists fk_ecm_person_phone_numbers_ecm_person_id; +drop index if exists ix_ecm_person_phone_numbers_ecm_person_id; + +alter table ecmc_person_phone_numbers drop constraint if exists fk_ecmc_person_phone_numbers_ecmc_person_id; +drop index if exists ix_ecmc_person_phone_numbers_ecmc_person_id; + +alter table ecs_person_phone drop constraint if exists fk_ecs_person_phone_ecs_person_id; +drop index if exists ix_ecs_person_phone_ecs_person_id; + +alter table ecsm_child drop constraint if exists fk_ecsm_child_ecsm_parent_id; +drop index if exists ix_ecsm_child_ecsm_parent_id; + +alter table td_child drop constraint if exists fk_td_child_parent_id; +drop index if exists ix_td_child_parent_id; + +alter table element_bean drop constraint if exists fk_element_bean_complex_bean_id; +drop index if exists ix_element_bean_complex_bean_id; + +alter table empl drop constraint if exists fk_empl_default_address_id; +drop index if exists ix_empl_default_address_id; + +alter table esd_detail drop constraint if exists fk_esd_detail_master_id; +drop index if exists ix_esd_detail_master_id; + +alter table grand_parent_person drop constraint if exists fk_grand_parent_person_some_bean_id; +drop index if exists ix_grand_parent_person_some_bean_id; + +alter table survey_group drop constraint if exists fk_survey_group_categoryobjectid; +drop index if exists ix_survey_group_categoryobjectid; + +alter table hx_link_doc drop constraint if exists fk_hx_link_doc_hx_link; +drop index if exists ix_hx_link_doc_hx_link; + +alter table hx_link_doc drop constraint if exists fk_hx_link_doc_he_doc; +drop index if exists ix_hx_link_doc_he_doc; + +alter table hi_link_doc drop constraint if exists fk_hi_link_doc_hi_link; +drop index if exists ix_hi_link_doc_hi_link; + +alter table hi_link_doc drop constraint if exists fk_hi_link_doc_hi_doc; +drop index if exists ix_hi_link_doc_hi_doc; + +alter table hi_tthree drop constraint if exists fk_hi_tthree_hi_ttwo_id; +drop index if exists ix_hi_tthree_hi_ttwo_id; + +alter table hi_ttwo drop constraint if exists fk_hi_ttwo_hi_tone_id; +drop index if exists ix_hi_ttwo_hi_tone_id; + +alter table hsd_setting drop constraint if exists fk_hsd_setting_user_id; + +alter table iaf_segment drop constraint if exists fk_iaf_segment_status_id; +drop index if exists ix_iaf_segment_status_id; + +alter table imrelated drop constraint if exists fk_imrelated_owner_id; +drop index if exists ix_imrelated_owner_id; + +alter table info_contact drop constraint if exists fk_info_contact_company_id; +drop index if exists ix_info_contact_company_id; + +alter table info_customer drop constraint if exists fk_info_customer_company_id; + +alter table inner_report drop constraint if exists fk_inner_report_forecast_id; + +alter table drel_invoice drop constraint if exists fk_drel_invoice_booking; +drop index if exists ix_drel_invoice_booking; + +alter table item drop constraint if exists fk_item_etype; +drop index if exists ix_item_etype; + +alter table item drop constraint if exists fk_item_eregion; +drop index if exists ix_item_eregion; + +alter table mkeygroup_monkey drop constraint if exists fk_mkeygroup_monkey_mkeygroup; + +alter table mkeygroup_monkey drop constraint if exists fk_mkeygroup_monkey_monkey; + +alter table trainer_monkey drop constraint if exists fk_trainer_monkey_trainer; + +alter table trainer_monkey drop constraint if exists fk_trainer_monkey_monkey; + +alter table troop_monkey drop constraint if exists fk_troop_monkey_troop; + +alter table troop_monkey drop constraint if exists fk_troop_monkey_monkey; + +alter table l2_cldf_reset_bean_child drop constraint if exists fk_l2_cldf_reset_bean_child_parent_id; +drop index if exists ix_l2_cldf_reset_bean_child_parent_id; + +alter table level1_level4 drop constraint if exists fk_level1_level4_level1; +drop index if exists ix_level1_level4_level1; + +alter table level1_level4 drop constraint if exists fk_level1_level4_level4; +drop index if exists ix_level1_level4_level4; + +alter table level1_level2 drop constraint if exists fk_level1_level2_level1; +drop index if exists ix_level1_level2_level1; + +alter table level1_level2 drop constraint if exists fk_level1_level2_level2; +drop index if exists ix_level1_level2_level2; + +alter table level2_level3 drop constraint if exists fk_level2_level3_level2; +drop index if exists ix_level2_level3_level2; + +alter table level2_level3 drop constraint if exists fk_level2_level3_level3; +drop index if exists ix_level2_level3_level3; + +alter table link drop constraint if exists fk_link_id; + +alter table la_attr_value_attribute drop constraint if exists fk_la_attr_value_attribute_la_attr_value; +drop index if exists ix_la_attr_value_attribute_la_attr_value; + +alter table la_attr_value_attribute drop constraint if exists fk_la_attr_value_attribute_attribute; +drop index if exists ix_la_attr_value_attribute_attribute; + +alter table looney drop constraint if exists fk_looney_tune_id; +drop index if exists ix_looney_tune_id; + +alter table mcontact drop constraint if exists fk_mcontact_customer_id; +drop index if exists ix_mcontact_customer_id; + +alter table mcontact_message drop constraint if exists fk_mcontact_message_contact_id; +drop index if exists ix_mcontact_message_contact_id; + +alter table mcustomer drop constraint if exists fk_mcustomer_shipping_address_id; +drop index if exists ix_mcustomer_shipping_address_id; + +alter table mcustomer drop constraint if exists fk_mcustomer_billing_address_id; +drop index if exists ix_mcustomer_billing_address_id; + +alter table mmachine_mgroup drop constraint if exists fk_mmachine_mgroup_mmachine; +drop index if exists ix_mmachine_mgroup_mmachine; + +alter table mmachine_mgroup drop constraint if exists fk_mmachine_mgroup_mgroup; +drop index if exists ix_mmachine_mgroup_mgroup; + +alter table mprinter drop constraint if exists fk_mprinter_current_state_id; +drop index if exists ix_mprinter_current_state_id; + +alter table mprinter drop constraint if exists fk_mprinter_last_swap_cyan_id; + +alter table mprinter drop constraint if exists fk_mprinter_last_swap_magenta_id; + +alter table mprinter drop constraint if exists fk_mprinter_last_swap_yellow_id; + +alter table mprinter drop constraint if exists fk_mprinter_last_swap_black_id; + +alter table mprinter_state drop constraint if exists fk_mprinter_state_printer_id; +drop index if exists ix_mprinter_state_printer_id; + +alter table mprofile drop constraint if exists fk_mprofile_picture_id; +drop index if exists ix_mprofile_picture_id; + +alter table mrole_muser drop constraint if exists fk_mrole_muser_mrole; +drop index if exists ix_mrole_muser_mrole; + +alter table mrole_muser drop constraint if exists fk_mrole_muser_muser; +drop index if exists ix_mrole_muser_muser; + +alter table muser drop constraint if exists fk_muser_user_type_id; +drop index if exists ix_muser_user_type_id; + +alter table mail_user_inbox drop constraint if exists fk_mail_user_inbox_mail_user; +drop index if exists ix_mail_user_inbox_mail_user; + +alter table mail_user_inbox drop constraint if exists fk_mail_user_inbox_mail_box; +drop index if exists ix_mail_user_inbox_mail_box; + +alter table mail_user_outbox drop constraint if exists fk_mail_user_outbox_mail_user; +drop index if exists ix_mail_user_outbox_mail_user; + +alter table mail_user_outbox drop constraint if exists fk_mail_user_outbox_mail_box; +drop index if exists ix_mail_user_outbox_mail_box; + +alter table c_message drop constraint if exists fk_c_message_conversation_id; +drop index if exists ix_c_message_conversation_id; + +alter table c_message drop constraint if exists fk_c_message_user_id; +drop index if exists ix_c_message_user_id; + +alter table meter_contract_data drop constraint if exists fk_meter_contract_data_special_needs_client_id; + +alter table meter_special_needs_client drop constraint if exists fk_meter_special_needs_client_primary_id; + +alter table meter_version drop constraint if exists fk_meter_version_address_data_id; + +alter table meter_version drop constraint if exists fk_meter_version_contract_data_id; + +alter table mnoc_user_mnoc_role drop constraint if exists fk_mnoc_user_mnoc_role_mnoc_user; +drop index if exists ix_mnoc_user_mnoc_role_mnoc_user; + +alter table mnoc_user_mnoc_role drop constraint if exists fk_mnoc_user_mnoc_role_mnoc_role; +drop index if exists ix_mnoc_user_mnoc_role_mnoc_role; + +alter table mny_b drop constraint if exists fk_mny_b_a_id; +drop index if exists ix_mny_b_a_id; + +alter table mny_b_mny_c drop constraint if exists fk_mny_b_mny_c_mny_b; +drop index if exists ix_mny_b_mny_c_mny_b; + +alter table mny_b_mny_c drop constraint if exists fk_mny_b_mny_c_mny_c; +drop index if exists ix_mny_b_mny_c_mny_c; + +alter table subtopics drop constraint if exists fk_subtopics_mny_topic_1; +drop index if exists ix_subtopics_mny_topic_1; + +alter table subtopics drop constraint if exists fk_subtopics_mny_topic_2; +drop index if exists ix_subtopics_mny_topic_2; + +alter table mp_role drop constraint if exists fk_mp_role_mp_user_id; +drop index if exists ix_mp_role_mp_user_id; + +alter table ms_many_a_many_b drop constraint if exists fk_ms_many_a_many_b_ms_many_a; +drop index if exists ix_ms_many_a_many_b_ms_many_a; + +alter table ms_many_a_many_b drop constraint if exists fk_ms_many_a_many_b_ms_many_b; +drop index if exists ix_ms_many_a_many_b_ms_many_b; + +alter table ms_many_b_many_a drop constraint if exists fk_ms_many_b_many_a_ms_many_b; +drop index if exists ix_ms_many_b_many_a_ms_many_b; + +alter table ms_many_b_many_a drop constraint if exists fk_ms_many_b_many_a_ms_many_a; +drop index if exists ix_ms_many_b_many_a_ms_many_a; + +alter table my_lob_size_join_many drop constraint if exists fk_my_lob_size_join_many_parent_id; +drop index if exists ix_my_lob_size_join_many_parent_id; + +alter table o_bean_child drop constraint if exists fk_o_bean_child_cached_bean_id; +drop index if exists ix_o_bean_child_cached_bean_id; + +alter table ocached_app_detail drop constraint if exists fk_ocached_app_detail_app_id; +drop index if exists ix_ocached_app_detail_app_id; + +alter table o_cached_bean_country drop constraint if exists fk_o_cached_bean_country_o_cached_bean; +drop index if exists ix_o_cached_bean_country_o_cached_bean; + +alter table o_cached_bean_country drop constraint if exists fk_o_cached_bean_country_o_country; +drop index if exists ix_o_cached_bean_country_o_country; + +alter table o_cached_bean_child drop constraint if exists fk_o_cached_bean_child_cached_bean_id; +drop index if exists ix_o_cached_bean_child_cached_bean_id; + +alter table oengine drop constraint if exists fk_oengine_car_id; + +alter table ogear_box drop constraint if exists fk_ogear_box_car_id; + +alter table omvertex_other drop constraint if exists fk_omvertex_other_omvertex_id; +drop index if exists ix_omvertex_other_omvertex_id; + +alter table oroad_show_msg drop constraint if exists fk_oroad_show_msg_company_id; + +alter table om_account_child_dbo drop constraint if exists fk_om_account_child_dbo_banana_rama_id; +drop index if exists ix_om_account_child_dbo_banana_rama_id; + +alter table om_basic_child drop constraint if exists fk_om_basic_child_parent_id; +drop index if exists ix_om_basic_child_parent_id; + +alter table om_ordered_detail drop constraint if exists fk_om_ordered_detail_master_id; +drop index if exists ix_om_ordered_detail_master_id; + +alter table oml_baz drop constraint if exists fk_oml_baz_foo_id; +drop index if exists ix_oml_baz_foo_id; + +alter table oml_foo drop constraint if exists fk_oml_foo_bar_id; +drop index if exists ix_oml_foo_bar_id; + +alter table o_order drop constraint if exists fk_o_order_kcustomer_id; +drop index if exists ix_o_order_kcustomer_id; + +alter table o_order_detail drop constraint if exists fk_o_order_detail_order_id; +drop index if exists ix_o_order_detail_order_id; + +alter table o_order_detail drop constraint if exists fk_o_order_detail_product_id; +drop index if exists ix_o_order_detail_product_id; + +alter table s_order_items drop constraint if exists fk_s_order_items_order_uuid; +drop index if exists ix_s_order_items_order_uuid; + +alter table order_referenced_parent drop constraint if exists fk_order_referenced_parent_master_id; +drop index if exists ix_order_referenced_parent_master_id; + +alter table or_order_ship drop constraint if exists fk_or_order_ship_order_id; +drop index if exists ix_or_order_ship_order_id; + +alter table order_toy drop constraint if exists fk_order_toy_child_id; +drop index if exists ix_order_toy_child_id; + +alter table ordered_parent drop constraint if exists fk_ordered_parent_order_master_inheritance_id; +drop index if exists ix_ordered_parent_order_master_inheritance_id; + +alter table organization_node drop constraint if exists fk_organization_node_parent_tree_node_id; + +alter table orp_detail drop constraint if exists fk_orp_detail_master_id; +drop index if exists ix_orp_detail_master_id; + +alter table orp_detail2 drop constraint if exists fk_orp_detail2_orp_master2_id; +drop index if exists ix_orp_detail2_orp_master2_id; + +alter table oto_atwo drop constraint if exists fk_oto_atwo_aone_id; + +alter table oto_bchild drop constraint if exists fk_oto_bchild_master_id; + +alter table oto_child drop constraint if exists fk_oto_child_master_id; + +alter table oto_cust_address drop constraint if exists fk_oto_cust_address_customer_cid; + +alter table oto_level_a drop constraint if exists fk_oto_level_a_b_id; + +alter table oto_level_b drop constraint if exists fk_oto_level_b_c_id; + +alter table oto_prime_extra drop constraint if exists fk_oto_prime_extra_eid; + +alter table oto_sd_child drop constraint if exists fk_oto_sd_child_master_id; + +alter table oto_th_many drop constraint if exists fk_oto_th_many_oto_th_top_id; +drop index if exists ix_oto_th_many_oto_th_top_id; + +alter table oto_th_one drop constraint if exists fk_oto_th_one_many_id; + +alter table oto_ubprime_extra drop constraint if exists fk_oto_ubprime_extra_eid; + +alter table oto_user_model drop constraint if exists fk_oto_user_model_user_optional_id; + +alter table pfile drop constraint if exists fk_pfile_file_content_id; + +alter table pfile drop constraint if exists fk_pfile_file_content2_id; + +alter table paggview drop constraint if exists fk_paggview_pview_id; + +alter table pallet_location drop constraint if exists fk_pallet_location_zone_sid; +drop index if exists ix_pallet_location_zone_sid; + +alter table parcel_location drop constraint if exists fk_parcel_location_parcelid; + +alter table rawinherit_parent_rawinherit_data drop constraint if exists fk_rawinherit_parent_rawinherit_data_rawinherit_parent; +drop index if exists ix_rawinherit_parent_rawinherit_data_rawinherit_parent; + +alter table rawinherit_parent_rawinherit_data drop constraint if exists fk_rawinherit_parent_rawinherit_data_rawinherit_data; +drop index if exists ix_rawinherit_parent_rawinherit_data_rawinherit_data; + +alter table parent_person drop constraint if exists fk_parent_person_some_bean_id; +drop index if exists ix_parent_person_some_bean_id; + +alter table parent_person drop constraint if exists fk_parent_person_parent_identifier; +drop index if exists ix_parent_person_parent_identifier; + +alter table c_participation drop constraint if exists fk_c_participation_conversation_id; +drop index if exists ix_c_participation_conversation_id; + +alter table c_participation drop constraint if exists fk_c_participation_user_id; +drop index if exists ix_c_participation_user_id; + +alter table pcf_calendar drop constraint if exists fk_pcf_calendar_pcf_person_id; +drop index if exists ix_pcf_calendar_pcf_person_id; + +alter table pcf_city drop constraint if exists fk_pcf_city_pcf_country_id; +drop index if exists ix_pcf_city_pcf_country_id; + +alter table pcf_city drop constraint if exists fk_pcf_city_mayor_id; + +alter table pcf_city drop constraint if exists fk_pcf_city_vice_mayor_id; + +alter table pcf_event drop constraint if exists fk_pcf_event_pcf_calendar_id; +drop index if exists ix_pcf_event_pcf_calendar_id; + +alter table persistent_file_content drop constraint if exists fk_persistent_file_content_persistent_file_id; + +alter table person drop constraint if exists fk_person_default_address_oid; +drop index if exists ix_person_default_address_oid; + +alter table person_cache_email drop constraint if exists fk_person_cache_email_person_info_person_id; +drop index if exists ix_person_cache_email_person_info_person_id; + +alter table phones drop constraint if exists fk_phones_person_id; +drop index if exists ix_phones_person_id; + +alter table e_position drop constraint if exists fk_e_position_contract_id; +drop index if exists ix_e_position_contract_id; + +alter table pp_to_ww drop constraint if exists fk_pp_to_ww_pp; +drop index if exists ix_pp_to_ww_pp; + +alter table pp_to_ww drop constraint if exists fk_pp_to_ww_wview; +drop index if exists ix_pp_to_ww_wview; + +alter table question drop constraint if exists fk_question_groupobjectid; +drop index if exists ix_question_groupobjectid; + +alter table r_orders drop constraint if exists fk_r_orders_customer; +drop index if exists ix_r_orders_customer; + +alter table referenced_defaults_model drop constraint if exists fk_referenced_defaults_model_id; + +alter table referenced_defaults_model drop constraint if exists fk_referenced_defaults_model_defaults_model_id; +drop index if exists ix_referenced_defaults_model_defaults_model_id; + +alter table referenced_defaults_model_draft drop constraint if exists fk_referenced_defaults_model_draft_defaults_model_id; +drop index if exists ix_referenced_defaults_model_draft_defaults_model_id; + +alter table rel_master drop constraint if exists fk_rel_master_detail_id; +drop index if exists ix_rel_master_detail_id; + +alter table resourcefile drop constraint if exists fk_resourcefile_parentresourcefileid; +drop index if exists ix_resourcefile_parentresourcefileid; + +alter table mt_role drop constraint if exists fk_mt_role_tenant_id; +drop index if exists ix_mt_role_tenant_id; + +alter table mt_role_permission drop constraint if exists fk_mt_role_permission_mt_role; +drop index if exists ix_mt_role_permission_mt_role; + +alter table mt_role_permission drop constraint if exists fk_mt_role_permission_mt_permission; +drop index if exists ix_mt_role_permission_mt_permission; + +alter table root_bean drop constraint if exists fk_root_bean_referencing_bean_id; +drop index if exists ix_root_bean_referencing_bean_id; + +alter table f_second drop constraint if exists fk_f_second_first; + +alter table section drop constraint if exists fk_section_article_id; +drop index if exists ix_section_article_id; + +alter table self_parent drop constraint if exists fk_self_parent_parent_id; +drop index if exists ix_self_parent_parent_id; + +alter table self_ref_customer drop constraint if exists fk_self_ref_customer_referred_by_id; +drop index if exists ix_self_ref_customer_referred_by_id; + +alter table self_ref_example drop constraint if exists fk_self_ref_example_parent_id; +drop index if exists ix_self_ref_example_parent_id; + +alter table e_save_test_b drop constraint if exists fk_e_save_test_b_sibling_a_id; + +alter table site drop constraint if exists fk_site_parent_id; +drop index if exists ix_site_parent_id; + +alter table site drop constraint if exists fk_site_data_container_id; + +alter table site drop constraint if exists fk_site_site_address_id; + +alter table source_base drop constraint if exists fk_source_base_target_id; +drop index if exists ix_source_base_target_id; + +alter table stockforecast drop constraint if exists fk_stockforecast_inner_report_id; +drop index if exists ix_stockforecast_inner_report_id; + +alter table sub_section drop constraint if exists fk_sub_section_section_id; +drop index if exists ix_sub_section_section_id; + +alter table tevent_many drop constraint if exists fk_tevent_many_event_id; +drop index if exists ix_tevent_many_event_id; + +alter table tevent_one drop constraint if exists fk_tevent_one_event_id; + +alter table t_detail_with_other_namexxxyy drop constraint if exists fk_t_detail_with_other_namexxxyy_master_id; +drop index if exists ix_t_detail_with_other_namexxxyy_master_id; + +alter table ttruck_holder drop constraint if exists fk_ttruck_holder_truck_plate_no; +drop index if exists ix_ttruck_holder_truck_plate_no; + +alter table ttruck_holder drop constraint if exists fk_ttruck_holder_basic_id; +drop index if exists ix_ttruck_holder_basic_id; + +alter table ttruck_holder_item drop constraint if exists fk_ttruck_holder_item_owner_id; +drop index if exists ix_ttruck_holder_item_owner_id; + +alter table twheel drop constraint if exists fk_twheel_owner_plate_no; +drop index if exists ix_twheel_owner_plate_no; + +alter table tire drop constraint if exists fk_tire_wheel; + +alter table tree_entity drop constraint if exists fk_tree_entity_parent_id; +drop index if exists ix_tree_entity_parent_id; + +alter table trip drop constraint if exists fk_trip_vehicle_driver_id; +drop index if exists ix_trip_vehicle_driver_id; + +alter table trip drop constraint if exists fk_trip_address_id; +drop index if exists ix_trip_address_id; + +alter table "type" drop constraint if exists fk_type_sub_type_id; +drop index if exists ix_type_sub_type_id; + +alter table usib_child drop constraint if exists fk_usib_child_parent_id; +drop index if exists ix_usib_child_parent_id; + +alter table usib_child_sibling drop constraint if exists fk_usib_child_sibling_child_id; + +alter table ut_detail drop constraint if exists fk_ut_detail_utmaster_id; +drop index if exists ix_ut_detail_utmaster_id; + +alter table uutwo drop constraint if exists fk_uutwo_master_id; +drop index if exists ix_uutwo_master_id; + +alter table oto_user drop constraint if exists fk_oto_user_account_id; + +alter table c_user drop constraint if exists fk_c_user_group_id; +drop index if exists ix_c_user_group_id; + +alter table em_user_role drop constraint if exists fk_em_user_role_user_id; +drop index if exists ix_em_user_role_user_id; + +alter table em_user_role drop constraint if exists fk_em_user_role_role_id; +drop index if exists ix_em_user_role_role_id; + +alter table vehicle drop constraint if exists fk_vehicle_lease_id; +drop index if exists ix_vehicle_lease_id; + +alter table vehicle drop constraint if exists fk_vehicle_car_ref_id; +drop index if exists ix_vehicle_car_ref_id; + +alter table vehicle drop constraint if exists fk_vehicle_truck_ref_id; +drop index if exists ix_vehicle_truck_ref_id; + +alter table vehicle_driver drop constraint if exists fk_vehicle_driver_vehicle_id; +drop index if exists ix_vehicle_driver_vehicle_id; + +alter table vehicle_driver drop constraint if exists fk_vehicle_driver_address_id; +drop index if exists ix_vehicle_driver_address_id; + +alter table version_child drop constraint if exists fk_version_child_parent_id; +drop index if exists ix_version_child_parent_id; + +alter table version_toy drop constraint if exists fk_version_toy_child_id; +drop index if exists ix_version_toy_child_id; + +alter table warehouses drop constraint if exists fk_warehouses_officezoneid; +drop index if exists ix_warehouses_officezoneid; + +alter table warehousesshippingzones drop constraint if exists fk_warehousesshippingzones_warehouses; +drop index if exists ix_warehousesshippingzones_warehouses; + +alter table warehousesshippingzones drop constraint if exists fk_warehousesshippingzones_zones; +drop index if exists ix_warehousesshippingzones_zones; + +alter table sa_wheel drop constraint if exists fk_sa_wheel_tire; +drop index if exists ix_sa_wheel_tire; + +alter table sa_wheel drop constraint if exists fk_sa_wheel_car; +drop index if exists ix_sa_wheel_car; + +alter table g_who_props_otm drop constraint if exists fk_g_who_props_otm_who_created_id; +drop index if exists ix_g_who_props_otm_who_created_id; + +alter table g_who_props_otm drop constraint if exists fk_g_who_props_otm_who_modified_id; +drop index if exists ix_g_who_props_otm_who_modified_id; + +alter table with_zero drop constraint if exists fk_with_zero_parent_id; +drop index if exists ix_with_zero_parent_id; + +drop table if exists asimple_bean; + +drop table if exists bar; + +drop table if exists block; + +drop table if exists oto_account; + +drop table if exists acl; + +drop table if exists acl_container_relation; + +drop table if exists addr; + +drop table if exists address; + +drop table if exists o_address; + +drop table if exists album; + +drop table if exists animal; + +drop table if exists animal_shelter; + +drop table if exists article; + +drop table if exists attribute; + +drop table if exists attribute_holder; + +drop table if exists audit_log; + +drop table if exists bbookmark; + +drop table if exists bbookmark_org; + +drop table if exists bbookmark_user; + +drop table if exists bsimple_with_gen; + +drop table if exists bsite; + +drop table if exists bsite_user_a; + +drop table if exists bsite_user_b; + +drop table if exists bsite_user_c; + +drop table if exists bsite_user_d; + +drop table if exists bsite_user_e; + +drop table if exists buser; + +drop table if exists bwith_qident; + +drop table if exists basic_draftable_bean; + +drop table if exists basic_draftable_bean_draft; + +drop table if exists basic_joda_entity; + +drop table if exists bean_with_time_zone; + +drop table if exists drel_booking; +drop sequence if exists drel_booking_seq; + +drop table if exists bw_bean; + +drop table if exists cepcategory; + +drop table if exists cepproduct; + +drop table if exists cepproduct_category; + +drop table if exists ciaddress; + +drop table if exists cicustomer_parent; + +drop table if exists cistreet_parent; + +drop table if exists cinh_ref; + +drop table if exists cinh_root; + +drop table if exists ckey_assoc; + +drop table if exists ckey_detail; + +drop table if exists ckey_parent; + +drop table if exists coone; + +drop table if exists coone_many; + +drop table if exists coroot; + +drop table if exists calculation_result; + +drop table if exists cao_bean; + +drop table if exists sp_car_car; +drop sequence if exists sp_car_car_seq; + +drop table if exists sp_car_car_wheels; + +drop table if exists sp_car_car_doors; + +drop table if exists sa_car; +drop sequence if exists sa_car_seq; + +drop table if exists car_accessory; + +drop table if exists car_fuse; + +drop table if exists category; + +drop table if exists e_save_test_d; + +drop table if exists child_person; + +drop table if exists cke_client; + +drop table if exists cke_user; + +drop table if exists class_super; + +drop table if exists class_super_monkey; + +drop table if exists configuration; + +drop table if exists configurations; + +drop table if exists contact; + +drop table if exists contact_group; + +drop table if exists contact_note; + +drop table if exists contract; + +drop table if exists contract_costs; + +drop table if exists c_conversation; + +drop table if exists o_country; + +drop table if exists cover; + +drop table if exists o_customer; + +drop table if exists dcredit; + +drop table if exists dcredit_drol; + +drop table if exists dexh_entity; + +drop table if exists dint_parent; + +drop table if exists dmachine; + +drop table if exists d_machine_aux_use; + +drop table if exists d_machine_stats; + +drop table if exists d_machine_use; + +drop table if exists dorg; + +drop table if exists dperson; + +drop table if exists drol; + +drop table if exists drot; + +drop table if exists drot_drol; + +drop table if exists rawinherit_data; + +drop table if exists data_container; + +drop table if exists dc_detail; + +drop table if exists dc_master; + +drop table if exists defaults_model; + +drop table if exists defaults_model_draft; + +drop table if exists dfk_cascade; + +drop table if exists dfk_cascade_one; + +drop table if exists dfk_none; + +drop table if exists dfk_none_via_join; + +drop table if exists dfk_none_via_mto_m; + +drop table if exists dfk_none_via_mto_m_dfk_one; + +drop table if exists dfk_one; + +drop table if exists dfk_set_null; + +drop table if exists doc; + +drop table if exists doc_link; + +drop table if exists doc_link_draft; + +drop table if exists doc_draft; + +drop table if exists document; + +drop table if exists document_draft; + +drop table if exists document_media; + +drop table if exists document_media_draft; + +drop table if exists sp_car_door; +drop sequence if exists sp_car_door_seq; + +drop table if exists earray_bean; + +drop table if exists earray_set_bean; + +drop table if exists e_basic; + +drop table if exists ebasic_change_log; + +drop table if exists ebasic_clob; + +drop table if exists ebasic_clob_fetch_eager; + +drop table if exists ebasic_clob_no_ver; + +drop table if exists e_basicenc; + +drop table if exists e_basicenc_bin; + +drop table if exists e_basicenc_client; + +drop table if exists e_basicenc_relate; + +drop table if exists e_basic_enum_id; + +drop table if exists e_basic_eni; + +drop table if exists ebasic_hstore; + +drop table if exists ebasic_json_jackson; + +drop table if exists ebasic_json_jackson2; + +drop table if exists ebasic_json_jackson3; + +drop table if exists ebasic_json_list; + +drop table if exists ebasic_json_map; + +drop table if exists ebasic_json_map_blob; + +drop table if exists ebasic_json_map_clob; + +drop table if exists ebasic_json_map_detail; + +drop table if exists ebasic_json_map_json_b; + +drop table if exists ebasic_json_map_varchar; + +drop table if exists ebasic_json_node; + +drop table if exists ebasic_json_node_blob; + +drop table if exists ebasic_json_node_json_b; + +drop table if exists ebasic_json_node_varchar; + +drop table if exists ebasic_json_unmapped; + +drop table if exists e_basic_ndc; + +drop table if exists ebasic_no_sdchild; + +drop table if exists ebasic_sdchild; + +drop table if exists ebasic_soft_delete; + +drop table if exists e_basicver; + +drop table if exists e_basic_withlife; + +drop table if exists e_basic_with_ex; + +drop table if exists e_basicverucon; + +drop table if exists ecache_child; + +drop table if exists ecache_root; + +drop table if exists e_col_ab; + +drop table if exists ecustom_id; + +drop table if exists edefault_prop; + +drop table if exists eemb_inner; + +drop table if exists eemb_outer; + +drop table if exists efile2_no_fk; + +drop table if exists efile_no_fk; + +drop table if exists efile_no_fk_euser_no_fk; + +drop table if exists efile_no_fk_euser_no_fk_soft_del; + +drop table if exists egen_props; + +drop table if exists eid_uid_bean; + +drop table if exists einvoice; + +drop table if exists e_main; + +drop table if exists enull_collection; + +drop table if exists enull_collection_detail; + +drop table if exists eopt_one_a; + +drop table if exists eopt_one_b; + +drop table if exists eopt_one_c; + +drop table if exists eper_addr; + +drop table if exists eperson; + +drop table if exists eperson2; + +drop table if exists eperson3; + +drop table if exists e_person_online; + +drop table if exists esimple; + +drop table if exists esoft_del_book; + +drop table if exists esoft_del_book_esoft_del_user; + +drop table if exists esoft_del_down; + +drop table if exists esoft_del_mid; + +drop table if exists esoft_del_one_a; + +drop table if exists esoft_del_one_b; + +drop table if exists esoft_del_role; + +drop table if exists esoft_del_role_esoft_del_user; + +drop table if exists esoft_del_top; + +drop table if exists esoft_del_up; + +drop table if exists esoft_del_user; + +drop table if exists esoft_del_user_esoft_del_role; + +drop table if exists esome_convert_type; + +drop table if exists esome_type; + +drop table if exists etrans_many; + +drop table if exists rawinherit_uncle; + +drop table if exists euser_no_fk; + +drop table if exists euser_no_fk_soft_del; + +drop table if exists evanilla_collection; + +drop table if exists evanilla_collection_detail; + +drop table if exists ewho_props; + +drop table if exists e_withinet; + +drop table if exists ec_enum_person; + +drop table if exists ec_enum_person_tags; + +drop table if exists ec_person; + +drop table if exists ec_person_phone; + +drop table if exists ec_top; + +drop table if exists ec_top_ecs_person; + +drop table if exists ecbl_person; + +drop table if exists ecbl_person_phone_numbers; + +drop table if exists ecbm_person; + +drop table if exists ecbm_person_phone_numbers; + +drop table if exists ecm_person; + +drop table if exists ecm_person_phone_numbers; + +drop table if exists ecmc_person; + +drop table if exists ecmc_person_phone_numbers; + +drop table if exists ecs_person; + +drop table if exists ecs_person_phone; + +drop table if exists ecsm_child; + +drop table if exists ecsm_values; + +drop table if exists ecsm_one; + +drop table if exists ecsm_parent; + +drop table if exists ecsm_two; + +drop table if exists td_child; + +drop table if exists td_parent; + +drop table if exists element_bean; + +drop table if exists empl; + +drop table if exists esd_detail; + +drop table if exists esd_master; + +drop table if exists feature_desc; + +drop table if exists f_first; + +drop table if exists foo; + +drop table if exists gen_key_identity; + +drop table if exists gen_key_sequence; +drop sequence if exists SEQ_NAME; + +drop table if exists grand_parent_person; + +drop table if exists survey_group; + +drop table if exists c_group; + +drop trigger hembi_bean_history_upd; +drop view hembi_bean_with_history; +alter table hembi_bean drop column sys_period_start; +alter table hembi_bean drop column sys_period_end; +drop table hembi_bean_history; + +drop table if exists hembi_bean; + +drop table if exists he_doc; + +drop trigger hx_link_history_upd; +drop view hx_link_with_history; +alter table hx_link drop column sys_period_start; +alter table hx_link drop column sys_period_end; +drop table hx_link_history; + +drop table if exists hx_link; + +drop table if exists hx_link_doc; + +drop table if exists hi_doc; + +drop trigger hi_link_history_upd; +drop view hi_link_with_history; +alter table hi_link drop column sys_period_start; +alter table hi_link drop column sys_period_end; +drop table hi_link_history; + +drop table if exists hi_link; + +drop trigger hi_link_doc_history_upd; +drop view hi_link_doc_with_history; +alter table hi_link_doc drop column sys_period_start; +alter table hi_link_doc drop column sys_period_end; +drop table hi_link_doc_history; + +drop table if exists hi_link_doc; + +drop trigger hi_tone_history_upd; +drop view hi_tone_with_history; +alter table hi_tone drop column sys_period_start; +alter table hi_tone drop column sys_period_end; +drop table hi_tone_history; + +drop table if exists hi_tone; + +drop trigger hi_tthree_history_upd; +drop view hi_tthree_with_history; +alter table hi_tthree drop column sys_period_start; +alter table hi_tthree drop column sys_period_end; +drop table hi_tthree_history; + +drop table if exists hi_tthree; + +drop trigger hi_ttwo_history_upd; +drop view hi_ttwo_with_history; +alter table hi_ttwo drop column sys_period_start; +alter table hi_ttwo drop column sys_period_end; +drop table hi_ttwo_history; + +drop table if exists hi_ttwo; + +drop trigger hsd_setting_history_upd; +drop view hsd_setting_with_history; +alter table hsd_setting drop column sys_period_start; +alter table hsd_setting drop column sys_period_end; +drop table hsd_setting_history; + +drop table if exists hsd_setting; + +drop trigger hsd_user_history_upd; +drop view hsd_user_with_history; +alter table hsd_user drop column sys_period_start; +alter table hsd_user drop column sys_period_end; +drop table hsd_user_history; + +drop table if exists hsd_user; + +drop table if exists iaf_segment; + +drop table if exists iaf_segment_status; + +drop table if exists imrelated; + +drop table if exists imroot; + +drop table if exists ixresource; + +drop table if exists info_company; + +drop table if exists info_contact; + +drop table if exists info_customer; + +drop table if exists inner_report; + +drop table if exists drel_invoice; +drop sequence if exists drel_invoice_seq; + +drop table if exists item; + +drop table if exists monkey; + +drop table if exists mkeygroup; + +drop table if exists mkeygroup_monkey; + +drop table if exists trainer; + +drop table if exists trainer_monkey; + +drop table if exists troop; + +drop table if exists troop_monkey; + +drop table if exists l2_cldf_reset_bean; + +drop table if exists l2_cldf_reset_bean_child; + +drop table if exists level1; + +drop table if exists level1_level4; + +drop table if exists level1_level2; + +drop table if exists level2; + +drop table if exists level2_level3; + +drop table if exists level3; + +drop table if exists level4; + +drop trigger link_history_upd; +drop view link_with_history; +alter table link drop column sys_period_start; +alter table link drop column sys_period_end; +drop table link_history; + +drop table if exists link; + +drop table if exists link_draft; + +drop table if exists la_attr_value; + +drop table if exists la_attr_value_attribute; + +drop table if exists looney; + +drop table if exists maddress; + +drop table if exists mcontact; + +drop table if exists mcontact_message; + +drop table if exists mcustomer; + +drop table if exists mgroup; + +drop table if exists mmachine; + +drop table if exists mmachine_mgroup; + +drop table if exists mmedia; + +drop table if exists non_updateprop; + +drop table if exists mprinter; + +drop table if exists mprinter_state; + +drop table if exists mprofile; + +drop table if exists mprotected_construct_bean; + +drop table if exists mrole; + +drop table if exists mrole_muser; + +drop table if exists msome_other; + +drop table if exists muser; + +drop table if exists muser_type; + +drop table if exists mail_box; + +drop table if exists mail_user; + +drop table if exists mail_user_inbox; + +drop table if exists mail_user_outbox; + +drop table if exists main_entity; + +drop table if exists main_entity_relation; + +drop table if exists map_super_actual; + +drop table if exists c_message; + +drop table if exists meter_address_data; + +drop table if exists meter_contract_data; + +drop table if exists meter_special_needs_client; + +drop table if exists meter_special_needs_contact; + +drop table if exists meter_version; + +drop table if exists mnoc_role; + +drop table if exists mnoc_user; + +drop table if exists mnoc_user_mnoc_role; + +drop table if exists mny_a; + +drop table if exists mny_b; + +drop table if exists mny_b_mny_c; + +drop table if exists mny_c; + +drop table if exists mny_topic; + +drop table if exists subtopics; + +drop table if exists mp_role; + +drop table if exists mp_user; + +drop table if exists ms_many_a; + +drop table if exists ms_many_a_many_b; + +drop table if exists ms_many_b; + +drop table if exists ms_many_b_many_a; + +drop table if exists my_lob_size; + +drop table if exists my_lob_size_join_many; + +drop table if exists noidbean; + +drop table if exists o_bean_child; + +drop table if exists ocached_app; + +drop table if exists ocached_app_detail; + +drop table if exists o_cached_bean; + +drop table if exists o_cached_bean_country; + +drop table if exists o_cached_bean_child; + +drop table if exists o_cached_inherit; + +drop table if exists o_cached_natkey; + +drop table if exists o_cached_natkey3; + +drop table if exists ocached_nkey_uid; + +drop table if exists ocar; + +drop table if exists ocompany; + +drop table if exists oengine; + +drop table if exists ogear_box; + +drop table if exists omvertex; + +drop table if exists omvertex_other; + +drop table if exists oroad_show_msg; + +drop table if exists om_account_child_dbo; + +drop table if exists om_account_dbo; + +drop table if exists om_basic_child; + +drop table if exists om_basic_parent; + +drop table if exists om_ordered_detail; + +drop table if exists om_ordered_master; + +drop table if exists oml_bar; + +drop table if exists oml_baz; + +drop table if exists oml_foo; + +drop table if exists only_id_entity; + +drop table if exists o_order; + +drop table if exists o_order_detail; + +drop table if exists s_orders; + +drop table if exists s_order_items; + +drop table if exists order_master; + +drop table if exists order_master_inheritance; + +drop table if exists order_referenced_parent; + +drop table if exists or_order_ship; + +drop table if exists order_toy; + +drop table if exists ordered_parent; + +drop table if exists organisation; + +drop table if exists organization_node; + +drop table if exists organization_tree_node; + +drop table if exists orp_detail; + +drop table if exists orp_detail2; + +drop table if exists orp_master; + +drop table if exists orp_master2; + +drop table if exists oto_aone; + +drop table if exists oto_atwo; + +drop table if exists oto_bchild; + +drop table if exists oto_bmaster; + +drop table if exists oto_child; + +drop table if exists oto_cust; + +drop table if exists oto_cust_address; + +drop table if exists oto_level_a; + +drop table if exists oto_level_b; + +drop table if exists oto_level_c; + +drop table if exists oto_master; + +drop table if exists oto_prime; + +drop table if exists oto_prime_extra; + +drop table if exists oto_sd_child; + +drop table if exists oto_sd_master; + +drop table if exists oto_th_many; + +drop table if exists oto_th_one; + +drop table if exists oto_th_top; + +drop table if exists oto_ubprime; + +drop table if exists oto_ubprime_extra; + +drop table if exists oto_uprime; + +drop table if exists oto_uprime_extra; + +drop table if exists oto_user_model; + +drop table if exists oto_user_model_optional; + +drop table if exists pfile; + +drop table if exists pfile_content; + +drop table if exists paggview; + +drop table if exists pallet_location; + +drop table if exists parcel; + +drop table if exists parcel_location; + +drop table if exists rawinherit_parent; + +drop table if exists rawinherit_parent_rawinherit_data; + +drop table if exists e_save_test_c; + +drop table if exists parent_person; + +drop table if exists c_participation; + +drop table if exists password_store_model; + +drop table if exists pcf_calendar; + +drop table if exists pcf_city; + +drop table if exists pcf_country; + +drop table if exists pcf_event; + +drop table if exists pcf_person; + +drop table if exists mt_permission; + +drop table if exists persistent_file; + +drop table if exists persistent_file_content; + +drop table if exists person; + +drop table if exists persons; + +drop table if exists person_cache_email; + +drop table if exists person_cache_info; + +drop table if exists phones; + +drop table if exists e_position; + +drop table if exists primary_revision; + +drop table if exists o_product; + +drop table if exists pp; + +drop table if exists pp_to_ww; + +drop table if exists question; + +drop table if exists rcustomer; + +drop table if exists r_orders; + +drop table if exists referenced_defaults_model; + +drop table if exists referenced_defaults_model_draft; + +drop table if exists referencing_bean; + +drop table if exists region; + +drop table if exists rel_detail; + +drop table if exists rel_master; + +drop table if exists resourcefile; + +drop table if exists mt_role; + +drop table if exists mt_role_permission; + +drop table if exists em_role; + +drop table if exists root_bean; + +drop table if exists f_second; + +drop table if exists section; + +drop table if exists self_parent; + +drop table if exists self_ref_customer; + +drop table if exists self_ref_example; + +drop table if exists e_save_test_a; + +drop table if exists e_save_test_b; + +drop table if exists site; + +drop table if exists site_address; + +drop table if exists some_enum_bean; + +drop table if exists some_file_bean; + +drop table if exists some_new_types_bean; + +drop table if exists some_period_bean; + +drop table if exists source_base; + +drop table if exists stockforecast; + +drop table if exists sub_section; + +drop table if exists sub_type; + +drop table if exists survey; + +drop table if exists tbytes_only; + +drop table if exists tcar; + +drop table if exists tevent; + +drop table if exists tevent_many; + +drop table if exists tevent_one; + +drop table if exists tint_root; + +drop table if exists tjoda_entity; + +drop table if exists t_mapsuper1; + +drop table if exists t_oneb; + +drop table if exists t_detail_with_other_namexxxyy; +drop sequence if exists t_atable_detail_seq; + +drop table if exists t_atable_thatisrelatively; +drop sequence if exists t_atable_master_seq; + +drop table if exists ttruck_holder; + +drop table if exists ttruck_holder_item; + +drop table if exists tuuid_entity; + +drop table if exists twheel; + +drop table if exists twith_pre_insert; + +drop table if exists target_base; + +drop table if exists mt_tenant; + +drop table if exists test_annotation_base_entity; + +drop table if exists tire; +drop sequence if exists tire_seq; + +drop table if exists sa_tire; +drop sequence if exists sa_tire_seq; + +drop table if exists tree_entity; + +drop table if exists trip; + +drop table if exists truck_ref; + +drop table if exists tune; + +drop table if exists "type"; + +drop table if exists tz_bean; + +drop table if exists usib_child; + +drop table if exists usib_child_sibling; + +drop table if exists usib_parent; + +drop table if exists ut_detail; + +drop table if exists ut_master; + +drop table if exists uuone; + +drop table if exists uutwo; + +drop table if exists oto_user; + +drop trigger c_user_history_upd; +drop view c_user_with_history; +alter table c_user drop column sys_period_start; +alter table c_user drop column sys_period_end; +drop table c_user_history; + +drop table if exists c_user; + +drop table if exists tx_user; + +drop table if exists g_user; + +drop table if exists em_user; + +drop table if exists user_interest_live; + +drop table if exists em_user_role; + +drop table if exists vehicle; + +drop table if exists vehicle_driver; + +drop table if exists vehicle_lease; + +drop table if exists version_child; + +drop table if exists version_parent; + +drop table if exists version_toy; + +drop table if exists warehouses; + +drop table if exists warehousesshippingzones; + +drop table if exists wheel; +drop sequence if exists wheel_seq; + +drop table if exists sa_wheel; +drop sequence if exists sa_wheel_seq; + +drop table if exists sp_car_wheel; +drop sequence if exists sp_car_wheel_seq; + +drop table if exists g_who_props_otm; + +drop table if exists with_zero; + +drop table if exists parent; + +drop table if exists wview; + +drop table if exists zones; + +drop index if exists ix_contact_last_name_first_name; +drop index if exists ix_e_basic_name; +drop index if exists ix_efile2_no_fk_owner_id; +drop index if exists ix_ecsm_values_host_id; +drop index if exists ix_order_referenced_parent_type; +drop index if exists ix_organization_node_kind; +drop index if exists ano_3; +drop index if exists ano_1; +drop index if exists ano_2; diff --git a/ebean-core/src/test/ddl-review/mariadb-create-all.sql b/ebean-core/src/test/ddl-review/mariadb-create-all.sql new file mode 100644 index 000000000..521bb29c1 --- /dev/null +++ b/ebean-core/src/test/ddl-review/mariadb-create-all.sql @@ -0,0 +1,4909 @@ +-- Generated by ebean unknown at 2020-06-29T03:48:37.908711Z +create table asimple_bean ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_asimple_bean primary key (id) +); + +create table bar ( + bar_type varchar(31) not null, + bar_id integer auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + notes varchar(255), + constraint pk_block primary key (id) +); + +create table oto_account ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_oto_account primary key (id) +); + +create table acl ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_acl primary key (id) +); + +create table acl_container_relation ( + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + street varchar(255), + version integer not null, + constraint pk_address primary key (oid) +); + +create table o_address ( + id integer auto_increment not null, + line_1 varchar(100), + line_2 varchar(100), + city varchar(100), + cretime datetime(6), + country_code varchar(2), + updtime datetime(6) not null, + constraint pk_o_address primary key (id) +); + +create table album ( + id bigint auto_increment not null, + name varchar(255), + cover_id bigint, + deleted tinyint(1) default 0 not null, + created_at datetime(6) not null, + last_update datetime(6) 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 auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_animal_shelter primary key (id) +); + +create table article ( + id integer auto_increment not null, + name varchar(255), + author varchar(255), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_article primary key (id) +); + +create table attribute ( + option_type integer(31) not null, + id integer auto_increment not null, + attribute_holder_id integer, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_attribute primary key (id) +); + +create table attribute_holder ( + id integer auto_increment not null, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_attribute_holder primary key (id) +); + +create table audit_log ( + id bigint auto_increment not null, + description varchar(255), + modified_description varchar(255), + constraint pk_audit_log primary key (id) +); + +create table bbookmark ( + id integer auto_increment not null, + bookmark_reference varchar(255), + user_id integer, + constraint pk_bbookmark primary key (id) +); + +create table bbookmark_org ( + id integer auto_increment not null, + name varchar(255), + constraint pk_bbookmark_org primary key (id) +); + +create table bbookmark_user ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_bsimple_with_gen primary key (id) +); + +create table bsite ( + id varchar(40) not null, + name varchar(255), + constraint pk_bsite primary key (id) +); + +create table bsite_user_a ( + site_id varchar(40) not null, + user_id varchar(40) not null, + access_level integer, + version bigint not null, + constraint pk_bsite_user_a primary key (site_id,user_id) +); + +create table bsite_user_b ( + site varchar(40) not null, + usr varchar(40) not null, + access_level integer, + constraint pk_bsite_user_b primary key (site,usr) +); + +create table bsite_user_c ( + site_uid varchar(40) not null, + user_uid varchar(40) not null, + access_level integer, + constraint pk_bsite_user_c primary key (site_uid,user_uid) +); + +create table bsite_user_d ( + site_id varchar(40) not null, + user_id varchar(40) not null, + access_level integer, + version bigint not null +); + +create table bsite_user_e ( + site_id varchar(40) not null, + user_id varchar(40) not null, + access_level integer +); + +create table buser ( + id varchar(40) not null, + name varchar(255), + constraint pk_buser primary key (id) +); + +create table bwith_qident ( + id integer auto_increment not null, + `Name` varchar(191), + `CODE` varchar(255), + last_updated datetime(6) not null, + constraint uq_bwith_qident_name unique (`Name`), + constraint pk_bwith_qident primary key (id) +); + +create table basic_draftable_bean ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_basic_draftable_bean primary key (id) +); + +create table basic_draftable_bean_draft ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_basic_draftable_bean_draft primary key (id) +); + +create table basic_joda_entity ( + id bigint auto_increment not null, + name varchar(255), + period varchar(50), + local_date date, + created datetime(6) not null, + updated datetime(6) not null, + version datetime(6) not null, + constraint pk_basic_joda_entity primary key (id) +); + +create table bean_with_time_zone ( + id bigint auto_increment not null, + name varchar(255), + timezone varchar(20), + constraint pk_bean_with_time_zone primary key (id) +); + +create table drel_booking ( + id bigint auto_increment 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 table bw_bean ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_cepcategory primary key (id) +); + +create table cepproduct ( + id bigint auto_increment 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 auto_increment not null, + street_id bigint, + constraint pk_ciaddress primary key (id) +); + +create table cicustomer_parent ( + dtype integer(31) not null, + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + num varchar(255), + constraint pk_cistreet_parent primary key (id) +); + +create table cinh_ref ( + id integer auto_increment not null, + ref_id integer, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_cinh_ref primary key (id) +); + +create table cinh_root ( + dtype varchar(3) not null, + id integer auto_increment not null, + license_number varchar(255), + cretime datetime(6) not null, + updtime datetime(6) 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 auto_increment not null, + assoc_one varchar(255), + constraint pk_ckey_assoc primary key (id) +); + +create table ckey_detail ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_coone primary key (id) +); + +create table coone_many ( + id bigint auto_increment not null, + coone_id bigint not null, + name varchar(255), + deleted tinyint(1) default 0 not null, + constraint pk_coone_many primary key (id) +); + +create table coroot ( + id bigint auto_increment not null, + name varchar(255), + one_id bigint, + constraint uq_coroot_one_id unique (one_id), + constraint pk_coroot primary key (id) +); + +create table calculation_result ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + version integer not null, + constraint pk_sp_car_car primary key (id) +); + +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 auto_increment not null, + brand varchar(255), + sold integer not null, + version integer not null, + constraint pk_sa_car primary key (id) +); + +create table car_accessory ( + id integer auto_increment not null, + name varchar(255), + fuse_id bigint not null, + car_id integer, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_car_accessory primary key (id) +); + +create table car_fuse ( + id bigint auto_increment not null, + location_code varchar(255), + constraint pk_car_fuse primary key (id) +); + +create table category ( + id bigint auto_increment 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 auto_increment not null, + parent_id bigint, + test_property tinyint(1) default 0 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 auto_increment 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 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 auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_configurations primary key (id) +); + +create table contact ( + id integer auto_increment not null, + first_name varchar(127), + last_name varchar(127), + phone varchar(255), + mobile varchar(255), + email varchar(255), + is_member tinyint(1) default 0 not null, + customer_id integer not null, + group_id integer, + cretime datetime(6) not null, + updtime datetime(6) not null, + constraint pk_contact primary key (id) +); + +create table contact_group ( + id integer auto_increment not null, + name varchar(255), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_contact_group primary key (id) +); + +create table contact_note ( + id integer auto_increment not null, + contact_id integer, + title varchar(255), + note longtext, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_contact_note primary key (id) +); + +create table contract ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_contract primary key (id) +); + +create table contract_costs ( + id bigint auto_increment not null, + status varchar(255), + position_id bigint not null, + constraint pk_contract_costs primary key (id) +); + +create table c_conversation ( + id bigint auto_increment not null, + title varchar(255), + isopen tinyint(1) default 0 not null, + group_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment not null, + s3_url varchar(255), + deleted tinyint(1) default 0 not null, + constraint pk_cover primary key (id) +); + +create table o_customer ( + id integer auto_increment not null, + status varchar(1) comment 'status of the customer', + name varchar(40) not null, + smallnote varchar(100) comment 'Short notes regarding the customer', + anniversary date comment 'Join date of the customer', + billing_address_id integer, + shipping_address_id integer, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_o_customer primary key (id) +) comment='Holds external customers'; + +create table dcredit ( + id bigint auto_increment 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 auto_increment not null, + exhange varchar(255), + an_enum_type varchar(255), + last_updated datetime(6) not null, + constraint pk_dexh_entity primary key (oid) +); + +create table dint_parent ( + type integer(31) not null, + id bigint auto_increment not null, + val integer, + more varchar(255), + constraint pk_dint_parent primary key (id) +); + +create table dmachine ( + id bigint auto_increment 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 auto_increment 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 auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_dorg primary key (id) +); + +create table dperson ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_drol primary key (id) +); + +create table drot ( + id bigint auto_increment 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 auto_increment not null, + val integer, + constraint pk_rawinherit_data primary key (id) +); + +create table data_container ( + id varchar(40) not null, + content varchar(255), + constraint pk_data_container primary key (id) +); + +create table dc_detail ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_dc_master primary key (id) +); + +create table defaults_model ( + id integer auto_increment not null, + constraint pk_defaults_model primary key (id) +); + +create table defaults_model_draft ( + id integer auto_increment not null, + constraint pk_defaults_model_draft primary key (id) +); + +create table dfk_cascade ( + id bigint auto_increment not null, + name varchar(255), + one_id bigint, + constraint pk_dfk_cascade primary key (id) +); + +create table dfk_cascade_one ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_dfk_cascade_one primary key (id) +); + +create table dfk_none ( + id bigint auto_increment not null, + name varchar(255), + one_id bigint, + constraint pk_dfk_none primary key (id) +); + +create table dfk_none_via_join ( + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_dfk_one primary key (id) +); + +create table dfk_set_null ( + id bigint auto_increment not null, + name varchar(255), + one_id bigint, + constraint pk_dfk_set_null primary key (id) +); + +create table doc ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_doc_draft primary key (id) +); + +create table document ( + id bigint auto_increment not null, + title varchar(127), + body varchar(255), + organisation_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint uq_document_title unique (title), + constraint pk_document primary key (id) +); + +create table document_draft ( + id bigint auto_increment not null, + title varchar(127), + body varchar(255), + when_publish datetime(6), + organisation_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint uq_document_draft_title unique (title), + constraint pk_document_draft primary key (id) +); + +create table document_media ( + id bigint auto_increment not null, + document_id bigint, + name varchar(255), + description varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_document_media primary key (id) +); + +create table document_media_draft ( + id bigint auto_increment not null, + document_id bigint, + name varchar(255), + description varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_document_media_draft primary key (id) +); + +create table sp_car_door ( + id bigint auto_increment not null, + name varchar(255), + version integer not null, + constraint pk_sp_car_door primary key (id) +); + +create table earray_bean ( + id bigint auto_increment not null, + foo integer, + name varchar(255), + phone_numbers varchar(300), + uids varchar(1000) not null, + other_ids varchar(1000), + doubs varchar(1000), + statuses varchar(1000), + vc_enums varchar(1000), + int_enums varchar(1000), + status2 varchar(1000), + version bigint not null, + constraint pk_earray_bean primary key (id) +); + +create table earray_set_bean ( + id bigint auto_increment not null, + name varchar(255), + phone_numbers varchar(300), + uids varchar(1000), + other_ids varchar(1000), + doubs varchar(1000), + version bigint not null, + constraint pk_earray_set_bean primary key (id) +); + +create table e_basic ( + id integer auto_increment not null, + status varchar(1), + name varchar(127), + description varchar(255), + some_date datetime(6), + constraint pk_e_basic primary key (id) +); + +create table ebasic_change_log ( + id bigint auto_increment not null, + name varchar(20), + short_description varchar(50), + long_description varchar(100), + who_created varchar(255) not null, + who_modified varchar(255) not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + version bigint not null, + constraint pk_ebasic_change_log primary key (id) +); + +create table ebasic_clob ( + id bigint auto_increment not null, + name varchar(255), + title varchar(255), + description longtext, + last_update datetime(6) not null, + constraint pk_ebasic_clob primary key (id) +); + +create table ebasic_clob_fetch_eager ( + id bigint auto_increment not null, + name varchar(255), + title varchar(255), + description longtext, + last_update datetime(6) not null, + constraint pk_ebasic_clob_fetch_eager primary key (id) +); + +create table ebasic_clob_no_ver ( + id bigint auto_increment not null, + name varchar(255), + description longtext, + constraint pk_ebasic_clob_no_ver primary key (id) +); + +create table e_basicenc ( + id integer auto_increment not null, + name varchar(255), + description varbinary(80), + dob varbinary(20), + status varbinary(20), + last_update datetime(6), + constraint pk_e_basicenc primary key (id) +); + +create table e_basicenc_bin ( + id integer auto_increment not null, + name varchar(255), + description varchar(255), + data longblob, + some_time varbinary(255), + last_update datetime(6) not null, + constraint pk_e_basicenc_bin primary key (id) +); + +create table e_basicenc_client ( + id bigint auto_increment 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 auto_increment 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 pk_e_basic_enum_id primary key (status) +); + +create table e_basic_eni ( + id integer auto_increment not null, + status integer, + name varchar(255), + description varchar(255), + some_date datetime(6), + constraint pk_e_basic_eni primary key (id) +); + +create table ebasic_hstore ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + value_set json, + value_list json, + value_map json, + plain_value json, + version bigint not null, + constraint pk_ebasic_json_jackson primary key (id) +); + +create table ebasic_json_jackson2 ( + id bigint auto_increment not null, + name varchar(255), + value_set json, + value_list json, + value_map json, + plain_value json, + version bigint not null, + constraint pk_ebasic_json_jackson2 primary key (id) +); + +create table ebasic_json_list ( + id bigint auto_increment not null, + name varchar(255), + bean_set json, + bean_list json, + bean_map json, + plain_bean json, + flags json, + tags varchar(100), + version bigint not null, + constraint pk_ebasic_json_list primary key (id) +); + +create table ebasic_json_map ( + id bigint auto_increment not null, + name varchar(255), + content json, + version bigint not null, + constraint pk_ebasic_json_map primary key (id) +); + +create table ebasic_json_map_blob ( + id bigint auto_increment not null, + name varchar(255), + content longblob, + version bigint not null, + constraint pk_ebasic_json_map_blob primary key (id) +); + +create table ebasic_json_map_clob ( + id bigint auto_increment not null, + name varchar(255), + content longtext, + version bigint not null, + constraint pk_ebasic_json_map_clob primary key (id) +); + +create table ebasic_json_map_detail ( + id bigint auto_increment not null, + owner_id bigint, + name varchar(255), + content json, + version bigint not null, + constraint pk_ebasic_json_map_detail primary key (id) +); + +create table ebasic_json_map_json_b ( + id bigint auto_increment not null, + name varchar(255), + content json, + version bigint not null, + constraint pk_ebasic_json_map_json_b primary key (id) +); + +create table ebasic_json_map_varchar ( + id bigint auto_increment 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_node ( + id bigint auto_increment not null, + name varchar(255), + content json, + version bigint not null, + constraint pk_ebasic_json_node primary key (id) +); + +create table ebasic_json_node_blob ( + id bigint auto_increment not null, + name varchar(255), + content longblob, + version bigint not null, + constraint pk_ebasic_json_node_blob primary key (id) +); + +create table ebasic_json_node_json_b ( + id bigint auto_increment not null, + name varchar(255), + content json, + version bigint not null, + constraint pk_ebasic_json_node_json_b primary key (id) +); + +create table ebasic_json_node_varchar ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_ebasic_json_unmapped primary key (id) +); + +create table e_basic_ndc ( + id integer auto_increment not null, + name varchar(255), + constraint pk_e_basic_ndc primary key (id) +); + +create table ebasic_no_sdchild ( + id bigint auto_increment 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_sdchild ( + id bigint auto_increment not null, + owner_id bigint not null, + child_name varchar(255), + amount bigint not null, + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_ebasic_sdchild primary key (id) +); + +create table ebasic_soft_delete ( + id bigint auto_increment not null, + name varchar(255), + description varchar(255), + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_ebasic_soft_delete primary key (id) +); + +create table e_basicver ( + id integer auto_increment not null, + name varchar(255), + description varchar(255), + other varchar(255), + last_update datetime(6) not null, + constraint pk_e_basicver primary key (id) +); + +create table e_basic_withlife ( + id bigint auto_increment not null, + name varchar(255), + other varchar(255), + deleted tinyint(1) default 0 not null, + version bigint not null, + constraint pk_e_basic_withlife primary key (id) +); + +create table e_basic_with_ex ( + id bigint auto_increment not null, + deleted tinyint(1) default 0 not null, + version bigint not null, + constraint pk_e_basic_with_ex primary key (id) +); + +create table e_basicverucon ( + id integer auto_increment not null, + name varchar(127), + other varchar(127), + other_one varchar(127), + description varchar(255), + last_update datetime(6) 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 varchar(40) not null, + name varchar(100), + root_id varchar(40) not null, + constraint pk_ecache_child primary key (id) +); + +create table ecache_root ( + id varchar(40) not null, + name varchar(100), + constraint pk_ecache_root primary key (id) +); + +create table e_col_ab ( + id bigint auto_increment 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 auto_increment 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 auto_increment 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 auto_increment not null, + nome_outer varchar(255), + date1 datetime(6), + date2 datetime(6), + 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 auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + ts_created datetime(6) not null, + ts_updated datetime(6) not null, + ldt_created datetime(6) not null, + ldt_updated datetime(6) not null, + odt_created datetime(6) not null, + odt_updated datetime(6) not null, + zdt_created datetime(6) not null, + zdt_updated datetime(6) not null, + instant_created datetime(6) not null, + instant_updated datetime(6) 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 auto_increment not null, + uuid varchar(40) 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 auto_increment not null, + invoice_date datetime(6), + state integer, + person_id bigint, + ship_street varchar(255), + ship_suburb varchar(255), + ship_city varchar(255), + ship_status varchar(3), + bill_street varchar(255), + bill_suburb varchar(255), + bill_city varchar(255), + bill_status varchar(3), + version bigint not null, + constraint pk_einvoice primary key (id) +); + +create table e_main ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_enull_collection primary key (id) +); + +create table enull_collection_detail ( + id integer auto_increment 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 auto_increment not null, + name_for_a varchar(255), + b_id integer, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_eopt_one_a primary key (id) +); + +create table eopt_one_b ( + id integer auto_increment not null, + name_for_b varchar(255), + c_id integer not null, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_eopt_one_b primary key (id) +); + +create table eopt_one_c ( + id integer auto_increment not null, + name_for_c varchar(255), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_eopt_one_c primary key (id) +); + +create table eper_addr ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + notes varchar(255), + street varchar(255), + suburb varchar(255), + addr_city varchar(255), + addr_status varchar(3), + version bigint not null, + constraint pk_eperson primary key (id) +); + +create table e_person_online ( + id bigint auto_increment not null, + email varchar(127), + online_status tinyint(1) default 0 not null, + when_updated datetime(6) not null, + constraint uq_e_person_online_email unique (email), + constraint pk_e_person_online primary key (id) +); + +create table esimple ( + usertypeid integer auto_increment not null, + name varchar(255), + constraint pk_esimple primary key (usertypeid) +); + +create table esoft_del_book ( + id bigint auto_increment not null, + book_title varchar(255), + lend_by_id bigint, + version bigint not null, + deleted tinyint(1) default 0 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 auto_increment not null, + esoft_del_mid_id bigint not null, + down varchar(255), + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_esoft_del_down primary key (id) +); + +create table esoft_del_mid ( + id bigint auto_increment not null, + top_id bigint, + mid varchar(255), + up_id bigint, + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_esoft_del_mid primary key (id) +); + +create table esoft_del_one_a ( + id bigint auto_increment not null, + name varchar(255), + oneb_id bigint, + deleted tinyint(1) default 0 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 auto_increment 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 auto_increment not null, + role_name varchar(255), + version bigint not null, + deleted tinyint(1) default 0 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 auto_increment not null, + name varchar(255), + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_esoft_del_top primary key (id) +); + +create table esoft_del_up ( + id bigint auto_increment not null, + up varchar(255), + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_esoft_del_up primary key (id) +); + +create table esoft_del_user ( + id bigint auto_increment not null, + user_name varchar(255), + version bigint not null, + deleted tinyint(1) default 0 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 esome_convert_type ( + id bigint auto_increment not null, + name varchar(255), + money decimal(16,3), + constraint pk_esome_convert_type primary key (id) +); + +create table esome_type ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_etrans_many primary key (id) +); + +create table rawinherit_uncle ( + id integer auto_increment 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 auto_increment 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 auto_increment not null, + user_name varchar(255), + constraint pk_euser_no_fk_soft_del primary key (user_id) +); + +create table evanilla_collection ( + id integer auto_increment not null, + name varchar(255), + constraint pk_evanilla_collection primary key (id) +); + +create table evanilla_collection_detail ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment 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 auto_increment 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 +); + +create table ec_person ( + id bigint auto_increment 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 auto_increment 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 auto_increment 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 auto_increment 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 auto_increment 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 auto_increment 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 longtext not null +); + +create table ecs_person ( + id bigint auto_increment 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 varchar(40) 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 varchar(40) not null, + value varchar(255) not null +); + +create table ecsm_one ( + one_id varchar(40) not null, + name varchar(255), + version bigint not null, + constraint pk_ecsm_one primary key (one_id) +); + +create table ecsm_parent ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_ecsm_parent primary key (id) +); + +create table ecsm_two ( + id varchar(40) not null, + name varchar(255), + version bigint not null, + constraint pk_ecsm_two primary key (id) +); + +create table td_child ( + child_id integer auto_increment 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 auto_increment not null, + parent_name varchar(255), + extended_name varchar(255), + constraint pk_td_parent primary key (parent_id) +); + +create table element_bean ( + id bigint auto_increment not null, + complex_bean_id varchar(40) not null, + value varchar(255) not null, + constraint pk_element_bean primary key (id) +); + +create table empl ( + id bigint auto_increment not null, + name varchar(255), + age integer, + default_address_id bigint, + constraint pk_empl primary key (id) +); + +create table esd_detail ( + id bigint auto_increment not null, + name varchar(255), + master_id bigint not null, + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_esd_detail primary key (id) +); + +create table esd_master ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_esd_master primary key (id) +); + +create table feature_desc ( + id integer auto_increment not null, + name varchar(255), + description varchar(255), + constraint pk_feature_desc primary key (id) +); + +create table f_first ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_f_first primary key (id) +); + +create table foo ( + foo_id integer auto_increment not null, + important_text varchar(255), + version integer not null, + constraint pk_foo primary key (foo_id) +); + +create table gen_key_identity ( + id bigint auto_increment not null, + description varchar(255), + constraint pk_gen_key_identity primary key (id) +); + +create table gen_key_sequence ( + id bigint auto_increment not null, + description varchar(255), + constraint pk_gen_key_sequence primary key (id) +); + +create table grand_parent_person ( + identifier integer auto_increment 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 auto_increment 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 auto_increment not null, + inactive tinyint(1) default 0 not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_c_group primary key (id) +); + +create table he_doc ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_he_doc primary key (id) +); + +create table hx_link ( + id bigint auto_increment not null, + name varchar(255), + location varchar(255), + comments varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + deleted tinyint(1) default 0 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 auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_hi_doc primary key (id) +); + +create table hi_link ( + id bigint auto_increment not null, + name varchar(255), + location varchar(255), + comments varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment not null, + name varchar(255), + comments varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_hi_tone primary key (id) +); + +create table hi_tthree ( + id bigint auto_increment not null, + hi_ttwo_id bigint not null, + three varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_hi_tthree primary key (id) +); + +create table hi_ttwo ( + id bigint auto_increment not null, + hi_tone_id bigint not null, + two varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_hi_ttwo primary key (id) +); + +create table hsd_setting ( + id bigint auto_increment not null, + code varchar(255), + content varchar(255), + user_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + deleted tinyint(1) default 0 not null, + constraint uq_hsd_setting_user_id unique (user_id), + constraint pk_hsd_setting primary key (id) +); + +create table hsd_user ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + deleted tinyint(1) default 0 not null, + constraint pk_hsd_user primary key (id) +); + +create table iaf_segment ( + ptype varchar(31) not null, + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_iaf_segment_status primary key (id) +); + +create table imrelated ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + title varchar(255), + when_title datetime(6), + constraint pk_imroot primary key (id) +); + +create table ixresource ( + dtype varchar(255), + id varchar(40) not null, + name varchar(255), + constraint pk_ixresource primary key (id) +); + +create table info_company ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_info_company primary key (id) +); + +create table info_contact ( + id bigint auto_increment 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 auto_increment 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 auto_increment 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 auto_increment not null, + booking bigint, + version integer not null, + constraint pk_drel_invoice primary key (id) +); + +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 datetime(6), + date_created datetime(6), + modified_by varchar(255), + created_by varchar(255), + version bigint not null, + constraint pk_item primary key (customer,itemnumber) +); + +create table monkey ( + mid bigint auto_increment not null, + name varchar(255), + food_preference varchar(255), + version bigint not null, + constraint pk_monkey primary key (mid) +); + +create table mkeygroup ( + pid bigint auto_increment 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 auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_l2_cldf_reset_bean primary key (id) +); + +create table l2_cldf_reset_bean_child ( + id bigint auto_increment not null, + parent_id bigint, + constraint pk_l2_cldf_reset_bean_child primary key (id) +); + +create table level1 ( + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_level3 primary key (id) +); + +create table level4 ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_level4 primary key (id) +); + +create table link ( + id bigint auto_increment not null, + name varchar(255), + location varchar(255), + when_publish datetime(6), + link_comment varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + deleted tinyint(1) default 0 not null, + constraint pk_link primary key (id) +); + +create table link_draft ( + id bigint auto_increment not null, + name varchar(255), + location varchar(255), + when_publish datetime(6), + link_comment varchar(255), + dirty tinyint(1) default 0 not null, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + deleted tinyint(1) default 0 not null, + constraint pk_link_draft primary key (id) +); + +create table la_attr_value ( + id integer auto_increment not null, + name varchar(255), + cretime datetime(6) not null, + updtime datetime(6) 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 auto_increment not null, + tune_id bigint, + name varchar(255), + constraint pk_looney primary key (id) +); + +create table maddress ( + id varchar(40) not null, + street varchar(255), + city varchar(255), + version bigint not null, + constraint pk_maddress primary key (id) +); + +create table mcontact ( + id varchar(40) not null, + email varchar(255), + first_name varchar(255), + last_name varchar(255), + customer_id varchar(40), + version bigint not null, + constraint pk_mcontact primary key (id) +); + +create table mcontact_message ( + id varchar(40) not null, + title varchar(255), + subject varchar(255), + notes varchar(255), + contact_id varchar(40) not null, + version bigint not null, + constraint pk_mcontact_message primary key (id) +); + +create table mcustomer ( + id varchar(40) not null, + name varchar(255), + notes varchar(255), + shipping_address_id varchar(40), + billing_address_id varchar(40), + version bigint not null, + constraint pk_mcustomer primary key (id) +); + +create table mgroup ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_mgroup primary key (id) +); + +create table mmachine ( + id bigint auto_increment 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 auto_increment not null, + url varchar(255), + note varchar(255), + constraint pk_mmedia primary key (id) +); + +create table non_updateprop ( + id integer auto_increment not null, + non_enum varchar(5), + name varchar(255), + note varchar(255), + constraint pk_non_updateprop primary key (id) +); + +create table mprinter ( + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + picture_id bigint, + name varchar(255), + constraint pk_mprofile primary key (id) +); + +create table mprotected_construct_bean ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_mprotected_construct_bean primary key (id) +); + +create table mrole ( + roleid integer auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_msome_other primary key (id) +); + +create table muser ( + userid integer auto_increment not null, + user_name varchar(255), + user_type_id integer, + constraint pk_muser primary key (userid) +); + +create table muser_type ( + id integer auto_increment not null, + name varchar(255), + constraint pk_muser_type primary key (id) +); + +create table mail_box ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_mail_box primary key (id) +); + +create table mail_user ( + id bigint auto_increment 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 varchar(40) 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 auto_increment not null, + name varchar(255), + when_created datetime(6) not null, + when_updated datetime(6) not null, + constraint pk_map_super_actual primary key (id) +); + +create table c_message ( + id bigint auto_increment not null, + title varchar(255), + body varchar(255), + conversation_id bigint, + user_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_c_message primary key (id) +); + +create table meter_address_data ( + id varchar(40) not null, + street varchar(255) not null, + constraint pk_meter_address_data primary key (id) +); + +create table meter_contract_data ( + id varchar(40) not null, + special_needs_client_id varchar(40) 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 varchar(40) not null, + name varchar(255), + primary_id varchar(40), + 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 varchar(40) not null, + name varchar(255), + constraint pk_meter_special_needs_contact primary key (id) +); + +create table meter_version ( + id varchar(40) not null, + address_data_id varchar(40), + contract_data_id varchar(40) 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 auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_mny_a primary key (id) +); + +create table mny_b ( + id bigint auto_increment not null, + name varchar(255), + a_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_mny_c primary key (id) +); + +create table mny_topic ( + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_mp_user primary key (id) +); + +create table ms_many_a ( + aid bigint auto_increment not null, + name varchar(255), + ms_many_a_many_b tinyint(1) default 0 not null, + ms_many_b tinyint(1) default 0 not null, + deleted tinyint(1) default 0 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 auto_increment not null, + name varchar(255), + deleted tinyint(1) default 0 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 auto_increment not null, + name varchar(255), + my_count integer not null, + my_lob longtext, + constraint pk_my_lob_size primary key (id) +); + +create table my_lob_size_join_many ( + id integer auto_increment 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 datetime(6) not null +); + +create table o_bean_child ( + id bigint auto_increment not null, + cached_bean_id bigint, + constraint pk_o_bean_child primary key (id) +); + +create table ocached_app ( + id bigint auto_increment 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 auto_increment 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 auto_increment 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 auto_increment 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 auto_increment 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 auto_increment 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 auto_increment 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 auto_increment not null, + cid varchar(40), + other varchar(255), + version bigint not null, + constraint pk_ocached_nkey_uid primary key (id) +); + +create table ocar ( + id integer auto_increment not null, + vin varchar(255), + name varchar(255), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_ocar primary key (id) +); + +create table ocompany ( + id integer auto_increment not null, + corp_id varchar(50), + cretime datetime(6) not null, + updtime datetime(6) 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 varchar(40) 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 varchar(40) 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 varchar(40) not null, + constraint pk_omvertex primary key (id) +); + +create table omvertex_other ( + id varchar(40) not null, + omvertex_id varchar(40) not null, + name varchar(255), + constraint pk_omvertex_other primary key (id) +); + +create table oroad_show_msg ( + id integer auto_increment not null, + company_id integer not null, + cretime datetime(6) not null, + updtime datetime(6) 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_om_account_dbo primary key (id) +); + +create table om_basic_child ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_om_basic_parent primary key (id) +); + +create table om_ordered_detail ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_om_ordered_master primary key (id) +); + +create table only_id_entity ( + id bigint auto_increment not null, + constraint pk_only_id_entity primary key (id) +); + +create table o_order ( + id integer auto_increment not null, + status integer, + order_date date, + ship_date date, + kcustomer_id integer not null, + cretime datetime(6) not null, + updtime datetime(6) not null, + constraint pk_o_order primary key (id) +); + +create table o_order_detail ( + id integer auto_increment not null, + order_id integer not null, + order_qty integer, + ship_qty integer, + unit_price double, + product_id integer, + cretime datetime(6), + updtime datetime(6) 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 auto_increment not null, + constraint pk_order_master primary key (id) +); + +create table order_master_inheritance ( + id integer auto_increment not null, + constraint pk_order_master_inheritance primary key (id) +); + +create table order_referenced_parent ( + type varchar(31) not null, + id bigint auto_increment 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 auto_increment not null, + order_id integer, + ship_time datetime(6), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_or_order_ship primary key (id) +); + +create table order_toy ( + id integer auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_organisation primary key (id) +); + +create table organization_node ( + kind varchar(31) not null, + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + child varchar(255), + constraint pk_oto_bchild primary key (master_id) +); + +create table oto_bmaster ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_oto_bmaster primary key (id) +); + +create table oto_child ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_oto_cust primary key (cid) +); + +create table oto_cust_address ( + aid bigint auto_increment 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 auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_oto_level_c primary key (id) +); + +create table oto_master ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_oto_master primary key (id) +); + +create table oto_prime ( + pid bigint auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_oto_prime primary key (pid) +); + +create table oto_prime_extra ( + eid bigint auto_increment not null, + extra varchar(255), + version bigint not null, + constraint pk_oto_prime_extra primary key (eid) +); + +create table oto_sd_child ( + id bigint auto_increment not null, + child varchar(255), + master_id bigint, + deleted tinyint(1) default 0 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_oto_sd_master primary key (id) +); + +create table oto_th_many ( + id bigint auto_increment not null, + oto_th_top_id bigint not null, + many varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_oto_th_many primary key (id) +); + +create table oto_th_one ( + id bigint auto_increment not null, + one tinyint(1) default 0 not null, + many_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment not null, + topp varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_oto_th_top primary key (id) +); + +create table oto_ubprime ( + pid varchar(40) not null, + name varchar(255), + version bigint not null, + constraint pk_oto_ubprime primary key (pid) +); + +create table oto_ubprime_extra ( + eid varchar(40) not null, + extra varchar(255), + version bigint not null, + constraint pk_oto_ubprime_extra primary key (eid) +); + +create table oto_uprime ( + pid varchar(40) not null, + name varchar(255), + version bigint not null, + constraint pk_oto_uprime primary key (pid) +); + +create table oto_uprime_extra ( + eid varchar(40) not null, + extra varchar(255), + version bigint not null, + constraint pk_oto_uprime_extra primary key (eid) +); + +create table oto_user_model ( + id bigint auto_increment not null, + name varchar(255), + user_optional_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment not null, + optional varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_oto_user_model_optional primary key (id) +); + +create table pfile ( + id integer auto_increment not null, + name varchar(255), + file_content_id integer, + file_content2_id integer, + cretime datetime(6) not null, + updtime datetime(6) 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 auto_increment not null, + content longblob, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_pfile_content primary key (id) +); + +create table paggview ( + pview_id varchar(40), + amount integer not null, + constraint uq_paggview_pview_id unique (pview_id) +); + +create table pallet_location ( + type varchar(31) not null, + id integer auto_increment not null, + zone_sid integer not null, + attribute varchar(255), + constraint pk_pallet_location primary key (id) +); + +create table parcel ( + parcelid bigint auto_increment not null, + description varchar(255), + constraint pk_parcel primary key (parcelid) +); + +create table parcel_location ( + parcellocid bigint auto_increment 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 auto_increment 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 auto_increment not null, + version bigint not null, + constraint pk_e_save_test_c primary key (id) +); + +create table parent_person ( + identifier integer auto_increment 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 auto_increment not null, + rating integer, + type integer, + conversation_id bigint not null, + user_id bigint not null, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_c_participation primary key (id) +); + +create table password_store_model ( + id bigint auto_increment not null, + enc1 varchar(30), + enc2 varchar(40), + enc3 longtext, + enc4 varbinary(30), + enc5 varbinary(40), + enc6 longblob, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_password_store_model primary key (id) +); + +create table pcf_calendar ( + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + version bigint not null, + constraint pk_pcf_country primary key (id) +); + +create table pcf_event ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_pcf_person primary key (id) +); + +create table mt_permission ( + id varchar(40) not null, + name varchar(255), + constraint pk_mt_permission primary key (id) +); + +create table persistent_file ( + id integer auto_increment not null, + name varchar(255), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_persistent_file primary key (id) +); + +create table persistent_file_content ( + id integer auto_increment not null, + persistent_file_id integer, + content longblob, + cretime datetime(6) not null, + updtime datetime(6) 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 auto_increment not null, + default_address_oid bigint, + version integer not null, + constraint pk_person primary key (oid) +); + +create table persons ( + id bigint auto_increment 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 phones ( + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + sku varchar(20), + name varchar(255), + cretime datetime(6) not null, + updtime datetime(6) not null, + constraint pk_o_product primary key (id) +); + +create table pp ( + id varchar(40) not null, + name varchar(255), + value varchar(100) not null, + constraint pk_pp primary key (id) +); + +create table pp_to_ww ( + pp_id varchar(40) not null, + ww_id varchar(40) not null, + constraint pk_pp_to_ww primary key (pp_id,ww_id) +); + +create table question ( + id bigint auto_increment 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 auto_increment 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 auto_increment 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 varchar(40) 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 auto_increment not null, + name varchar(255), + version integer not null, + constraint pk_rel_detail primary key (id) +); + +create table rel_master ( + id bigint auto_increment not null, + name varchar(255), + detail_id bigint, + version integer not null, + constraint pk_rel_master 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 varchar(40) not null, + name varchar(50), + tenant_id varchar(40), + version bigint not null, + constraint pk_mt_role primary key (id) +); + +create table mt_role_permission ( + mt_role_id varchar(40) not null, + mt_permission_id varchar(40) not null, + constraint pk_mt_role_permission primary key (mt_role_id,mt_permission_id) +); + +create table em_role ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_em_role primary key (id) +); + +create table root_bean ( + dtype varchar(31) not null, + id varchar(40) not null, + referencing_bean_id varchar(40) not null, + value varchar(255), + constraint pk_root_bean primary key (id) +); + +create table f_second ( + id bigint auto_increment 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 auto_increment not null, + article_id integer, + type integer, + content longtext, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_section primary key (id) +); + +create table self_parent ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + referred_by_id bigint, + constraint pk_self_ref_customer primary key (id) +); + +create table self_ref_example ( + id bigint auto_increment 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 auto_increment not null, + version bigint not null, + constraint pk_e_save_test_a primary key (id) +); + +create table e_save_test_b ( + id bigint auto_increment not null, + sibling_a_id bigint, + test_property tinyint(1) default 0 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 varchar(40) not null, + name varchar(255), + parent_id varchar(40), + data_container_id varchar(40), + site_address_id varchar(40), + 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 varchar(40) 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 auto_increment not null, + some_enum integer, + name varchar(255), + constraint pk_some_enum_bean primary key (id) +); + +create table some_file_bean ( + id bigint auto_increment not null, + name varchar(255), + content longblob, + version bigint not null, + constraint pk_some_file_bean primary key (id) +); + +create table some_new_types_bean ( + id bigint auto_increment 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 datetime(6), + offset_date_time datetime(6), + zoned_date_time datetime(6), + local_time time, + instant datetime(6), + zone_id varchar(60), + zone_offset varchar(60), + path varchar(255), + period varchar(20), + duration bigint, + version bigint not null, + constraint pk_some_new_types_bean primary key (id) +); + +create table some_period_bean ( + id bigint auto_increment 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 varchar(40) not null, + name varchar(255), + pos integer not null, + target_id varchar(40), + constraint pk_source_base primary key (id) +); + +create table stockforecast ( + type varchar(31) not null, + id bigint auto_increment not null, + inner_report_id bigint, + constraint pk_stockforecast primary key (id) +); + +create table sub_section ( + id integer auto_increment not null, + section_id integer, + title varchar(255), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_sub_section primary key (id) +); + +create table sub_type ( + sub_type_id integer auto_increment not null, + description varchar(255), + version bigint not null, + constraint pk_sub_type primary key (sub_type_id) +); + +create table survey ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_survey primary key (id) +); + +create table tbytes_only ( + id integer auto_increment not null, + content longblob, + constraint pk_tbytes_only primary key (id) +); + +create table tcar ( + type varchar(31) not null, + plate_no varchar(32) not null, + truckload bigint, + constraint pk_tcar primary key (plate_no) +); + +create table tevent ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_tevent primary key (id) +); + +create table tevent_many ( + id bigint auto_increment not null, + description varchar(255), + event_id bigint, + 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 auto_increment not null, + name varchar(255), + status integer, + event_id bigint, + version bigint not null, + 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 auto_increment not null, + name varchar(255), + child_property varchar(255), + constraint pk_tint_root primary key (id) +); + +create table tjoda_entity ( + id integer auto_increment not null, + local_time time, + constraint pk_tjoda_entity primary key (id) +); + +create table t_mapsuper1 ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + description varchar(255), + active tinyint(1) default 0 not null, + constraint pk_t_oneb primary key (id) +); + +create table t_detail_with_other_namexxxyy ( + id integer auto_increment not null, + name varchar(255), + description varchar(255), + some_unique_value varchar(127), + active tinyint(1) default 0 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 table t_atable_thatisrelatively ( + id integer auto_increment not null, + name varchar(255), + description varchar(255), + active tinyint(1) default 0 not null, + constraint pk_t_atable_thatisrelatively primary key (id) +); + +create table ttruck_holder ( + id bigint auto_increment 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 auto_increment not null, + some_uid varchar(40), + foo varchar(255), + owner_id bigint not null, + constraint pk_ttruck_holder_item primary key (id) +); + +create table tuuid_entity ( + id varchar(40) not null, + name varchar(255), + constraint pk_tuuid_entity primary key (id) +); + +create table twheel ( + id bigint auto_increment not null, + owner_plate_no varchar(32) not null, + constraint pk_twheel primary key (id) +); + +create table twith_pre_insert ( + id integer auto_increment 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 varchar(40) not null, + name varchar(255), + constraint pk_target_base primary key (id) +); + +create table mt_tenant ( + id varchar(40) 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 tire ( + id bigint auto_increment not null, + wheel bigint, + version integer not null, + constraint uq_tire_wheel unique (wheel), + constraint pk_tire primary key (id) +); + +create table sa_tire ( + id bigint auto_increment not null, + version integer not null, + constraint pk_sa_tire primary key (id) +); + +create table tree_entity ( + id integer auto_increment not null, + text varchar(255), + parent_id integer, + constraint pk_tree_entity primary key (id) +); + +create table trip ( + id integer auto_increment not null, + vehicle_driver_id integer, + destination varchar(255), + address_id integer, + star_date datetime(6), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_trip primary key (id) +); + +create table truck_ref ( + id integer auto_increment not null, + something varchar(255), + constraint pk_truck_ref primary key (id) +); + +create table tune ( + id bigint auto_increment 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 auto_increment not null, + moda varchar(255), + ts datetime(6), + tstz datetime(6), + constraint pk_tz_bean primary key (id) +); + +create table usib_child ( + id varchar(40) not null, + parent_id bigint, + deleted tinyint(1) default 0 not null, + constraint pk_usib_child primary key (id) +); + +create table usib_child_sibling ( + id bigint auto_increment not null, + child_id varchar(40), + deleted tinyint(1) default 0 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 auto_increment not null, + deleted tinyint(1) default 0 not null, + constraint pk_usib_parent primary key (id) +); + +create table ut_detail ( + id integer auto_increment 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 auto_increment 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 varchar(40) not null, + name varchar(255), + description varchar(255), + version bigint not null, + constraint pk_uuone primary key (id) +); + +create table uutwo ( + id varchar(40) not null, + name varchar(255), + notes varchar(255), + master_id varchar(40), + version bigint not null, + constraint pk_uutwo primary key (id) +); + +create table oto_user ( + id bigint auto_increment not null, + name varchar(255), + account_id bigint not null, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint uq_oto_user_account_id unique (account_id), + constraint pk_oto_user primary key (id) +); + +create table c_user ( + id bigint auto_increment not null, + inactive tinyint(1) default 0 not null, + name varchar(255), + email varchar(255), + password_hash varchar(255), + group_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_c_user primary key (id) +); + +create table tx_user ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_tx_user primary key (id) +); + +create table g_user ( + id bigint auto_increment not null, + username varchar(255), + version bigint not null, + constraint pk_g_user primary key (id) +); + +create table em_user ( + id bigint auto_increment 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 datetime(6) 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 auto_increment not null, + license_number varchar(255), + registration_date datetime(6), + lease_id bigint, + cretime datetime(6) not null, + updtime datetime(6) 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 pk_vehicle primary key (id) +); + +create table vehicle_driver ( + id integer auto_increment not null, + name varchar(255), + vehicle_id integer, + address_id integer, + license_issued_on datetime(6), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_vehicle_driver primary key (id) +); + +create table vehicle_lease ( + dtype varchar(31) not null, + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + version integer not null, + constraint pk_version_parent primary key (id) +); + +create table version_toy ( + id integer auto_increment 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 auto_increment 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 auto_increment not null, + version integer not null, + constraint pk_wheel primary key (id) +); + +create table sa_wheel ( + id bigint auto_increment not null, + tire bigint, + car bigint, + version integer not null, + constraint pk_sa_wheel primary key (id) +); + +create table sp_car_wheel ( + id bigint auto_increment not null, + name varchar(255), + version integer not null, + constraint pk_sp_car_wheel primary key (id) +); + +create table g_who_props_otm ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_parent primary key (id) +); + +create table wview ( + id varchar(40) 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 auto_increment 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 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_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_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; + +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 cascade; + +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 set null; + +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; + +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_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_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_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_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_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; + +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_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_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 hx_link add system versioning; +alter table hi_link add system versioning; +alter table hi_link_doc add system versioning; +alter table hi_tone add system versioning; +alter table hi_tthree add system versioning; +alter table hi_ttwo add system versioning; +alter table hsd_setting add system versioning; +alter table hsd_user add system versioning; +alter table link add system versioning; +alter table c_user add system versioning; diff --git a/ebean-core/src/test/ddl-review/mariadb-drop-all.sql b/ebean-core/src/test/ddl-review/mariadb-drop-all.sql new file mode 100644 index 000000000..15f89f02d --- /dev/null +++ b/ebean-core/src/test/ddl-review/mariadb-drop-all.sql @@ -0,0 +1,1868 @@ +-- Generated by ebean unknown at 2020-06-29T03:48:37.908711Z +alter table bar drop foreign key fk_bar_foo_id; +drop index ix_bar_foo_id on bar; + +alter table acl_container_relation drop foreign key fk_acl_container_relation_container_id; +drop index ix_acl_container_relation_container_id on acl_container_relation; + +alter table acl_container_relation drop foreign key fk_acl_container_relation_acl_entry_id; +drop index ix_acl_container_relation_acl_entry_id on acl_container_relation; + +alter table addr drop foreign key fk_addr_employee_id; +drop index ix_addr_employee_id on addr; + +alter table o_address drop foreign key fk_o_address_country_code; +drop index ix_o_address_country_code on o_address; + +alter table album drop foreign key fk_album_cover_id; + +alter table animal drop foreign key fk_animal_shelter_id; +drop index ix_animal_shelter_id on animal; + +alter table attribute drop foreign key fk_attribute_attribute_holder_id; +drop index ix_attribute_attribute_holder_id on attribute; + +alter table bbookmark drop foreign key fk_bbookmark_user_id; +drop index ix_bbookmark_user_id on bbookmark; + +alter table bbookmark_user drop foreign key fk_bbookmark_user_org_id; +drop index ix_bbookmark_user_org_id on bbookmark_user; + +alter table bsite_user_a drop foreign key fk_bsite_user_a_site_id; +drop index ix_bsite_user_a_site_id on bsite_user_a; + +alter table bsite_user_a drop foreign key fk_bsite_user_a_user_id; +drop index ix_bsite_user_a_user_id on bsite_user_a; + +alter table bsite_user_b drop foreign key fk_bsite_user_b_site; +drop index ix_bsite_user_b_site on bsite_user_b; + +alter table bsite_user_b drop foreign key fk_bsite_user_b_usr; +drop index ix_bsite_user_b_usr on bsite_user_b; + +alter table bsite_user_c drop foreign key fk_bsite_user_c_site_uid; +drop index ix_bsite_user_c_site_uid on bsite_user_c; + +alter table bsite_user_c drop foreign key fk_bsite_user_c_user_uid; +drop index ix_bsite_user_c_user_uid on bsite_user_c; + +alter table bsite_user_e drop foreign key fk_bsite_user_e_site_id; +drop index ix_bsite_user_e_site_id on bsite_user_e; + +alter table bsite_user_e drop foreign key fk_bsite_user_e_user_id; +drop index ix_bsite_user_e_user_id on bsite_user_e; + +alter table basic_draftable_bean drop foreign key fk_basic_draftable_bean_id; + +alter table drel_booking drop foreign key fk_drel_booking_agent_invoice; + +alter table drel_booking drop foreign key fk_drel_booking_client_invoice; + +alter table cepproduct_category drop foreign key fk_cepproduct_category_category_id; +drop index ix_cepproduct_category_category_id on cepproduct_category; + +alter table cepproduct_category drop foreign key fk_cepproduct_category_product_id; +drop index ix_cepproduct_category_product_id on cepproduct_category; + +alter table ciaddress drop foreign key fk_ciaddress_street_id; +drop index ix_ciaddress_street_id on ciaddress; + +alter table cicustomer_parent drop foreign key fk_cicustomer_parent_address_id; +drop index ix_cicustomer_parent_address_id on cicustomer_parent; + +alter table cinh_ref drop foreign key fk_cinh_ref_ref_id; +drop index ix_cinh_ref_ref_id on cinh_ref; + +alter table ckey_detail drop foreign key fk_ckey_detail_parent; +drop index ix_ckey_detail_parent on ckey_detail; + +alter table ckey_parent drop foreign key fk_ckey_parent_assoc_id; +drop index ix_ckey_parent_assoc_id on ckey_parent; + +alter table coone_many drop foreign key fk_coone_many_coone_id; +drop index ix_coone_many_coone_id on coone_many; + +alter table coroot drop foreign key fk_coroot_one_id; + +alter table calculation_result drop foreign key fk_calculation_result_product_configuration_id; +drop index ix_calculation_result_product_configuration_id on calculation_result; + +alter table calculation_result drop foreign key fk_calculation_result_group_configuration_id; +drop index ix_calculation_result_group_configuration_id on calculation_result; + +alter table sp_car_car_wheels drop foreign key fk_sp_car_car_wheels_sp_car_car; +drop index ix_sp_car_car_wheels_sp_car_car on sp_car_car_wheels; + +alter table sp_car_car_wheels drop foreign key fk_sp_car_car_wheels_sp_car_wheel; +drop index ix_sp_car_car_wheels_sp_car_wheel on sp_car_car_wheels; + +alter table sp_car_car_doors drop foreign key fk_sp_car_car_doors_sp_car_car; +drop index ix_sp_car_car_doors_sp_car_car on sp_car_car_doors; + +alter table sp_car_car_doors drop foreign key fk_sp_car_car_doors_sp_car_door; +drop index ix_sp_car_car_doors_sp_car_door on sp_car_car_doors; + +alter table car_accessory drop foreign key fk_car_accessory_fuse_id; +drop index ix_car_accessory_fuse_id on car_accessory; + +alter table car_accessory drop foreign key fk_car_accessory_car_id; +drop index ix_car_accessory_car_id on car_accessory; + +alter table category drop foreign key fk_category_surveyobjectid; +drop index ix_category_surveyobjectid on category; + +alter table e_save_test_d drop foreign key fk_e_save_test_d_parent_id; + +alter table child_person drop foreign key fk_child_person_some_bean_id; +drop index ix_child_person_some_bean_id on child_person; + +alter table child_person drop foreign key fk_child_person_parent_identifier; +drop index ix_child_person_parent_identifier on child_person; + +alter table cke_client drop foreign key fk_cke_client_user; +drop index ix_cke_client_user on cke_client; + +alter table class_super_monkey drop foreign key fk_class_super_monkey_class_super; + +alter table class_super_monkey drop foreign key fk_class_super_monkey_monkey; + +alter table configuration drop foreign key fk_configuration_configurations_id; +drop index ix_configuration_configurations_id on configuration; + +alter table contact drop foreign key fk_contact_customer_id; +drop index ix_contact_customer_id on contact; + +alter table contact drop foreign key fk_contact_group_id; +drop index ix_contact_group_id on contact; + +alter table contact_note drop foreign key fk_contact_note_contact_id; +drop index ix_contact_note_contact_id on contact_note; + +alter table contract_costs drop foreign key fk_contract_costs_position_id; +drop index ix_contract_costs_position_id on contract_costs; + +alter table c_conversation drop foreign key fk_c_conversation_group_id; +drop index ix_c_conversation_group_id on c_conversation; + +alter table o_customer drop foreign key fk_o_customer_billing_address_id; +drop index ix_o_customer_billing_address_id on o_customer; + +alter table o_customer drop foreign key fk_o_customer_shipping_address_id; +drop index ix_o_customer_shipping_address_id on o_customer; + +alter table dcredit_drol drop foreign key fk_dcredit_drol_dcredit; +drop index ix_dcredit_drol_dcredit on dcredit_drol; + +alter table dcredit_drol drop foreign key fk_dcredit_drol_drol; +drop index ix_dcredit_drol_drol on dcredit_drol; + +alter table dmachine drop foreign key fk_dmachine_organisation_id; +drop index ix_dmachine_organisation_id on dmachine; + +alter table d_machine_aux_use drop foreign key fk_d_machine_aux_use_machine_id; +drop index ix_d_machine_aux_use_machine_id on d_machine_aux_use; + +alter table d_machine_stats drop foreign key fk_d_machine_stats_machine_id; +drop index ix_d_machine_stats_machine_id on d_machine_stats; + +alter table d_machine_use drop foreign key fk_d_machine_use_machine_id; +drop index ix_d_machine_use_machine_id on d_machine_use; + +alter table drot_drol drop foreign key fk_drot_drol_drot; +drop index ix_drot_drol_drot on drot_drol; + +alter table drot_drol drop foreign key fk_drot_drol_drol; +drop index ix_drot_drol_drol on drot_drol; + +alter table dc_detail drop foreign key fk_dc_detail_master_id; +drop index ix_dc_detail_master_id on dc_detail; + +alter table defaults_model drop foreign key fk_defaults_model_id; + +alter table dfk_cascade drop foreign key fk_dfk_cascade_one_id; +drop index ix_dfk_cascade_one_id on dfk_cascade; + +alter table dfk_set_null drop foreign key fk_dfk_set_null_one_id; +drop index ix_dfk_set_null_one_id on dfk_set_null; + +alter table doc drop foreign key fk_doc_id; + +alter table doc_link drop foreign key fk_doc_link_doc; +drop index ix_doc_link_doc on doc_link; + +alter table doc_link drop foreign key fk_doc_link_link; +drop index ix_doc_link_link on doc_link; + +alter table document drop foreign key fk_document_id; + +alter table document drop foreign key fk_document_organisation_id; +drop index ix_document_organisation_id on document; + +alter table document_draft drop foreign key fk_document_draft_organisation_id; +drop index ix_document_draft_organisation_id on document_draft; + +alter table document_media drop foreign key fk_document_media_document_id; +drop index ix_document_media_document_id on document_media; + +alter table document_media_draft drop foreign key fk_document_media_draft_document_id; +drop index ix_document_media_draft_document_id on document_media_draft; + +alter table e_basicenc_relate drop foreign key fk_e_basicenc_relate_other_id; +drop index ix_e_basicenc_relate_other_id on e_basicenc_relate; + +alter table ebasic_json_map_detail drop foreign key fk_ebasic_json_map_detail_owner_id; +drop index ix_ebasic_json_map_detail_owner_id on ebasic_json_map_detail; + +alter table ebasic_no_sdchild drop foreign key fk_ebasic_no_sdchild_owner_id; +drop index ix_ebasic_no_sdchild_owner_id on ebasic_no_sdchild; + +alter table ebasic_sdchild drop foreign key fk_ebasic_sdchild_owner_id; +drop index ix_ebasic_sdchild_owner_id on ebasic_sdchild; + +alter table ecache_child drop foreign key fk_ecache_child_root_id; +drop index ix_ecache_child_root_id on ecache_child; + +alter table edefault_prop drop foreign key fk_edefault_prop_e_simple_usertypeid; + +alter table eemb_inner drop foreign key fk_eemb_inner_outer_id; +drop index ix_eemb_inner_outer_id on eemb_inner; + +alter table einvoice drop foreign key fk_einvoice_person_id; +drop index ix_einvoice_person_id on einvoice; + +alter table enull_collection_detail drop foreign key fk_enull_collection_detail_enull_collection_id; +drop index ix_enull_collection_detail_enull_collection_id on enull_collection_detail; + +alter table eopt_one_a drop foreign key fk_eopt_one_a_b_id; +drop index ix_eopt_one_a_b_id on eopt_one_a; + +alter table eopt_one_b drop foreign key fk_eopt_one_b_c_id; +drop index ix_eopt_one_b_c_id on eopt_one_b; + +alter table eper_addr drop foreign key fk_eper_addr_ma_country_code; +drop index ix_eper_addr_ma_country_code on eper_addr; + +alter table esoft_del_book drop foreign key fk_esoft_del_book_lend_by_id; +drop index ix_esoft_del_book_lend_by_id on esoft_del_book; + +alter table esoft_del_book_esoft_del_user drop foreign key fk_esoft_del_book_esoft_del_user_esoft_del_book; +drop index ix_esoft_del_book_esoft_del_user_esoft_del_book on esoft_del_book_esoft_del_user; + +alter table esoft_del_book_esoft_del_user drop foreign key fk_esoft_del_book_esoft_del_user_esoft_del_user; +drop index ix_esoft_del_book_esoft_del_user_esoft_del_user on esoft_del_book_esoft_del_user; + +alter table esoft_del_down drop foreign key fk_esoft_del_down_esoft_del_mid_id; +drop index ix_esoft_del_down_esoft_del_mid_id on esoft_del_down; + +alter table esoft_del_mid drop foreign key fk_esoft_del_mid_top_id; +drop index ix_esoft_del_mid_top_id on esoft_del_mid; + +alter table esoft_del_mid drop foreign key fk_esoft_del_mid_up_id; +drop index ix_esoft_del_mid_up_id on esoft_del_mid; + +alter table esoft_del_one_a drop foreign key fk_esoft_del_one_a_oneb_id; + +alter table esoft_del_role_esoft_del_user drop foreign key fk_esoft_del_role_esoft_del_user_esoft_del_role; +drop index ix_esoft_del_role_esoft_del_user_esoft_del_role on esoft_del_role_esoft_del_user; + +alter table esoft_del_role_esoft_del_user drop foreign key fk_esoft_del_role_esoft_del_user_esoft_del_user; +drop index ix_esoft_del_role_esoft_del_user_esoft_del_user on esoft_del_role_esoft_del_user; + +alter table esoft_del_user_esoft_del_role drop foreign key fk_esoft_del_user_esoft_del_role_esoft_del_user; +drop index ix_esoft_del_user_esoft_del_role_esoft_del_user on esoft_del_user_esoft_del_role; + +alter table esoft_del_user_esoft_del_role drop foreign key fk_esoft_del_user_esoft_del_role_esoft_del_role; +drop index ix_esoft_del_user_esoft_del_role_esoft_del_role on esoft_del_user_esoft_del_role; + +alter table rawinherit_uncle drop foreign key fk_rawinherit_uncle_parent_id; +drop index ix_rawinherit_uncle_parent_id on rawinherit_uncle; + +alter table evanilla_collection_detail drop foreign key fk_evanilla_collection_detail_evanilla_collection_id; +drop index ix_evanilla_collection_detail_evanilla_collection_id on evanilla_collection_detail; + +alter table ec_enum_person_tags drop foreign key fk_ec_enum_person_tags_ec_enum_person_id; +drop index ix_ec_enum_person_tags_ec_enum_person_id on ec_enum_person_tags; + +alter table ec_person_phone drop foreign key fk_ec_person_phone_owner_id; +drop index ix_ec_person_phone_owner_id on ec_person_phone; + +alter table ec_top drop foreign key fk_ec_top_person_id; +drop index ix_ec_top_person_id on ec_top; + +alter table ec_top_ecs_person drop foreign key fk_ec_top_ecs_person_ec_top; +drop index ix_ec_top_ecs_person_ec_top on ec_top_ecs_person; + +alter table ec_top_ecs_person drop foreign key fk_ec_top_ecs_person_ecs_person; +drop index ix_ec_top_ecs_person_ecs_person on ec_top_ecs_person; + +alter table ecbl_person_phone_numbers drop foreign key fk_ecbl_person_phone_numbers_person_id; +drop index ix_ecbl_person_phone_numbers_person_id on ecbl_person_phone_numbers; + +alter table ecbm_person_phone_numbers drop foreign key fk_ecbm_person_phone_numbers_person_id; +drop index ix_ecbm_person_phone_numbers_person_id on ecbm_person_phone_numbers; + +alter table ecm_person_phone_numbers drop foreign key fk_ecm_person_phone_numbers_ecm_person_id; +drop index ix_ecm_person_phone_numbers_ecm_person_id on ecm_person_phone_numbers; + +alter table ecmc_person_phone_numbers drop foreign key fk_ecmc_person_phone_numbers_ecmc_person_id; +drop index ix_ecmc_person_phone_numbers_ecmc_person_id on ecmc_person_phone_numbers; + +alter table ecs_person_phone drop foreign key fk_ecs_person_phone_ecs_person_id; +drop index ix_ecs_person_phone_ecs_person_id on ecs_person_phone; + +alter table ecsm_child drop foreign key fk_ecsm_child_ecsm_parent_id; +drop index ix_ecsm_child_ecsm_parent_id on ecsm_child; + +alter table td_child drop foreign key fk_td_child_parent_id; +drop index ix_td_child_parent_id on td_child; + +alter table element_bean drop foreign key fk_element_bean_complex_bean_id; +drop index ix_element_bean_complex_bean_id on element_bean; + +alter table empl drop foreign key fk_empl_default_address_id; +drop index ix_empl_default_address_id on empl; + +alter table esd_detail drop foreign key fk_esd_detail_master_id; +drop index ix_esd_detail_master_id on esd_detail; + +alter table grand_parent_person drop foreign key fk_grand_parent_person_some_bean_id; +drop index ix_grand_parent_person_some_bean_id on grand_parent_person; + +alter table survey_group drop foreign key fk_survey_group_categoryobjectid; +drop index ix_survey_group_categoryobjectid on survey_group; + +alter table hx_link_doc drop foreign key fk_hx_link_doc_hx_link; +drop index ix_hx_link_doc_hx_link on hx_link_doc; + +alter table hx_link_doc drop foreign key fk_hx_link_doc_he_doc; +drop index ix_hx_link_doc_he_doc on hx_link_doc; + +alter table hi_link_doc drop foreign key fk_hi_link_doc_hi_link; +drop index ix_hi_link_doc_hi_link on hi_link_doc; + +alter table hi_link_doc drop foreign key fk_hi_link_doc_hi_doc; +drop index ix_hi_link_doc_hi_doc on hi_link_doc; + +alter table hi_tthree drop foreign key fk_hi_tthree_hi_ttwo_id; +drop index ix_hi_tthree_hi_ttwo_id on hi_tthree; + +alter table hi_ttwo drop foreign key fk_hi_ttwo_hi_tone_id; +drop index ix_hi_ttwo_hi_tone_id on hi_ttwo; + +alter table hsd_setting drop foreign key fk_hsd_setting_user_id; + +alter table iaf_segment drop foreign key fk_iaf_segment_status_id; +drop index ix_iaf_segment_status_id on iaf_segment; + +alter table imrelated drop foreign key fk_imrelated_owner_id; +drop index ix_imrelated_owner_id on imrelated; + +alter table info_contact drop foreign key fk_info_contact_company_id; +drop index ix_info_contact_company_id on info_contact; + +alter table info_customer drop foreign key fk_info_customer_company_id; + +alter table inner_report drop foreign key fk_inner_report_forecast_id; + +alter table drel_invoice drop foreign key fk_drel_invoice_booking; +drop index ix_drel_invoice_booking on drel_invoice; + +alter table item drop foreign key fk_item_etype; +drop index ix_item_etype on item; + +alter table item drop foreign key fk_item_eregion; +drop index ix_item_eregion on item; + +alter table mkeygroup_monkey drop foreign key fk_mkeygroup_monkey_mkeygroup; + +alter table mkeygroup_monkey drop foreign key fk_mkeygroup_monkey_monkey; + +alter table trainer_monkey drop foreign key fk_trainer_monkey_trainer; + +alter table trainer_monkey drop foreign key fk_trainer_monkey_monkey; + +alter table troop_monkey drop foreign key fk_troop_monkey_troop; + +alter table troop_monkey drop foreign key fk_troop_monkey_monkey; + +alter table l2_cldf_reset_bean_child drop foreign key fk_l2_cldf_reset_bean_child_parent_id; +drop index ix_l2_cldf_reset_bean_child_parent_id on l2_cldf_reset_bean_child; + +alter table level1_level4 drop foreign key fk_level1_level4_level1; +drop index ix_level1_level4_level1 on level1_level4; + +alter table level1_level4 drop foreign key fk_level1_level4_level4; +drop index ix_level1_level4_level4 on level1_level4; + +alter table level1_level2 drop foreign key fk_level1_level2_level1; +drop index ix_level1_level2_level1 on level1_level2; + +alter table level1_level2 drop foreign key fk_level1_level2_level2; +drop index ix_level1_level2_level2 on level1_level2; + +alter table level2_level3 drop foreign key fk_level2_level3_level2; +drop index ix_level2_level3_level2 on level2_level3; + +alter table level2_level3 drop foreign key fk_level2_level3_level3; +drop index ix_level2_level3_level3 on level2_level3; + +alter table link drop foreign key fk_link_id; + +alter table la_attr_value_attribute drop foreign key fk_la_attr_value_attribute_la_attr_value; +drop index ix_la_attr_value_attribute_la_attr_value on la_attr_value_attribute; + +alter table la_attr_value_attribute drop foreign key fk_la_attr_value_attribute_attribute; +drop index ix_la_attr_value_attribute_attribute on la_attr_value_attribute; + +alter table looney drop foreign key fk_looney_tune_id; +drop index ix_looney_tune_id on looney; + +alter table mcontact drop foreign key fk_mcontact_customer_id; +drop index ix_mcontact_customer_id on mcontact; + +alter table mcontact_message drop foreign key fk_mcontact_message_contact_id; +drop index ix_mcontact_message_contact_id on mcontact_message; + +alter table mcustomer drop foreign key fk_mcustomer_shipping_address_id; +drop index ix_mcustomer_shipping_address_id on mcustomer; + +alter table mcustomer drop foreign key fk_mcustomer_billing_address_id; +drop index ix_mcustomer_billing_address_id on mcustomer; + +alter table mmachine_mgroup drop foreign key fk_mmachine_mgroup_mmachine; +drop index ix_mmachine_mgroup_mmachine on mmachine_mgroup; + +alter table mmachine_mgroup drop foreign key fk_mmachine_mgroup_mgroup; +drop index ix_mmachine_mgroup_mgroup on mmachine_mgroup; + +alter table mprinter drop foreign key fk_mprinter_current_state_id; +drop index ix_mprinter_current_state_id on mprinter; + +alter table mprinter drop foreign key fk_mprinter_last_swap_cyan_id; + +alter table mprinter drop foreign key fk_mprinter_last_swap_magenta_id; + +alter table mprinter drop foreign key fk_mprinter_last_swap_yellow_id; + +alter table mprinter drop foreign key fk_mprinter_last_swap_black_id; + +alter table mprinter_state drop foreign key fk_mprinter_state_printer_id; +drop index ix_mprinter_state_printer_id on mprinter_state; + +alter table mprofile drop foreign key fk_mprofile_picture_id; +drop index ix_mprofile_picture_id on mprofile; + +alter table mrole_muser drop foreign key fk_mrole_muser_mrole; +drop index ix_mrole_muser_mrole on mrole_muser; + +alter table mrole_muser drop foreign key fk_mrole_muser_muser; +drop index ix_mrole_muser_muser on mrole_muser; + +alter table muser drop foreign key fk_muser_user_type_id; +drop index ix_muser_user_type_id on muser; + +alter table mail_user_inbox drop foreign key fk_mail_user_inbox_mail_user; +drop index ix_mail_user_inbox_mail_user on mail_user_inbox; + +alter table mail_user_inbox drop foreign key fk_mail_user_inbox_mail_box; +drop index ix_mail_user_inbox_mail_box on mail_user_inbox; + +alter table mail_user_outbox drop foreign key fk_mail_user_outbox_mail_user; +drop index ix_mail_user_outbox_mail_user on mail_user_outbox; + +alter table mail_user_outbox drop foreign key fk_mail_user_outbox_mail_box; +drop index ix_mail_user_outbox_mail_box on mail_user_outbox; + +alter table c_message drop foreign key fk_c_message_conversation_id; +drop index ix_c_message_conversation_id on c_message; + +alter table c_message drop foreign key fk_c_message_user_id; +drop index ix_c_message_user_id on c_message; + +alter table meter_contract_data drop foreign key fk_meter_contract_data_special_needs_client_id; + +alter table meter_special_needs_client drop foreign key fk_meter_special_needs_client_primary_id; + +alter table meter_version drop foreign key fk_meter_version_address_data_id; + +alter table meter_version drop foreign key fk_meter_version_contract_data_id; + +alter table mnoc_user_mnoc_role drop foreign key fk_mnoc_user_mnoc_role_mnoc_user; +drop index ix_mnoc_user_mnoc_role_mnoc_user on mnoc_user_mnoc_role; + +alter table mnoc_user_mnoc_role drop foreign key fk_mnoc_user_mnoc_role_mnoc_role; +drop index ix_mnoc_user_mnoc_role_mnoc_role on mnoc_user_mnoc_role; + +alter table mny_b drop foreign key fk_mny_b_a_id; +drop index ix_mny_b_a_id on mny_b; + +alter table mny_b_mny_c drop foreign key fk_mny_b_mny_c_mny_b; +drop index ix_mny_b_mny_c_mny_b on mny_b_mny_c; + +alter table mny_b_mny_c drop foreign key fk_mny_b_mny_c_mny_c; +drop index ix_mny_b_mny_c_mny_c on mny_b_mny_c; + +alter table subtopics drop foreign key fk_subtopics_mny_topic_1; +drop index ix_subtopics_mny_topic_1 on subtopics; + +alter table subtopics drop foreign key fk_subtopics_mny_topic_2; +drop index ix_subtopics_mny_topic_2 on subtopics; + +alter table mp_role drop foreign key fk_mp_role_mp_user_id; +drop index ix_mp_role_mp_user_id on mp_role; + +alter table ms_many_a_many_b drop foreign key fk_ms_many_a_many_b_ms_many_a; +drop index ix_ms_many_a_many_b_ms_many_a on ms_many_a_many_b; + +alter table ms_many_a_many_b drop foreign key fk_ms_many_a_many_b_ms_many_b; +drop index ix_ms_many_a_many_b_ms_many_b on ms_many_a_many_b; + +alter table ms_many_b_many_a drop foreign key fk_ms_many_b_many_a_ms_many_b; +drop index ix_ms_many_b_many_a_ms_many_b on ms_many_b_many_a; + +alter table ms_many_b_many_a drop foreign key fk_ms_many_b_many_a_ms_many_a; +drop index ix_ms_many_b_many_a_ms_many_a on ms_many_b_many_a; + +alter table my_lob_size_join_many drop foreign key fk_my_lob_size_join_many_parent_id; +drop index ix_my_lob_size_join_many_parent_id on my_lob_size_join_many; + +alter table o_bean_child drop foreign key fk_o_bean_child_cached_bean_id; +drop index ix_o_bean_child_cached_bean_id on o_bean_child; + +alter table ocached_app_detail drop foreign key fk_ocached_app_detail_app_id; +drop index ix_ocached_app_detail_app_id on ocached_app_detail; + +alter table o_cached_bean_country drop foreign key fk_o_cached_bean_country_o_cached_bean; +drop index ix_o_cached_bean_country_o_cached_bean on o_cached_bean_country; + +alter table o_cached_bean_country drop foreign key fk_o_cached_bean_country_o_country; +drop index ix_o_cached_bean_country_o_country on o_cached_bean_country; + +alter table o_cached_bean_child drop foreign key fk_o_cached_bean_child_cached_bean_id; +drop index ix_o_cached_bean_child_cached_bean_id on o_cached_bean_child; + +alter table oengine drop foreign key fk_oengine_car_id; + +alter table ogear_box drop foreign key fk_ogear_box_car_id; + +alter table omvertex_other drop foreign key fk_omvertex_other_omvertex_id; +drop index ix_omvertex_other_omvertex_id on omvertex_other; + +alter table oroad_show_msg drop foreign key fk_oroad_show_msg_company_id; + +alter table om_account_child_dbo drop foreign key fk_om_account_child_dbo_banana_rama_id; +drop index ix_om_account_child_dbo_banana_rama_id on om_account_child_dbo; + +alter table om_basic_child drop foreign key fk_om_basic_child_parent_id; +drop index ix_om_basic_child_parent_id on om_basic_child; + +alter table om_ordered_detail drop foreign key fk_om_ordered_detail_master_id; +drop index ix_om_ordered_detail_master_id on om_ordered_detail; + +alter table o_order drop foreign key fk_o_order_kcustomer_id; +drop index ix_o_order_kcustomer_id on o_order; + +alter table o_order_detail drop foreign key fk_o_order_detail_order_id; +drop index ix_o_order_detail_order_id on o_order_detail; + +alter table o_order_detail drop foreign key fk_o_order_detail_product_id; +drop index ix_o_order_detail_product_id on o_order_detail; + +alter table s_order_items drop foreign key fk_s_order_items_order_uuid; +drop index ix_s_order_items_order_uuid on s_order_items; + +alter table order_referenced_parent drop foreign key fk_order_referenced_parent_master_id; +drop index ix_order_referenced_parent_master_id on order_referenced_parent; + +alter table or_order_ship drop foreign key fk_or_order_ship_order_id; +drop index ix_or_order_ship_order_id on or_order_ship; + +alter table order_toy drop foreign key fk_order_toy_child_id; +drop index ix_order_toy_child_id on order_toy; + +alter table ordered_parent drop foreign key fk_ordered_parent_order_master_inheritance_id; +drop index ix_ordered_parent_order_master_inheritance_id on ordered_parent; + +alter table organization_node drop foreign key fk_organization_node_parent_tree_node_id; + +alter table orp_detail drop foreign key fk_orp_detail_master_id; +drop index ix_orp_detail_master_id on orp_detail; + +alter table orp_detail2 drop foreign key fk_orp_detail2_orp_master2_id; +drop index ix_orp_detail2_orp_master2_id on orp_detail2; + +alter table oto_atwo drop foreign key fk_oto_atwo_aone_id; + +alter table oto_bchild drop foreign key fk_oto_bchild_master_id; + +alter table oto_child drop foreign key fk_oto_child_master_id; + +alter table oto_cust_address drop foreign key fk_oto_cust_address_customer_cid; + +alter table oto_level_a drop foreign key fk_oto_level_a_b_id; + +alter table oto_level_b drop foreign key fk_oto_level_b_c_id; + +alter table oto_prime_extra drop foreign key fk_oto_prime_extra_eid; + +alter table oto_sd_child drop foreign key fk_oto_sd_child_master_id; + +alter table oto_th_many drop foreign key fk_oto_th_many_oto_th_top_id; +drop index ix_oto_th_many_oto_th_top_id on oto_th_many; + +alter table oto_th_one drop foreign key fk_oto_th_one_many_id; + +alter table oto_ubprime_extra drop foreign key fk_oto_ubprime_extra_eid; + +alter table oto_user_model drop foreign key fk_oto_user_model_user_optional_id; + +alter table pfile drop foreign key fk_pfile_file_content_id; + +alter table pfile drop foreign key fk_pfile_file_content2_id; + +alter table paggview drop foreign key fk_paggview_pview_id; + +alter table pallet_location drop foreign key fk_pallet_location_zone_sid; +drop index ix_pallet_location_zone_sid on pallet_location; + +alter table parcel_location drop foreign key fk_parcel_location_parcelid; + +alter table rawinherit_parent_rawinherit_data drop foreign key fk_rawinherit_parent_rawinherit_data_rawinherit_parent; +drop index ix_rawinherit_parent_rawinherit_data_rawinherit_parent on rawinherit_parent_rawinherit_data; + +alter table rawinherit_parent_rawinherit_data drop foreign key fk_rawinherit_parent_rawinherit_data_rawinherit_data; +drop index ix_rawinherit_parent_rawinherit_data_rawinherit_data on rawinherit_parent_rawinherit_data; + +alter table parent_person drop foreign key fk_parent_person_some_bean_id; +drop index ix_parent_person_some_bean_id on parent_person; + +alter table parent_person drop foreign key fk_parent_person_parent_identifier; +drop index ix_parent_person_parent_identifier on parent_person; + +alter table c_participation drop foreign key fk_c_participation_conversation_id; +drop index ix_c_participation_conversation_id on c_participation; + +alter table c_participation drop foreign key fk_c_participation_user_id; +drop index ix_c_participation_user_id on c_participation; + +alter table pcf_calendar drop foreign key fk_pcf_calendar_pcf_person_id; +drop index ix_pcf_calendar_pcf_person_id on pcf_calendar; + +alter table pcf_city drop foreign key fk_pcf_city_pcf_country_id; +drop index ix_pcf_city_pcf_country_id on pcf_city; + +alter table pcf_city drop foreign key fk_pcf_city_mayor_id; + +alter table pcf_city drop foreign key fk_pcf_city_vice_mayor_id; + +alter table pcf_event drop foreign key fk_pcf_event_pcf_calendar_id; +drop index ix_pcf_event_pcf_calendar_id on pcf_event; + +alter table persistent_file_content drop foreign key fk_persistent_file_content_persistent_file_id; + +alter table person drop foreign key fk_person_default_address_oid; +drop index ix_person_default_address_oid on person; + +alter table person_cache_email drop foreign key fk_person_cache_email_person_info_person_id; +drop index ix_person_cache_email_person_info_person_id on person_cache_email; + +alter table phones drop foreign key fk_phones_person_id; +drop index ix_phones_person_id on phones; + +alter table e_position drop foreign key fk_e_position_contract_id; +drop index ix_e_position_contract_id on e_position; + +alter table pp_to_ww drop foreign key fk_pp_to_ww_pp; +drop index ix_pp_to_ww_pp on pp_to_ww; + +alter table pp_to_ww drop foreign key fk_pp_to_ww_wview; +drop index ix_pp_to_ww_wview on pp_to_ww; + +alter table question drop foreign key fk_question_groupobjectid; +drop index ix_question_groupobjectid on question; + +alter table r_orders drop foreign key fk_r_orders_customer; +drop index ix_r_orders_customer on r_orders; + +alter table referenced_defaults_model drop foreign key fk_referenced_defaults_model_id; + +alter table referenced_defaults_model drop foreign key fk_referenced_defaults_model_defaults_model_id; +drop index ix_referenced_defaults_model_defaults_model_id on referenced_defaults_model; + +alter table referenced_defaults_model_draft drop foreign key fk_referenced_defaults_model_draft_defaults_model_id; +drop index ix_referenced_defaults_model_draft_defaults_model_id on referenced_defaults_model_draft; + +alter table rel_master drop foreign key fk_rel_master_detail_id; +drop index ix_rel_master_detail_id on rel_master; + +alter table resourcefile drop foreign key fk_resourcefile_parentresourcefileid; +drop index ix_resourcefile_parentresourcefileid on resourcefile; + +alter table mt_role drop foreign key fk_mt_role_tenant_id; +drop index ix_mt_role_tenant_id on mt_role; + +alter table mt_role_permission drop foreign key fk_mt_role_permission_mt_role; +drop index ix_mt_role_permission_mt_role on mt_role_permission; + +alter table mt_role_permission drop foreign key fk_mt_role_permission_mt_permission; +drop index ix_mt_role_permission_mt_permission on mt_role_permission; + +alter table root_bean drop foreign key fk_root_bean_referencing_bean_id; +drop index ix_root_bean_referencing_bean_id on root_bean; + +alter table f_second drop foreign key fk_f_second_first; + +alter table section drop foreign key fk_section_article_id; +drop index ix_section_article_id on section; + +alter table self_parent drop foreign key fk_self_parent_parent_id; +drop index ix_self_parent_parent_id on self_parent; + +alter table self_ref_customer drop foreign key fk_self_ref_customer_referred_by_id; +drop index ix_self_ref_customer_referred_by_id on self_ref_customer; + +alter table self_ref_example drop foreign key fk_self_ref_example_parent_id; +drop index ix_self_ref_example_parent_id on self_ref_example; + +alter table e_save_test_b drop foreign key fk_e_save_test_b_sibling_a_id; + +alter table site drop foreign key fk_site_parent_id; +drop index ix_site_parent_id on site; + +alter table site drop foreign key fk_site_data_container_id; + +alter table site drop foreign key fk_site_site_address_id; + +alter table source_base drop foreign key fk_source_base_target_id; +drop index ix_source_base_target_id on source_base; + +alter table stockforecast drop foreign key fk_stockforecast_inner_report_id; +drop index ix_stockforecast_inner_report_id on stockforecast; + +alter table sub_section drop foreign key fk_sub_section_section_id; +drop index ix_sub_section_section_id on sub_section; + +alter table tevent_many drop foreign key fk_tevent_many_event_id; +drop index ix_tevent_many_event_id on tevent_many; + +alter table tevent_one drop foreign key fk_tevent_one_event_id; + +alter table t_detail_with_other_namexxxyy drop foreign key fk_t_detail_with_other_namexxxyy_master_id; +drop index ix_t_detail_with_other_namexxxyy_master_id on t_detail_with_other_namexxxyy; + +alter table ttruck_holder drop foreign key fk_ttruck_holder_truck_plate_no; +drop index ix_ttruck_holder_truck_plate_no on ttruck_holder; + +alter table ttruck_holder drop foreign key fk_ttruck_holder_basic_id; +drop index ix_ttruck_holder_basic_id on ttruck_holder; + +alter table ttruck_holder_item drop foreign key fk_ttruck_holder_item_owner_id; +drop index ix_ttruck_holder_item_owner_id on ttruck_holder_item; + +alter table twheel drop foreign key fk_twheel_owner_plate_no; +drop index ix_twheel_owner_plate_no on twheel; + +alter table tire drop foreign key fk_tire_wheel; + +alter table tree_entity drop foreign key fk_tree_entity_parent_id; +drop index ix_tree_entity_parent_id on tree_entity; + +alter table trip drop foreign key fk_trip_vehicle_driver_id; +drop index ix_trip_vehicle_driver_id on trip; + +alter table trip drop foreign key fk_trip_address_id; +drop index ix_trip_address_id on trip; + +alter table `type` drop foreign key fk_type_sub_type_id; +drop index ix_type_sub_type_id on `type`; + +alter table usib_child drop foreign key fk_usib_child_parent_id; +drop index ix_usib_child_parent_id on usib_child; + +alter table usib_child_sibling drop foreign key fk_usib_child_sibling_child_id; + +alter table ut_detail drop foreign key fk_ut_detail_utmaster_id; +drop index ix_ut_detail_utmaster_id on ut_detail; + +alter table uutwo drop foreign key fk_uutwo_master_id; +drop index ix_uutwo_master_id on uutwo; + +alter table oto_user drop foreign key fk_oto_user_account_id; + +alter table c_user drop foreign key fk_c_user_group_id; +drop index ix_c_user_group_id on c_user; + +alter table em_user_role drop foreign key fk_em_user_role_user_id; +drop index ix_em_user_role_user_id on em_user_role; + +alter table em_user_role drop foreign key fk_em_user_role_role_id; +drop index ix_em_user_role_role_id on em_user_role; + +alter table vehicle drop foreign key fk_vehicle_lease_id; +drop index ix_vehicle_lease_id on vehicle; + +alter table vehicle drop foreign key fk_vehicle_car_ref_id; +drop index ix_vehicle_car_ref_id on vehicle; + +alter table vehicle drop foreign key fk_vehicle_truck_ref_id; +drop index ix_vehicle_truck_ref_id on vehicle; + +alter table vehicle_driver drop foreign key fk_vehicle_driver_vehicle_id; +drop index ix_vehicle_driver_vehicle_id on vehicle_driver; + +alter table vehicle_driver drop foreign key fk_vehicle_driver_address_id; +drop index ix_vehicle_driver_address_id on vehicle_driver; + +alter table version_child drop foreign key fk_version_child_parent_id; +drop index ix_version_child_parent_id on version_child; + +alter table version_toy drop foreign key fk_version_toy_child_id; +drop index ix_version_toy_child_id on version_toy; + +alter table warehouses drop foreign key fk_warehouses_officezoneid; +drop index ix_warehouses_officezoneid on warehouses; + +alter table warehousesshippingzones drop foreign key fk_warehousesshippingzones_warehouses; +drop index ix_warehousesshippingzones_warehouses on warehousesshippingzones; + +alter table warehousesshippingzones drop foreign key fk_warehousesshippingzones_zones; +drop index ix_warehousesshippingzones_zones on warehousesshippingzones; + +alter table sa_wheel drop foreign key fk_sa_wheel_tire; +drop index ix_sa_wheel_tire on sa_wheel; + +alter table sa_wheel drop foreign key fk_sa_wheel_car; +drop index ix_sa_wheel_car on sa_wheel; + +alter table g_who_props_otm drop foreign key fk_g_who_props_otm_who_created_id; +drop index ix_g_who_props_otm_who_created_id on g_who_props_otm; + +alter table g_who_props_otm drop foreign key fk_g_who_props_otm_who_modified_id; +drop index ix_g_who_props_otm_who_modified_id on g_who_props_otm; + +alter table with_zero drop foreign key fk_with_zero_parent_id; +drop index ix_with_zero_parent_id on with_zero; + +drop table if exists asimple_bean; + +drop table if exists bar; + +drop table if exists block; + +drop table if exists oto_account; + +drop table if exists acl; + +drop table if exists acl_container_relation; + +drop table if exists addr; + +drop table if exists address; + +drop table if exists o_address; + +drop table if exists album; + +drop table if exists animal; + +drop table if exists animal_shelter; + +drop table if exists article; + +drop table if exists attribute; + +drop table if exists attribute_holder; + +drop table if exists audit_log; + +drop table if exists bbookmark; + +drop table if exists bbookmark_org; + +drop table if exists bbookmark_user; + +drop table if exists bsimple_with_gen; + +drop table if exists bsite; + +drop table if exists bsite_user_a; + +drop table if exists bsite_user_b; + +drop table if exists bsite_user_c; + +drop table if exists bsite_user_d; + +drop table if exists bsite_user_e; + +drop table if exists buser; + +drop table if exists bwith_qident; + +drop table if exists basic_draftable_bean; + +drop table if exists basic_draftable_bean_draft; + +drop table if exists basic_joda_entity; + +drop table if exists bean_with_time_zone; + +drop table if exists drel_booking; + +drop table if exists bw_bean; + +drop table if exists cepcategory; + +drop table if exists cepproduct; + +drop table if exists cepproduct_category; + +drop table if exists ciaddress; + +drop table if exists cicustomer_parent; + +drop table if exists cistreet_parent; + +drop table if exists cinh_ref; + +drop table if exists cinh_root; + +drop table if exists ckey_assoc; + +drop table if exists ckey_detail; + +drop table if exists ckey_parent; + +drop table if exists coone; + +drop table if exists coone_many; + +drop table if exists coroot; + +drop table if exists calculation_result; + +drop table if exists cao_bean; + +drop table if exists sp_car_car; + +drop table if exists sp_car_car_wheels; + +drop table if exists sp_car_car_doors; + +drop table if exists sa_car; + +drop table if exists car_accessory; + +drop table if exists car_fuse; + +drop table if exists category; + +drop table if exists e_save_test_d; + +drop table if exists child_person; + +drop table if exists cke_client; + +drop table if exists cke_user; + +drop table if exists class_super; + +drop table if exists class_super_monkey; + +drop table if exists configuration; + +drop table if exists configurations; + +drop table if exists contact; + +drop table if exists contact_group; + +drop table if exists contact_note; + +drop table if exists contract; + +drop table if exists contract_costs; + +drop table if exists c_conversation; + +drop table if exists o_country; + +drop table if exists cover; + +drop table if exists o_customer; + +drop table if exists dcredit; + +drop table if exists dcredit_drol; + +drop table if exists dexh_entity; + +drop table if exists dint_parent; + +drop table if exists dmachine; + +drop table if exists d_machine_aux_use; + +drop table if exists d_machine_stats; + +drop table if exists d_machine_use; + +drop table if exists dorg; + +drop table if exists dperson; + +drop table if exists drol; + +drop table if exists drot; + +drop table if exists drot_drol; + +drop table if exists rawinherit_data; + +drop table if exists data_container; + +drop table if exists dc_detail; + +drop table if exists dc_master; + +drop table if exists defaults_model; + +drop table if exists defaults_model_draft; + +drop table if exists dfk_cascade; + +drop table if exists dfk_cascade_one; + +drop table if exists dfk_none; + +drop table if exists dfk_none_via_join; + +drop table if exists dfk_none_via_mto_m; + +drop table if exists dfk_none_via_mto_m_dfk_one; + +drop table if exists dfk_one; + +drop table if exists dfk_set_null; + +drop table if exists doc; + +drop table if exists doc_link; + +drop table if exists doc_link_draft; + +drop table if exists doc_draft; + +drop table if exists document; + +drop table if exists document_draft; + +drop table if exists document_media; + +drop table if exists document_media_draft; + +drop table if exists sp_car_door; + +drop table if exists earray_bean; + +drop table if exists earray_set_bean; + +drop table if exists e_basic; + +drop table if exists ebasic_change_log; + +drop table if exists ebasic_clob; + +drop table if exists ebasic_clob_fetch_eager; + +drop table if exists ebasic_clob_no_ver; + +drop table if exists e_basicenc; + +drop table if exists e_basicenc_bin; + +drop table if exists e_basicenc_client; + +drop table if exists e_basicenc_relate; + +drop table if exists e_basic_enum_id; + +drop table if exists e_basic_eni; + +drop table if exists ebasic_hstore; + +drop table if exists ebasic_json_jackson; + +drop table if exists ebasic_json_jackson2; + +drop table if exists ebasic_json_list; + +drop table if exists ebasic_json_map; + +drop table if exists ebasic_json_map_blob; + +drop table if exists ebasic_json_map_clob; + +drop table if exists ebasic_json_map_detail; + +drop table if exists ebasic_json_map_json_b; + +drop table if exists ebasic_json_map_varchar; + +drop table if exists ebasic_json_node; + +drop table if exists ebasic_json_node_blob; + +drop table if exists ebasic_json_node_json_b; + +drop table if exists ebasic_json_node_varchar; + +drop table if exists ebasic_json_unmapped; + +drop table if exists e_basic_ndc; + +drop table if exists ebasic_no_sdchild; + +drop table if exists ebasic_sdchild; + +drop table if exists ebasic_soft_delete; + +drop table if exists e_basicver; + +drop table if exists e_basic_withlife; + +drop table if exists e_basic_with_ex; + +drop table if exists e_basicverucon; + +drop table if exists ecache_child; + +drop table if exists ecache_root; + +drop table if exists e_col_ab; + +drop table if exists ecustom_id; + +drop table if exists edefault_prop; + +drop table if exists eemb_inner; + +drop table if exists eemb_outer; + +drop table if exists efile2_no_fk; + +drop table if exists efile_no_fk; + +drop table if exists efile_no_fk_euser_no_fk; + +drop table if exists efile_no_fk_euser_no_fk_soft_del; + +drop table if exists egen_props; + +drop table if exists eid_uid_bean; + +drop table if exists einvoice; + +drop table if exists e_main; + +drop table if exists enull_collection; + +drop table if exists enull_collection_detail; + +drop table if exists eopt_one_a; + +drop table if exists eopt_one_b; + +drop table if exists eopt_one_c; + +drop table if exists eper_addr; + +drop table if exists eperson; + +drop table if exists e_person_online; + +drop table if exists esimple; + +drop table if exists esoft_del_book; + +drop table if exists esoft_del_book_esoft_del_user; + +drop table if exists esoft_del_down; + +drop table if exists esoft_del_mid; + +drop table if exists esoft_del_one_a; + +drop table if exists esoft_del_one_b; + +drop table if exists esoft_del_role; + +drop table if exists esoft_del_role_esoft_del_user; + +drop table if exists esoft_del_top; + +drop table if exists esoft_del_up; + +drop table if exists esoft_del_user; + +drop table if exists esoft_del_user_esoft_del_role; + +drop table if exists esome_convert_type; + +drop table if exists esome_type; + +drop table if exists etrans_many; + +drop table if exists rawinherit_uncle; + +drop table if exists euser_no_fk; + +drop table if exists euser_no_fk_soft_del; + +drop table if exists evanilla_collection; + +drop table if exists evanilla_collection_detail; + +drop table if exists ewho_props; + +drop table if exists e_withinet; + +drop table if exists ec_enum_person; + +drop table if exists ec_enum_person_tags; + +drop table if exists ec_person; + +drop table if exists ec_person_phone; + +drop table if exists ec_top; + +drop table if exists ec_top_ecs_person; + +drop table if exists ecbl_person; + +drop table if exists ecbl_person_phone_numbers; + +drop table if exists ecbm_person; + +drop table if exists ecbm_person_phone_numbers; + +drop table if exists ecm_person; + +drop table if exists ecm_person_phone_numbers; + +drop table if exists ecmc_person; + +drop table if exists ecmc_person_phone_numbers; + +drop table if exists ecs_person; + +drop table if exists ecs_person_phone; + +drop table if exists ecsm_child; + +drop table if exists ecsm_values; + +drop table if exists ecsm_one; + +drop table if exists ecsm_parent; + +drop table if exists ecsm_two; + +drop table if exists td_child; + +drop table if exists td_parent; + +drop table if exists element_bean; + +drop table if exists empl; + +drop table if exists esd_detail; + +drop table if exists esd_master; + +drop table if exists feature_desc; + +drop table if exists f_first; + +drop table if exists foo; + +drop table if exists gen_key_identity; + +drop table if exists gen_key_sequence; + +drop table if exists grand_parent_person; + +drop table if exists survey_group; + +drop table if exists c_group; + +drop table if exists he_doc; + +alter table hx_link drop system versioning; +drop table if exists hx_link; + +drop table if exists hx_link_doc; + +drop table if exists hi_doc; + +alter table hi_link drop system versioning; +drop table if exists hi_link; + +alter table hi_link_doc drop system versioning; +drop table if exists hi_link_doc; + +alter table hi_tone drop system versioning; +drop table if exists hi_tone; + +alter table hi_tthree drop system versioning; +drop table if exists hi_tthree; + +alter table hi_ttwo drop system versioning; +drop table if exists hi_ttwo; + +alter table hsd_setting drop system versioning; +drop table if exists hsd_setting; + +alter table hsd_user drop system versioning; +drop table if exists hsd_user; + +drop table if exists iaf_segment; + +drop table if exists iaf_segment_status; + +drop table if exists imrelated; + +drop table if exists imroot; + +drop table if exists ixresource; + +drop table if exists info_company; + +drop table if exists info_contact; + +drop table if exists info_customer; + +drop table if exists inner_report; + +drop table if exists drel_invoice; + +drop table if exists item; + +drop table if exists monkey; + +drop table if exists mkeygroup; + +drop table if exists mkeygroup_monkey; + +drop table if exists trainer; + +drop table if exists trainer_monkey; + +drop table if exists troop; + +drop table if exists troop_monkey; + +drop table if exists l2_cldf_reset_bean; + +drop table if exists l2_cldf_reset_bean_child; + +drop table if exists level1; + +drop table if exists level1_level4; + +drop table if exists level1_level2; + +drop table if exists level2; + +drop table if exists level2_level3; + +drop table if exists level3; + +drop table if exists level4; + +alter table link drop system versioning; +drop table if exists link; + +drop table if exists link_draft; + +drop table if exists la_attr_value; + +drop table if exists la_attr_value_attribute; + +drop table if exists looney; + +drop table if exists maddress; + +drop table if exists mcontact; + +drop table if exists mcontact_message; + +drop table if exists mcustomer; + +drop table if exists mgroup; + +drop table if exists mmachine; + +drop table if exists mmachine_mgroup; + +drop table if exists mmedia; + +drop table if exists non_updateprop; + +drop table if exists mprinter; + +drop table if exists mprinter_state; + +drop table if exists mprofile; + +drop table if exists mprotected_construct_bean; + +drop table if exists mrole; + +drop table if exists mrole_muser; + +drop table if exists msome_other; + +drop table if exists muser; + +drop table if exists muser_type; + +drop table if exists mail_box; + +drop table if exists mail_user; + +drop table if exists mail_user_inbox; + +drop table if exists mail_user_outbox; + +drop table if exists main_entity; + +drop table if exists main_entity_relation; + +drop table if exists map_super_actual; + +drop table if exists c_message; + +drop table if exists meter_address_data; + +drop table if exists meter_contract_data; + +drop table if exists meter_special_needs_client; + +drop table if exists meter_special_needs_contact; + +drop table if exists meter_version; + +drop table if exists mnoc_role; + +drop table if exists mnoc_user; + +drop table if exists mnoc_user_mnoc_role; + +drop table if exists mny_a; + +drop table if exists mny_b; + +drop table if exists mny_b_mny_c; + +drop table if exists mny_c; + +drop table if exists mny_topic; + +drop table if exists subtopics; + +drop table if exists mp_role; + +drop table if exists mp_user; + +drop table if exists ms_many_a; + +drop table if exists ms_many_a_many_b; + +drop table if exists ms_many_b; + +drop table if exists ms_many_b_many_a; + +drop table if exists my_lob_size; + +drop table if exists my_lob_size_join_many; + +drop table if exists noidbean; + +drop table if exists o_bean_child; + +drop table if exists ocached_app; + +drop table if exists ocached_app_detail; + +drop table if exists o_cached_bean; + +drop table if exists o_cached_bean_country; + +drop table if exists o_cached_bean_child; + +drop table if exists o_cached_inherit; + +drop table if exists o_cached_natkey; + +drop table if exists o_cached_natkey3; + +drop table if exists ocached_nkey_uid; + +drop table if exists ocar; + +drop table if exists ocompany; + +drop table if exists oengine; + +drop table if exists ogear_box; + +drop table if exists omvertex; + +drop table if exists omvertex_other; + +drop table if exists oroad_show_msg; + +drop table if exists om_account_child_dbo; + +drop table if exists om_account_dbo; + +drop table if exists om_basic_child; + +drop table if exists om_basic_parent; + +drop table if exists om_ordered_detail; + +drop table if exists om_ordered_master; + +drop table if exists only_id_entity; + +drop table if exists o_order; + +drop table if exists o_order_detail; + +drop table if exists s_orders; + +drop table if exists s_order_items; + +drop table if exists order_master; + +drop table if exists order_master_inheritance; + +drop table if exists order_referenced_parent; + +drop table if exists or_order_ship; + +drop table if exists order_toy; + +drop table if exists ordered_parent; + +drop table if exists organisation; + +drop table if exists organization_node; + +drop table if exists organization_tree_node; + +drop table if exists orp_detail; + +drop table if exists orp_detail2; + +drop table if exists orp_master; + +drop table if exists orp_master2; + +drop table if exists oto_aone; + +drop table if exists oto_atwo; + +drop table if exists oto_bchild; + +drop table if exists oto_bmaster; + +drop table if exists oto_child; + +drop table if exists oto_cust; + +drop table if exists oto_cust_address; + +drop table if exists oto_level_a; + +drop table if exists oto_level_b; + +drop table if exists oto_level_c; + +drop table if exists oto_master; + +drop table if exists oto_prime; + +drop table if exists oto_prime_extra; + +drop table if exists oto_sd_child; + +drop table if exists oto_sd_master; + +drop table if exists oto_th_many; + +drop table if exists oto_th_one; + +drop table if exists oto_th_top; + +drop table if exists oto_ubprime; + +drop table if exists oto_ubprime_extra; + +drop table if exists oto_uprime; + +drop table if exists oto_uprime_extra; + +drop table if exists oto_user_model; + +drop table if exists oto_user_model_optional; + +drop table if exists pfile; + +drop table if exists pfile_content; + +drop table if exists paggview; + +drop table if exists pallet_location; + +drop table if exists parcel; + +drop table if exists parcel_location; + +drop table if exists rawinherit_parent; + +drop table if exists rawinherit_parent_rawinherit_data; + +drop table if exists e_save_test_c; + +drop table if exists parent_person; + +drop table if exists c_participation; + +drop table if exists password_store_model; + +drop table if exists pcf_calendar; + +drop table if exists pcf_city; + +drop table if exists pcf_country; + +drop table if exists pcf_event; + +drop table if exists pcf_person; + +drop table if exists mt_permission; + +drop table if exists persistent_file; + +drop table if exists persistent_file_content; + +drop table if exists person; + +drop table if exists persons; + +drop table if exists person_cache_email; + +drop table if exists person_cache_info; + +drop table if exists phones; + +drop table if exists e_position; + +drop table if exists primary_revision; + +drop table if exists o_product; + +drop table if exists pp; + +drop table if exists pp_to_ww; + +drop table if exists question; + +drop table if exists rcustomer; + +drop table if exists r_orders; + +drop table if exists referenced_defaults_model; + +drop table if exists referenced_defaults_model_draft; + +drop table if exists referencing_bean; + +drop table if exists region; + +drop table if exists rel_detail; + +drop table if exists rel_master; + +drop table if exists resourcefile; + +drop table if exists mt_role; + +drop table if exists mt_role_permission; + +drop table if exists em_role; + +drop table if exists root_bean; + +drop table if exists f_second; + +drop table if exists section; + +drop table if exists self_parent; + +drop table if exists self_ref_customer; + +drop table if exists self_ref_example; + +drop table if exists e_save_test_a; + +drop table if exists e_save_test_b; + +drop table if exists site; + +drop table if exists site_address; + +drop table if exists some_enum_bean; + +drop table if exists some_file_bean; + +drop table if exists some_new_types_bean; + +drop table if exists some_period_bean; + +drop table if exists source_base; + +drop table if exists stockforecast; + +drop table if exists sub_section; + +drop table if exists sub_type; + +drop table if exists survey; + +drop table if exists tbytes_only; + +drop table if exists tcar; + +drop table if exists tevent; + +drop table if exists tevent_many; + +drop table if exists tevent_one; + +drop table if exists tint_root; + +drop table if exists tjoda_entity; + +drop table if exists t_mapsuper1; + +drop table if exists t_oneb; + +drop table if exists t_detail_with_other_namexxxyy; + +drop table if exists t_atable_thatisrelatively; + +drop table if exists ttruck_holder; + +drop table if exists ttruck_holder_item; + +drop table if exists tuuid_entity; + +drop table if exists twheel; + +drop table if exists twith_pre_insert; + +drop table if exists target_base; + +drop table if exists mt_tenant; + +drop table if exists test_annotation_base_entity; + +drop table if exists tire; + +drop table if exists sa_tire; + +drop table if exists tree_entity; + +drop table if exists trip; + +drop table if exists truck_ref; + +drop table if exists tune; + +drop table if exists `type`; + +drop table if exists tz_bean; + +drop table if exists usib_child; + +drop table if exists usib_child_sibling; + +drop table if exists usib_parent; + +drop table if exists ut_detail; + +drop table if exists ut_master; + +drop table if exists uuone; + +drop table if exists uutwo; + +drop table if exists oto_user; + +alter table c_user drop system versioning; +drop table if exists c_user; + +drop table if exists tx_user; + +drop table if exists g_user; + +drop table if exists em_user; + +drop table if exists user_interest_live; + +drop table if exists em_user_role; + +drop table if exists vehicle; + +drop table if exists vehicle_driver; + +drop table if exists vehicle_lease; + +drop table if exists version_child; + +drop table if exists version_parent; + +drop table if exists version_toy; + +drop table if exists warehouses; + +drop table if exists warehousesshippingzones; + +drop table if exists wheel; + +drop table if exists sa_wheel; + +drop table if exists sp_car_wheel; + +drop table if exists g_who_props_otm; + +drop table if exists with_zero; + +drop table if exists parent; + +drop table if exists wview; + +drop table if exists zones; + +drop index ix_contact_last_name_first_name on contact; +drop index ix_e_basic_name on e_basic; +drop index ix_efile2_no_fk_owner_id on efile2_no_fk; +drop index ix_ecsm_values_host_id on ecsm_values; +drop index ix_order_referenced_parent_type on order_referenced_parent; +drop index ix_organization_node_kind on organization_node; +drop index ano_3 on test_annotation_base_entity; diff --git a/ebean-core/src/test/ddl-review/mysql-create-all.sql b/ebean-core/src/test/ddl-review/mysql-create-all.sql new file mode 100644 index 000000000..b81d42511 --- /dev/null +++ b/ebean-core/src/test/ddl-review/mysql-create-all.sql @@ -0,0 +1,5008 @@ +-- Generated by ebean unknown at 2020-02-21T19:45:37.488834Z +create table asimple_bean ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_asimple_bean primary key (id) +); + +create table bar ( + bar_type varchar(31) not null, + bar_id integer auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + notes varchar(255), + constraint pk_block primary key (id) +); + +create table oto_account ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_oto_account primary key (id) +); + +create table acl ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_acl primary key (id) +); + +create table acl_container_relation ( + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + street varchar(255), + version integer not null, + constraint pk_address primary key (oid) +); + +create table o_address ( + id integer auto_increment not null, + line_1 varchar(100), + line_2 varchar(100), + city varchar(100), + cretime datetime(6), + country_code varchar(2), + updtime datetime(6) not null, + constraint pk_o_address primary key (id) +); + +create table album ( + id bigint auto_increment not null, + name varchar(255), + cover_id bigint, + deleted tinyint(1) default 0 not null, + created_at datetime(6) not null, + last_update datetime(6) 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 auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_animal_shelter primary key (id) +); + +create table article ( + id integer auto_increment not null, + name varchar(255), + author varchar(255), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_article primary key (id) +); + +create table attribute ( + option_type integer(31) not null, + id integer auto_increment not null, + attribute_holder_id integer, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_attribute primary key (id) +); + +create table attribute_holder ( + id integer auto_increment not null, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_attribute_holder primary key (id) +); + +create table audit_log ( + id bigint auto_increment not null, + description varchar(255), + modified_description varchar(255), + constraint pk_audit_log primary key (id) +); + +create table bbookmark ( + id integer auto_increment not null, + bookmark_reference varchar(255), + user_id integer, + constraint pk_bbookmark primary key (id) +); + +create table bbookmark_org ( + id integer auto_increment not null, + name varchar(255), + constraint pk_bbookmark_org primary key (id) +); + +create table bbookmark_user ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_bsimple_with_gen primary key (id) +); + +create table bsite ( + id varchar(40) not null, + name varchar(255), + constraint pk_bsite primary key (id) +); + +create table bsite_user_a ( + site_id varchar(40) not null, + user_id varchar(40) not null, + access_level integer, + version bigint not null, + constraint pk_bsite_user_a primary key (site_id,user_id) +); + +create table bsite_user_b ( + site varchar(40) not null, + usr varchar(40) not null, + access_level integer, + constraint pk_bsite_user_b primary key (site,usr) +); + +create table bsite_user_c ( + site_uid varchar(40) not null, + user_uid varchar(40) not null, + access_level integer, + constraint pk_bsite_user_c primary key (site_uid,user_uid) +); + +create table bsite_user_d ( + site_id varchar(40) not null, + user_id varchar(40) not null, + access_level integer, + version bigint not null +); + +create table bsite_user_e ( + site_id varchar(40) not null, + user_id varchar(40) not null, + access_level integer +); + +create table buser ( + id varchar(40) not null, + name varchar(255), + constraint pk_buser primary key (id) +); + +create table bwith_qident ( + id integer auto_increment not null, + `Name` varchar(191), + `CODE` varchar(255), + last_updated datetime(6) not null, + constraint uq_bwith_qident_name unique (`Name`), + constraint pk_bwith_qident primary key (id) +); + +create table basic_draftable_bean ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_basic_draftable_bean primary key (id) +); + +create table basic_draftable_bean_draft ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_basic_draftable_bean_draft primary key (id) +); + +create table basic_joda_entity ( + id bigint auto_increment not null, + name varchar(255), + period varchar(50), + local_date date, + created datetime(6) not null, + updated datetime(6) not null, + version datetime(6) not null, + constraint pk_basic_joda_entity primary key (id) +); + +create table bean_with_time_zone ( + id bigint auto_increment not null, + name varchar(255), + timezone varchar(20), + constraint pk_bean_with_time_zone primary key (id) +); + +create table drel_booking ( + id bigint auto_increment 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 table bw_bean ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_cepcategory primary key (id) +); + +create table cepproduct ( + id bigint auto_increment 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 cinh_ref ( + id integer auto_increment not null, + ref_id integer, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_cinh_ref primary key (id) +); + +create table cinh_root ( + dtype varchar(3) not null, + id integer auto_increment not null, + license_number varchar(255), + cretime datetime(6) not null, + updtime datetime(6) 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 auto_increment not null, + assoc_one varchar(255), + constraint pk_ckey_assoc primary key (id) +); + +create table ckey_detail ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_coone primary key (id) +); + +create table coone_many ( + id bigint auto_increment not null, + coone_id bigint not null, + name varchar(255), + deleted tinyint(1) default 0 not null, + constraint pk_coone_many primary key (id) +); + +create table coroot ( + id bigint auto_increment not null, + name varchar(255), + one_id bigint, + constraint uq_coroot_one_id unique (one_id), + constraint pk_coroot primary key (id) +); + +create table calculation_result ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + version integer not null, + constraint pk_sp_car_car primary key (id) +); + +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 auto_increment not null, + brand varchar(255), + sold integer not null, + version integer not null, + constraint pk_sa_car primary key (id) +); + +create table car_accessory ( + id integer auto_increment not null, + name varchar(255), + fuse_id bigint not null, + car_id integer, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_car_accessory primary key (id) +); + +create table car_fuse ( + id bigint auto_increment not null, + location_code varchar(255), + constraint pk_car_fuse primary key (id) +); + +create table category ( + id bigint auto_increment 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 auto_increment not null, + parent_id bigint, + test_property tinyint(1) default 0 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 auto_increment 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 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 auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_configurations primary key (id) +); + +create table contact ( + id integer auto_increment not null, + first_name varchar(127), + last_name varchar(127), + phone varchar(255), + mobile varchar(255), + email varchar(255), + is_member tinyint(1) default 0 not null, + customer_id integer not null, + group_id integer, + cretime datetime(6) not null, + updtime datetime(6) not null, + constraint pk_contact primary key (id) +); + +create table contact_group ( + id integer auto_increment not null, + name varchar(255), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_contact_group primary key (id) +); + +create table contact_note ( + id integer auto_increment not null, + contact_id integer, + title varchar(255), + note longtext, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_contact_note primary key (id) +); + +create table contract ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_contract primary key (id) +); + +create table contract_costs ( + id bigint auto_increment not null, + status varchar(255), + position_id bigint not null, + constraint pk_contract_costs primary key (id) +); + +create table c_conversation ( + id bigint auto_increment not null, + title varchar(255), + isopen tinyint(1) default 0 not null, + group_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment not null, + s3_url varchar(255), + deleted tinyint(1) default 0 not null, + constraint pk_cover primary key (id) +); + +create table o_customer ( + id integer auto_increment not null, + status varchar(1) comment 'status of the customer', + name varchar(40) not null, + smallnote varchar(100) comment 'Short notes regarding the customer', + anniversary date comment 'Join date of the customer', + billing_address_id integer, + shipping_address_id integer, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_o_customer primary key (id) +) comment='Holds external customers'; + +create table dcredit ( + id bigint auto_increment 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 auto_increment not null, + exhange varchar(255), + an_enum_type varchar(255), + last_updated datetime(6) not null, + constraint pk_dexh_entity primary key (oid) +); + +create table dint_parent ( + type integer(31) not null, + id bigint auto_increment not null, + val integer, + more varchar(255), + constraint pk_dint_parent primary key (id) +); + +create table dmachine ( + id bigint auto_increment 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 auto_increment not null, + machine_id bigint not null, + name varchar(255), + edate date, + use_secs bigint not null, + fuel decimal(38), + version bigint not null, + constraint pk_d_machine_aux_use primary key (id) +); + +create table d_machine_stats ( + id bigint auto_increment not null, + machine_id bigint not null, + edate date, + total_kms bigint not null, + hours bigint not null, + rate decimal(38), + cost decimal(38), + version bigint not null, + constraint pk_d_machine_stats primary key (id) +); + +create table d_machine_use ( + id bigint auto_increment not null, + machine_id bigint not null, + edate date, + distance_kms bigint not null, + time_secs bigint not null, + fuel decimal(38), + version bigint not null, + constraint pk_d_machine_use primary key (id) +); + +create table dorg ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_dorg primary key (id) +); + +create table dperson ( + id bigint auto_increment not null, + first_name varchar(255), + last_name varchar(255), + salary decimal(38), + constraint pk_dperson primary key (id) +); + +create table drol ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_drol primary key (id) +); + +create table drot ( + id bigint auto_increment 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 auto_increment not null, + val integer, + constraint pk_rawinherit_data primary key (id) +); + +create table data_container ( + id varchar(40) not null, + content varchar(255), + constraint pk_data_container primary key (id) +); + +create table dc_detail ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_dc_master primary key (id) +); + +create table dfk_cascade ( + id bigint auto_increment not null, + name varchar(255), + one_id bigint, + constraint pk_dfk_cascade primary key (id) +); + +create table dfk_cascade_one ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_dfk_cascade_one primary key (id) +); + +create table dfk_none ( + id bigint auto_increment not null, + name varchar(255), + one_id bigint, + constraint pk_dfk_none primary key (id) +); + +create table dfk_none_via_join ( + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_dfk_one primary key (id) +); + +create table dfk_set_null ( + id bigint auto_increment not null, + name varchar(255), + one_id bigint, + constraint pk_dfk_set_null primary key (id) +); + +create table doc ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_doc_draft primary key (id) +); + +create table document ( + id bigint auto_increment not null, + title varchar(127), + body varchar(255), + organisation_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint uq_document_title unique (title), + constraint pk_document primary key (id) +); + +create table document_draft ( + id bigint auto_increment not null, + title varchar(127), + body varchar(255), + when_publish datetime(6), + organisation_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint uq_document_draft_title unique (title), + constraint pk_document_draft primary key (id) +); + +create table document_media ( + id bigint auto_increment not null, + document_id bigint, + name varchar(255), + description varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_document_media primary key (id) +); + +create table document_media_draft ( + id bigint auto_increment not null, + document_id bigint, + name varchar(255), + description varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_document_media_draft primary key (id) +); + +create table sp_car_door ( + id bigint auto_increment not null, + name varchar(255), + version integer not null, + constraint pk_sp_car_door primary key (id) +); + +create table earray_bean ( + id bigint auto_increment not null, + foo integer, + name varchar(255), + phone_numbers varchar(300), + uids varchar(1000) not null, + other_ids varchar(1000), + doubs varchar(1000), + statuses varchar(1000), + vc_enums varchar(1000), + int_enums varchar(1000), + status2 varchar(1000), + version bigint not null, + constraint pk_earray_bean primary key (id) +); + +create table earray_set_bean ( + id bigint auto_increment not null, + name varchar(255), + phone_numbers varchar(300), + uids varchar(1000), + other_ids varchar(1000), + doubs varchar(1000), + version bigint not null, + constraint pk_earray_set_bean primary key (id) +); + +create table e_basic ( + id integer auto_increment not null, + status varchar(1), + name varchar(127), + description varchar(255), + some_date datetime(6), + constraint pk_e_basic primary key (id) +); + +create table ebasic_change_log ( + id bigint auto_increment not null, + name varchar(20), + short_description varchar(50), + long_description varchar(100), + who_created varchar(255) not null, + who_modified varchar(255) not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + version bigint not null, + constraint pk_ebasic_change_log primary key (id) +); + +create table ebasic_clob ( + id bigint auto_increment not null, + name varchar(255), + title varchar(255), + description longtext, + last_update datetime(6) not null, + constraint pk_ebasic_clob primary key (id) +); + +create table ebasic_clob_fetch_eager ( + id bigint auto_increment not null, + name varchar(255), + title varchar(255), + description longtext, + last_update datetime(6) not null, + constraint pk_ebasic_clob_fetch_eager primary key (id) +); + +create table ebasic_clob_no_ver ( + id bigint auto_increment not null, + name varchar(255), + description longtext, + constraint pk_ebasic_clob_no_ver primary key (id) +); + +create table e_basicenc ( + id integer auto_increment not null, + name varchar(255), + description varbinary(80), + dob varbinary(20), + status varbinary(20), + last_update datetime(6), + constraint pk_e_basicenc primary key (id) +); + +create table e_basicenc_bin ( + id integer auto_increment not null, + name varchar(255), + description varchar(255), + data longblob, + some_time varbinary(255), + last_update datetime(6) not null, + constraint pk_e_basicenc_bin primary key (id) +); + +create table e_basicenc_client ( + id bigint auto_increment 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 auto_increment 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 pk_e_basic_enum_id primary key (status) +); + +create table e_basic_eni ( + id integer auto_increment not null, + status integer, + name varchar(255), + description varchar(255), + some_date datetime(6), + constraint pk_e_basic_eni primary key (id) +); + +create table ebasic_hstore ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + value_set json, + value_list json, + value_map json, + plain_value json, + version bigint not null, + constraint pk_ebasic_json_jackson primary key (id) +); + +create table ebasic_json_jackson2 ( + id bigint auto_increment not null, + name varchar(255), + value_set json, + value_list json, + value_map json, + plain_value json, + version bigint not null, + constraint pk_ebasic_json_jackson2 primary key (id) +); + +create table ebasic_json_list ( + id bigint auto_increment not null, + name varchar(255), + bean_set json, + bean_list json, + bean_map json, + plain_bean json, + flags json, + tags varchar(100), + version bigint not null, + constraint pk_ebasic_json_list primary key (id) +); + +create table ebasic_json_map ( + id bigint auto_increment not null, + name varchar(255), + content json, + version bigint not null, + constraint pk_ebasic_json_map primary key (id) +); + +create table ebasic_json_map_blob ( + id bigint auto_increment not null, + name varchar(255), + content longblob, + version bigint not null, + constraint pk_ebasic_json_map_blob primary key (id) +); + +create table ebasic_json_map_clob ( + id bigint auto_increment not null, + name varchar(255), + content longtext, + version bigint not null, + constraint pk_ebasic_json_map_clob primary key (id) +); + +create table ebasic_json_map_detail ( + id bigint auto_increment not null, + owner_id bigint, + name varchar(255), + content json, + version bigint not null, + constraint pk_ebasic_json_map_detail primary key (id) +); + +create table ebasic_json_map_json_b ( + id bigint auto_increment not null, + name varchar(255), + content json, + version bigint not null, + constraint pk_ebasic_json_map_json_b primary key (id) +); + +create table ebasic_json_map_varchar ( + id bigint auto_increment 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_node ( + id bigint auto_increment not null, + name varchar(255), + content json, + version bigint not null, + constraint pk_ebasic_json_node primary key (id) +); + +create table ebasic_json_node_blob ( + id bigint auto_increment not null, + name varchar(255), + content longblob, + version bigint not null, + constraint pk_ebasic_json_node_blob primary key (id) +); + +create table ebasic_json_node_json_b ( + id bigint auto_increment not null, + name varchar(255), + content json, + version bigint not null, + constraint pk_ebasic_json_node_json_b primary key (id) +); + +create table ebasic_json_node_varchar ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_ebasic_json_unmapped primary key (id) +); + +create table e_basic_ndc ( + id integer auto_increment not null, + name varchar(255), + constraint pk_e_basic_ndc primary key (id) +); + +create table ebasic_no_sdchild ( + id bigint auto_increment 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_sdchild ( + id bigint auto_increment not null, + owner_id bigint not null, + child_name varchar(255), + amount bigint not null, + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_ebasic_sdchild primary key (id) +); + +create table ebasic_soft_delete ( + id bigint auto_increment not null, + name varchar(255), + description varchar(255), + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_ebasic_soft_delete primary key (id) +); + +create table e_basicver ( + id integer auto_increment not null, + name varchar(255), + description varchar(255), + other varchar(255), + last_update datetime(6) not null, + constraint pk_e_basicver primary key (id) +); + +create table e_basic_withlife ( + id bigint auto_increment not null, + name varchar(255), + other varchar(255), + deleted tinyint(1) default 0 not null, + version bigint not null, + constraint pk_e_basic_withlife primary key (id) +); + +create table e_basic_with_ex ( + id bigint auto_increment not null, + deleted tinyint(1) default 0 not null, + version bigint not null, + constraint pk_e_basic_with_ex primary key (id) +); + +create table e_basicverucon ( + id integer auto_increment not null, + name varchar(127), + other varchar(127), + other_one varchar(127), + description varchar(255), + last_update datetime(6) 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 varchar(40) not null, + name varchar(100), + root_id varchar(40) not null, + constraint pk_ecache_child primary key (id) +); + +create table ecache_root ( + id varchar(40) not null, + name varchar(100), + constraint pk_ecache_root primary key (id) +); + +create table e_col_ab ( + id bigint auto_increment 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 auto_increment 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 auto_increment 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 auto_increment not null, + nome_outer varchar(255), + date1 datetime(6), + date2 datetime(6), + 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 auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + ts_created datetime(6) not null, + ts_updated datetime(6) not null, + ldt_created datetime(6) not null, + ldt_updated datetime(6) not null, + odt_created datetime(6) not null, + odt_updated datetime(6) not null, + zdt_created datetime(6) not null, + zdt_updated datetime(6) not null, + instant_created datetime(6) not null, + instant_updated datetime(6) 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 auto_increment not null, + uuid varchar(40) 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 auto_increment not null, + invoice_date datetime(6), + state integer, + person_id bigint, + ship_street varchar(255), + ship_suburb varchar(255), + ship_city varchar(255), + ship_status varchar(3), + bill_street varchar(255), + bill_suburb varchar(255), + bill_city varchar(255), + bill_status varchar(3), + version bigint not null, + constraint pk_einvoice primary key (id) +); + +create table e_main ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_enull_collection primary key (id) +); + +create table enull_collection_detail ( + id integer auto_increment 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 auto_increment not null, + name_for_a varchar(255), + b_id integer, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_eopt_one_a primary key (id) +); + +create table eopt_one_b ( + id integer auto_increment not null, + name_for_b varchar(255), + c_id integer not null, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_eopt_one_b primary key (id) +); + +create table eopt_one_c ( + id integer auto_increment not null, + name_for_c varchar(255), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_eopt_one_c primary key (id) +); + +create table eper_addr ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + notes varchar(255), + street varchar(255), + suburb varchar(255), + addr_city varchar(255), + addr_status varchar(3), + version bigint not null, + constraint pk_eperson primary key (id) +); + +create table e_person_online ( + id bigint auto_increment not null, + email varchar(127), + online_status tinyint(1) default 0 not null, + when_updated datetime(6) not null, + constraint uq_e_person_online_email unique (email), + constraint pk_e_person_online primary key (id) +); + +create table esimple ( + usertypeid integer auto_increment not null, + name varchar(255), + constraint pk_esimple primary key (usertypeid) +); + +create table esoft_del_book ( + id bigint auto_increment not null, + book_title varchar(255), + lend_by_id bigint, + version bigint not null, + deleted tinyint(1) default 0 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 auto_increment not null, + esoft_del_mid_id bigint not null, + down varchar(255), + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_esoft_del_down primary key (id) +); + +create table esoft_del_mid ( + id bigint auto_increment not null, + top_id bigint, + mid varchar(255), + up_id bigint, + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_esoft_del_mid primary key (id) +); + +create table esoft_del_one_a ( + id bigint auto_increment not null, + name varchar(255), + oneb_id bigint, + deleted tinyint(1) default 0 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 auto_increment 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 auto_increment not null, + role_name varchar(255), + version bigint not null, + deleted tinyint(1) default 0 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 auto_increment not null, + name varchar(255), + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_esoft_del_top primary key (id) +); + +create table esoft_del_up ( + id bigint auto_increment not null, + up varchar(255), + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_esoft_del_up primary key (id) +); + +create table esoft_del_user ( + id bigint auto_increment not null, + user_name varchar(255), + version bigint not null, + deleted tinyint(1) default 0 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 esome_convert_type ( + id bigint auto_increment not null, + name varchar(255), + money decimal(38), + constraint pk_esome_convert_type primary key (id) +); + +create table esome_type ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_etrans_many primary key (id) +); + +create table rawinherit_uncle ( + id integer auto_increment 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 auto_increment 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 auto_increment not null, + user_name varchar(255), + constraint pk_euser_no_fk_soft_del primary key (user_id) +); + +create table evanilla_collection ( + id integer auto_increment not null, + name varchar(255), + constraint pk_evanilla_collection primary key (id) +); + +create table evanilla_collection_detail ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment 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 auto_increment 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 +); + +create table ec_person ( + id bigint auto_increment 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 auto_increment 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 auto_increment 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 auto_increment 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 auto_increment 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 auto_increment 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 longtext not null +); + +create table ecs_person ( + id bigint auto_increment 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 varchar(40) 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 varchar(40) not null, + value varchar(255) not null +); + +create table ecsm_one ( + one_id varchar(40) not null, + name varchar(255), + version bigint not null, + constraint pk_ecsm_one primary key (one_id) +); + +create table ecsm_parent ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_ecsm_parent primary key (id) +); + +create table ecsm_two ( + id varchar(40) not null, + name varchar(255), + version bigint not null, + constraint pk_ecsm_two primary key (id) +); + +create table td_child ( + child_id integer auto_increment 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 auto_increment not null, + parent_name varchar(255), + extended_name varchar(255), + constraint pk_td_parent primary key (parent_id) +); + +create table element_bean ( + id bigint auto_increment not null, + complex_bean_id varchar(40) not null, + value varchar(255) not null, + constraint pk_element_bean primary key (id) +); + +create table empl ( + id bigint auto_increment not null, + name varchar(255), + age integer, + default_address_id bigint, + constraint pk_empl primary key (id) +); + +create table esd_detail ( + id bigint auto_increment not null, + name varchar(255), + master_id bigint not null, + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_esd_detail primary key (id) +); + +create table esd_master ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + deleted tinyint(1) default 0 not null, + constraint pk_esd_master primary key (id) +); + +create table feature_desc ( + id integer auto_increment not null, + name varchar(255), + description varchar(255), + constraint pk_feature_desc primary key (id) +); + +create table f_first ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_f_first primary key (id) +); + +create table foo ( + foo_id integer auto_increment not null, + important_text varchar(255), + version integer not null, + constraint pk_foo primary key (foo_id) +); + +create table gen_key_identity ( + id bigint auto_increment not null, + description varchar(255), + constraint pk_gen_key_identity primary key (id) +); + +create table gen_key_sequence ( + id bigint auto_increment not null, + description varchar(255), + constraint pk_gen_key_sequence primary key (id) +); + +create table gen_key_table ( + id bigint auto_increment not null, + description varchar(255), + constraint pk_gen_key_table primary key (id) +); + +create table grand_parent_person ( + identifier integer auto_increment 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 auto_increment 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 auto_increment not null, + inactive tinyint(1) default 0 not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_c_group primary key (id) +); + +create table he_doc ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_he_doc primary key (id) +); + +create table hx_link ( + id bigint auto_increment not null, + name varchar(255), + location varchar(255), + comments varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + deleted tinyint(1) default 0 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 auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_hi_doc primary key (id) +); + +create table hi_link ( + id bigint auto_increment not null, + name varchar(255), + location varchar(255), + comments varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment not null, + name varchar(255), + comments varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_hi_tone primary key (id) +); + +create table hi_tthree ( + id bigint auto_increment not null, + hi_ttwo_id bigint not null, + three varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_hi_tthree primary key (id) +); + +create table hi_ttwo ( + id bigint auto_increment not null, + hi_tone_id bigint not null, + two varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_hi_ttwo primary key (id) +); + +create table hsd_setting ( + id bigint auto_increment not null, + code varchar(255), + content varchar(255), + user_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + deleted tinyint(1) default 0 not null, + constraint uq_hsd_setting_user_id unique (user_id), + constraint pk_hsd_setting primary key (id) +); + +create table hsd_user ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + deleted tinyint(1) default 0 not null, + constraint pk_hsd_user primary key (id) +); + +create table iaf_segment ( + ptype varchar(31) not null, + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_iaf_segment_status primary key (id) +); + +create table imrelated ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + title varchar(255), + when_title datetime(6), + constraint pk_imroot primary key (id) +); + +create table ixresource ( + dtype varchar(255), + id varchar(40) not null, + name varchar(255), + constraint pk_ixresource primary key (id) +); + +create table info_company ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_info_company primary key (id) +); + +create table info_contact ( + id bigint auto_increment 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 auto_increment 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 auto_increment 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 auto_increment not null, + booking bigint, + version integer not null, + constraint pk_drel_invoice primary key (id) +); + +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 datetime(6), + date_created datetime(6), + modified_by varchar(255), + created_by varchar(255), + version bigint not null, + constraint pk_item primary key (customer,itemnumber) +); + +create table monkey ( + mid bigint auto_increment not null, + name varchar(255), + food_preference varchar(255), + version bigint not null, + constraint pk_monkey primary key (mid) +); + +create table mkeygroup ( + pid bigint auto_increment 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 auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_l2_cldf_reset_bean primary key (id) +); + +create table l2_cldf_reset_bean_child ( + id bigint auto_increment not null, + parent_id bigint, + constraint pk_l2_cldf_reset_bean_child primary key (id) +); + +create table level1 ( + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_level3 primary key (id) +); + +create table level4 ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_level4 primary key (id) +); + +create table link ( + id bigint auto_increment not null, + name varchar(255), + location varchar(255), + when_publish datetime(6), + link_comment varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + deleted tinyint(1) default 0 not null, + constraint pk_link primary key (id) +); + +create table link_draft ( + id bigint auto_increment not null, + name varchar(255), + location varchar(255), + when_publish datetime(6), + link_comment varchar(255), + dirty tinyint(1) default 0 not null, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + deleted tinyint(1) default 0 not null, + constraint pk_link_draft primary key (id) +); + +create table la_attr_value ( + id integer auto_increment not null, + name varchar(255), + cretime datetime(6) not null, + updtime datetime(6) 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 auto_increment not null, + tune_id bigint, + name varchar(255), + constraint pk_looney primary key (id) +); + +create table maddress ( + id varchar(40) not null, + street varchar(255), + city varchar(255), + version bigint not null, + constraint pk_maddress primary key (id) +); + +create table mcontact ( + id varchar(40) not null, + email varchar(255), + first_name varchar(255), + last_name varchar(255), + customer_id varchar(40), + version bigint not null, + constraint pk_mcontact primary key (id) +); + +create table mcontact_message ( + id varchar(40) not null, + title varchar(255), + subject varchar(255), + notes varchar(255), + contact_id varchar(40) not null, + version bigint not null, + constraint pk_mcontact_message primary key (id) +); + +create table mcustomer ( + id varchar(40) not null, + name varchar(255), + notes varchar(255), + shipping_address_id varchar(40), + billing_address_id varchar(40), + version bigint not null, + constraint pk_mcustomer primary key (id) +); + +create table mgroup ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_mgroup primary key (id) +); + +create table mmachine ( + id bigint auto_increment 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 auto_increment not null, + url varchar(255), + note varchar(255), + constraint pk_mmedia primary key (id) +); + +create table non_updateprop ( + id integer auto_increment not null, + non_enum varchar(5), + name varchar(255), + note varchar(255), + constraint pk_non_updateprop primary key (id) +); + +create table mprinter ( + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + picture_id bigint, + name varchar(255), + constraint pk_mprofile primary key (id) +); + +create table mprotected_construct_bean ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_mprotected_construct_bean primary key (id) +); + +create table mrole ( + roleid integer auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_msome_other primary key (id) +); + +create table muser ( + userid integer auto_increment not null, + user_name varchar(255), + user_type_id integer, + constraint pk_muser primary key (userid) +); + +create table muser_type ( + id integer auto_increment not null, + name varchar(255), + constraint pk_muser_type primary key (id) +); + +create table mail_box ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_mail_box primary key (id) +); + +create table mail_user ( + id bigint auto_increment 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 varchar(40) 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 auto_increment not null, + name varchar(255), + when_created datetime(6) not null, + when_updated datetime(6) not null, + constraint pk_map_super_actual primary key (id) +); + +create table c_message ( + id bigint auto_increment not null, + title varchar(255), + body varchar(255), + conversation_id bigint, + user_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_c_message primary key (id) +); + +create table meter_address_data ( + id varchar(40) not null, + street varchar(255) not null, + constraint pk_meter_address_data primary key (id) +); + +create table meter_contract_data ( + id varchar(40) not null, + special_needs_client_id varchar(40) 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 varchar(40) not null, + name varchar(255), + primary_id varchar(40), + 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 varchar(40) not null, + name varchar(255), + constraint pk_meter_special_needs_contact primary key (id) +); + +create table meter_version ( + id varchar(40) not null, + address_data_id varchar(40), + contract_data_id varchar(40) 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 auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_mny_a primary key (id) +); + +create table mny_b ( + id bigint auto_increment not null, + name varchar(255), + a_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_mny_c primary key (id) +); + +create table mny_topic ( + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_mp_user primary key (id) +); + +create table ms_many_a ( + aid bigint auto_increment not null, + name varchar(255), + ms_many_a_many_b tinyint(1) default 0 not null, + ms_many_b tinyint(1) default 0 not null, + deleted tinyint(1) default 0 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 auto_increment not null, + name varchar(255), + deleted tinyint(1) default 0 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 auto_increment not null, + name varchar(255), + my_count integer not null, + my_lob longtext, + constraint pk_my_lob_size primary key (id) +); + +create table my_lob_size_join_many ( + id integer auto_increment 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 datetime(6) not null +); + +create table o_bean_child ( + id bigint auto_increment not null, + cached_bean_id bigint, + constraint pk_o_bean_child primary key (id) +); + +create table ocached_app ( + id bigint auto_increment 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 auto_increment 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 auto_increment 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 auto_increment 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 auto_increment 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 auto_increment 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 auto_increment 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 auto_increment not null, + cid varchar(40), + other varchar(255), + version bigint not null, + constraint pk_ocached_nkey_uid primary key (id) +); + +create table ocar ( + id integer auto_increment not null, + vin varchar(255), + name varchar(255), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_ocar primary key (id) +); + +create table ocompany ( + id integer auto_increment not null, + corp_id varchar(50), + cretime datetime(6) not null, + updtime datetime(6) 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 varchar(40) 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 varchar(40) 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 varchar(40) not null, + constraint pk_omvertex primary key (id) +); + +create table omvertex_other ( + id varchar(40) not null, + omvertex_id varchar(40) not null, + name varchar(255), + constraint pk_omvertex_other primary key (id) +); + +create table oroad_show_msg ( + id integer auto_increment not null, + company_id integer not null, + cretime datetime(6) not null, + updtime datetime(6) 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_om_account_dbo primary key (id) +); + +create table om_basic_child ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_om_basic_parent primary key (id) +); + +create table om_ordered_detail ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_om_ordered_master primary key (id) +); + +create table only_id_entity ( + id bigint auto_increment not null, + constraint pk_only_id_entity primary key (id) +); + +create table o_order ( + id integer auto_increment not null, + status integer, + order_date date, + ship_date date, + kcustomer_id integer not null, + cretime datetime(6) not null, + updtime datetime(6) not null, + constraint pk_o_order primary key (id) +); + +create table o_order_detail ( + id integer auto_increment not null, + order_id integer not null, + order_qty integer, + ship_qty integer, + unit_price double, + product_id integer, + cretime datetime(6), + updtime datetime(6) 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(38), + constraint pk_s_order_items primary key (uuid) +); + +create table or_order_ship ( + id integer auto_increment not null, + order_id integer, + ship_time datetime(6), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_or_order_ship primary key (id) +); + +create table organisation ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_organisation primary key (id) +); + +create table organization_node ( + kind varchar(31) not null, + id bigint auto_increment 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 auto_increment 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 not null, + child varchar(255), + constraint pk_oto_bchild primary key (master_id) +); + +create table oto_bmaster ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_oto_bmaster primary key (id) +); + +create table oto_child ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_oto_cust primary key (cid) +); + +create table oto_cust_address ( + aid bigint auto_increment 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 auto_increment 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_oto_level_c primary key (id) +); + +create table oto_master ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_oto_master primary key (id) +); + +create table oto_prime ( + pid bigint auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_oto_prime primary key (pid) +); + +create table oto_prime_extra ( + eid bigint not null, + extra varchar(255), + version bigint not null, + constraint pk_oto_prime_extra primary key (eid) +); + +create table oto_sd_child ( + id bigint auto_increment not null, + child varchar(255), + master_id bigint, + deleted tinyint(1) default 0 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_oto_sd_master primary key (id) +); + +create table oto_th_many ( + id bigint auto_increment not null, + oto_th_top_id bigint not null, + many varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_oto_th_many primary key (id) +); + +create table oto_th_one ( + id bigint auto_increment not null, + one tinyint(1) default 0 not null, + many_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment not null, + topp varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_oto_th_top primary key (id) +); + +create table oto_ubprime ( + pid varchar(40) not null, + name varchar(255), + version bigint not null, + constraint pk_oto_ubprime primary key (pid) +); + +create table oto_ubprime_extra ( + eid varchar(40) not null, + extra varchar(255), + version bigint not null, + constraint pk_oto_ubprime_extra primary key (eid) +); + +create table oto_uprime ( + pid varchar(40) not null, + name varchar(255), + version bigint not null, + constraint pk_oto_uprime primary key (pid) +); + +create table oto_uprime_extra ( + eid varchar(40) not null, + extra varchar(255), + version bigint not null, + constraint pk_oto_uprime_extra primary key (eid) +); + +create table oto_user_model ( + id bigint auto_increment not null, + name varchar(255), + user_optional_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment not null, + optional varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_oto_user_model_optional primary key (id) +); + +create table pfile ( + id integer auto_increment not null, + name varchar(255), + file_content_id integer, + file_content2_id integer, + cretime datetime(6) not null, + updtime datetime(6) 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 auto_increment not null, + content longblob, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_pfile_content primary key (id) +); + +create table paggview ( + pview_id varchar(40), + amount integer not null, + constraint uq_paggview_pview_id unique (pview_id) +); + +create table pallet_location ( + type varchar(31) not null, + id integer auto_increment not null, + zone_sid integer not null, + attribute varchar(255), + constraint pk_pallet_location primary key (id) +); + +create table parcel ( + parcelid bigint auto_increment not null, + description varchar(255), + constraint pk_parcel primary key (parcelid) +); + +create table parcel_location ( + parcellocid bigint auto_increment 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 auto_increment 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 auto_increment not null, + version bigint not null, + constraint pk_e_save_test_c primary key (id) +); + +create table parent_person ( + identifier integer auto_increment 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 auto_increment not null, + rating integer, + type integer, + conversation_id bigint not null, + user_id bigint not null, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_c_participation primary key (id) +); + +create table password_store_model ( + id bigint auto_increment not null, + enc1 varchar(30), + enc2 varchar(40), + enc3 longtext, + enc4 varbinary(30), + enc5 varbinary(40), + enc6 longblob, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_password_store_model primary key (id) +); + +create table pcf_calendar ( + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + version bigint not null, + constraint pk_pcf_country primary key (id) +); + +create table pcf_event ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_pcf_person primary key (id) +); + +create table mt_permission ( + id varchar(40) not null, + name varchar(255), + constraint pk_mt_permission primary key (id) +); + +create table persistent_file ( + id integer auto_increment not null, + name varchar(255), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_persistent_file primary key (id) +); + +create table persistent_file_content ( + id integer auto_increment not null, + persistent_file_id integer, + content longblob, + cretime datetime(6) not null, + updtime datetime(6) 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 auto_increment not null, + default_address_oid bigint, + version integer not null, + constraint pk_person primary key (oid) +); + +create table persons ( + id bigint auto_increment 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 phones ( + id bigint auto_increment 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 auto_increment 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 auto_increment not null, + sku varchar(20), + name varchar(255), + cretime datetime(6) not null, + updtime datetime(6) not null, + constraint pk_o_product primary key (id) +); + +create table pp ( + id varchar(40) not null, + name varchar(255), + value varchar(100) not null, + constraint pk_pp primary key (id) +); + +create table pp_to_ww ( + pp_id varchar(40) not null, + ww_id varchar(40) not null, + constraint pk_pp_to_ww primary key (pp_id,ww_id) +); + +create table question ( + id bigint auto_increment 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 referencing_bean ( + id varchar(40) 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 auto_increment not null, + name varchar(255), + version integer not null, + constraint pk_rel_detail primary key (id) +); + +create table rel_master ( + id bigint auto_increment not null, + name varchar(255), + detail_id bigint, + version integer not null, + constraint pk_rel_master 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 varchar(40) not null, + name varchar(50), + tenant_id varchar(40), + version bigint not null, + constraint pk_mt_role primary key (id) +); + +create table mt_role_permission ( + mt_role_id varchar(40) not null, + mt_permission_id varchar(40) not null, + constraint pk_mt_role_permission primary key (mt_role_id,mt_permission_id) +); + +create table em_role ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_em_role primary key (id) +); + +create table root_bean ( + dtype varchar(31) not null, + id varchar(40) not null, + referencing_bean_id varchar(40) not null, + value varchar(255), + constraint pk_root_bean primary key (id) +); + +create table f_second ( + id bigint auto_increment 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 auto_increment not null, + article_id integer, + type integer, + content longtext, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_section primary key (id) +); + +create table self_parent ( + id bigint auto_increment 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 auto_increment not null, + name varchar(255), + referred_by_id bigint, + constraint pk_self_ref_customer primary key (id) +); + +create table self_ref_example ( + id bigint auto_increment 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 auto_increment not null, + version bigint not null, + constraint pk_e_save_test_a primary key (id) +); + +create table e_save_test_b ( + id bigint auto_increment not null, + sibling_a_id bigint, + test_property tinyint(1) default 0 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 varchar(40) not null, + name varchar(255), + parent_id varchar(40), + data_container_id varchar(40), + site_address_id varchar(40), + 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 varchar(40) 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 auto_increment not null, + some_enum integer, + name varchar(255), + constraint pk_some_enum_bean primary key (id) +); + +create table some_file_bean ( + id bigint auto_increment not null, + name varchar(255), + content longblob, + version bigint not null, + constraint pk_some_file_bean primary key (id) +); + +create table some_new_types_bean ( + id bigint auto_increment 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 datetime(6), + offset_date_time datetime(6), + zoned_date_time datetime(6), + local_time time, + instant datetime(6), + zone_id varchar(60), + zone_offset varchar(60), + path varchar(255), + period varchar(20), + duration bigint, + version bigint not null, + constraint pk_some_new_types_bean primary key (id) +); + +create table some_period_bean ( + id bigint auto_increment 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 varchar(40) not null, + name varchar(255), + pos integer not null, + target_id varchar(40), + constraint pk_source_base primary key (id) +); + +create table stockforecast ( + type varchar(31) not null, + id bigint auto_increment not null, + inner_report_id bigint, + constraint pk_stockforecast primary key (id) +); + +create table sub_section ( + id integer auto_increment not null, + section_id integer, + title varchar(255), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_sub_section primary key (id) +); + +create table sub_type ( + sub_type_id integer auto_increment not null, + description varchar(255), + version bigint not null, + constraint pk_sub_type primary key (sub_type_id) +); + +create table survey ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_survey primary key (id) +); + +create table tbytes_only ( + id integer auto_increment not null, + content longblob, + constraint pk_tbytes_only primary key (id) +); + +create table tcar ( + type varchar(31) not null, + plate_no varchar(32) not null, + truckload bigint, + constraint pk_tcar primary key (plate_no) +); + +create table tevent ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + constraint pk_tevent primary key (id) +); + +create table tevent_many ( + id bigint auto_increment not null, + description varchar(255), + event_id bigint, + 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 auto_increment not null, + name varchar(255), + status integer, + event_id bigint, + version bigint not null, + 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 auto_increment not null, + name varchar(255), + child_property varchar(255), + constraint pk_tint_root primary key (id) +); + +create table tjoda_entity ( + id integer auto_increment not null, + local_time time, + constraint pk_tjoda_entity primary key (id) +); + +create table t_mapsuper1 ( + id integer auto_increment 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 auto_increment not null, + name varchar(255), + description varchar(255), + active tinyint(1) default 0 not null, + constraint pk_t_oneb primary key (id) +); + +create table t_detail_with_other_namexxxyy ( + id integer auto_increment not null, + name varchar(255), + description varchar(255), + some_unique_value varchar(127), + active tinyint(1) default 0 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 table t_atable_thatisrelatively ( + id integer auto_increment not null, + name varchar(255), + description varchar(255), + active tinyint(1) default 0 not null, + constraint pk_t_atable_thatisrelatively primary key (id) +); + +create table ttruck_holder ( + id bigint auto_increment 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 auto_increment not null, + some_uid varchar(40), + foo varchar(255), + owner_id bigint not null, + constraint pk_ttruck_holder_item primary key (id) +); + +create table tuuid_entity ( + id varchar(40) not null, + name varchar(255), + constraint pk_tuuid_entity primary key (id) +); + +create table twheel ( + id bigint auto_increment not null, + owner_plate_no varchar(32) not null, + constraint pk_twheel primary key (id) +); + +create table twith_pre_insert ( + id integer auto_increment 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 varchar(40) not null, + name varchar(255), + constraint pk_target_base primary key (id) +); + +create table mt_tenant ( + id varchar(40) 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 tire ( + id bigint auto_increment not null, + wheel bigint, + version integer not null, + constraint uq_tire_wheel unique (wheel), + constraint pk_tire primary key (id) +); + +create table sa_tire ( + id bigint auto_increment not null, + version integer not null, + constraint pk_sa_tire primary key (id) +); + +create table tree_entity ( + id integer auto_increment not null, + text varchar(255), + parent_id integer, + constraint pk_tree_entity primary key (id) +); + +create table trip ( + id integer auto_increment not null, + vehicle_driver_id integer, + destination varchar(255), + address_id integer, + star_date datetime(6), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_trip primary key (id) +); + +create table truck_ref ( + id integer auto_increment not null, + something varchar(255), + constraint pk_truck_ref primary key (id) +); + +create table tune ( + id bigint auto_increment 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 auto_increment not null, + moda varchar(255), + ts datetime(6), + tstz datetime(6), + constraint pk_tz_bean primary key (id) +); + +create table usib_child ( + id varchar(40) not null, + parent_id bigint, + deleted tinyint(1) default 0 not null, + constraint pk_usib_child primary key (id) +); + +create table usib_child_sibling ( + id bigint auto_increment not null, + child_id varchar(40), + deleted tinyint(1) default 0 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 auto_increment not null, + deleted tinyint(1) default 0 not null, + constraint pk_usib_parent primary key (id) +); + +create table ut_detail ( + id integer auto_increment 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 auto_increment 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 varchar(40) not null, + name varchar(255), + description varchar(255), + version bigint not null, + constraint pk_uuone primary key (id) +); + +create table uutwo ( + id varchar(40) not null, + name varchar(255), + notes varchar(255), + master_id varchar(40), + version bigint not null, + constraint pk_uutwo primary key (id) +); + +create table oto_user ( + id bigint auto_increment not null, + name varchar(255), + account_id bigint not null, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint uq_oto_user_account_id unique (account_id), + constraint pk_oto_user primary key (id) +); + +create table c_user ( + id bigint auto_increment not null, + inactive tinyint(1) default 0 not null, + name varchar(255), + email varchar(255), + password_hash varchar(255), + group_id bigint, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) not null, + constraint pk_c_user primary key (id) +); + +create table tx_user ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_tx_user primary key (id) +); + +create table g_user ( + id bigint auto_increment not null, + username varchar(255), + version bigint not null, + constraint pk_g_user primary key (id) +); + +create table em_user ( + id bigint auto_increment 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 datetime(6) 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 auto_increment not null, + license_number varchar(255), + registration_date datetime(6), + lease_id bigint, + cretime datetime(6) not null, + updtime datetime(6) 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 pk_vehicle primary key (id) +); + +create table vehicle_driver ( + id integer auto_increment not null, + name varchar(255), + vehicle_id integer, + address_id integer, + license_issued_on datetime(6), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint pk_vehicle_driver primary key (id) +); + +create table vehicle_lease ( + dtype varchar(31) not null, + id bigint auto_increment not null, + name varchar(255), + active_start date, + active_end date, + version bigint not null, + bond decimal(38), + min_duration integer not null, + day_rate decimal(38), + max_days integer, + constraint pk_vehicle_lease primary key (id) +); + +create table warehouses ( + id integer auto_increment 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 auto_increment not null, + version integer not null, + constraint pk_wheel primary key (id) +); + +create table sa_wheel ( + id bigint auto_increment not null, + tire bigint, + car bigint, + version integer not null, + constraint pk_sa_wheel primary key (id) +); + +create table sp_car_wheel ( + id bigint auto_increment not null, + name varchar(255), + version integer not null, + constraint pk_sp_car_wheel primary key (id) +); + +create table g_who_props_otm ( + id bigint auto_increment not null, + name varchar(255), + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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 auto_increment 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 auto_increment not null, + name varchar(255), + constraint pk_parent primary key (id) +); + +create table wview ( + id varchar(40) 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 auto_increment 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_organization_node_kind on organization_node (kind); +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_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_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_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; + +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; + +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 cascade; + +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 set null; + +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; + +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_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_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_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_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_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; + +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_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; + +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; + +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_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_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_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 hx_link add column sys_period_start datetime(6) default now(6); +alter table hx_link add column sys_period_end datetime(6); +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 datetime(6), + when_modified datetime(6), + deleted tinyint(1), + sys_period_start datetime(6), + sys_period_end datetime(6) +); +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 datetime(6) default now(6); +alter table hi_link add column sys_period_end datetime(6); +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 datetime(6), + when_modified datetime(6), + sys_period_start datetime(6), + sys_period_end datetime(6) +); +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 datetime(6) default now(6); +alter table hi_link_doc add column sys_period_end datetime(6); +create table hi_link_doc_history( + hi_link_id bigint, + hi_doc_id bigint, + sys_period_start datetime(6), + sys_period_end datetime(6) +); +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 datetime(6) default now(6); +alter table hi_tone add column sys_period_end datetime(6); +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 datetime(6), + when_modified datetime(6), + sys_period_start datetime(6), + sys_period_end datetime(6) +); +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 datetime(6) default now(6); +alter table hi_tthree add column sys_period_end datetime(6); +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 datetime(6), + when_modified datetime(6), + sys_period_start datetime(6), + sys_period_end datetime(6) +); +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 datetime(6) default now(6); +alter table hi_ttwo add column sys_period_end datetime(6); +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 datetime(6), + when_modified datetime(6), + sys_period_start datetime(6), + sys_period_end datetime(6) +); +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 datetime(6) default now(6); +alter table hsd_setting add column sys_period_end datetime(6); +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 datetime(6), + when_modified datetime(6), + deleted tinyint(1), + sys_period_start datetime(6), + sys_period_end datetime(6) +); +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 datetime(6) default now(6); +alter table hsd_user add column sys_period_end datetime(6); +update hsd_user set sys_period_start = when_created; +create table hsd_user_history( + id bigint, + name varchar(255), + version bigint, + when_created datetime(6), + when_modified datetime(6), + deleted tinyint(1), + sys_period_start datetime(6), + sys_period_end datetime(6) +); +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 datetime(6) default now(6); +alter table link add column sys_period_end datetime(6); +update link set sys_period_start = when_created; +create table link_history( + id bigint, + name varchar(255), + location varchar(255), + when_publish datetime(6), + link_comment varchar(255), + version bigint, + when_created datetime(6), + when_modified datetime(6), + deleted tinyint(1), + sys_period_start datetime(6), + sys_period_end datetime(6) +); +create view link_with_history as select * from link union all select * from link_history; + +alter table c_user add column sys_period_start datetime(6) default now(6); +alter table c_user add column sys_period_end datetime(6); +update c_user set sys_period_start = when_created; +create table c_user_history( + id bigint, + inactive tinyint(1), + name varchar(255), + email varchar(255), + password_hash varchar(255), + group_id bigint, + version bigint, + when_created datetime(6), + when_modified datetime(6), + sys_period_start datetime(6), + sys_period_end datetime(6) +); +create view c_user_with_history as select * from c_user union all select * from c_user_history; + +delimiter $$ +create trigger hx_link_history_upd before update on hx_link for each row begin + insert into hx_link_history (sys_period_start,sys_period_end,id, name, location, comments, version, when_created, when_modified, deleted) values (OLD.sys_period_start, now(6),OLD.id, OLD.name, OLD.location, OLD.comments, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); + set NEW.sys_period_start = now(6); +end$$ +delimiter $$ +create trigger hx_link_history_del before delete on hx_link for each row begin + insert into hx_link_history (sys_period_start,sys_period_end,id, name, location, comments, version, when_created, when_modified, deleted) values (OLD.sys_period_start, now(6),OLD.id, OLD.name, OLD.location, OLD.comments, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); +end$$ +delimiter $$ +create trigger hi_link_history_upd before update on hi_link for each row begin + insert into hi_link_history (sys_period_start,sys_period_end,id, name, location, comments, version, when_created, when_modified) values (OLD.sys_period_start, now(6),OLD.id, OLD.name, OLD.location, OLD.comments, OLD.version, OLD.when_created, OLD.when_modified); + set NEW.sys_period_start = now(6); +end$$ +delimiter $$ +create trigger hi_link_history_del before delete on hi_link for each row begin + insert into hi_link_history (sys_period_start,sys_period_end,id, name, location, comments, version, when_created, when_modified) values (OLD.sys_period_start, now(6),OLD.id, OLD.name, OLD.location, OLD.comments, OLD.version, OLD.when_created, OLD.when_modified); +end$$ +delimiter $$ +create trigger hi_link_doc_history_upd before update on hi_link_doc for each row begin + insert into hi_link_doc_history (sys_period_start,sys_period_end,hi_link_id, hi_doc_id) values (OLD.sys_period_start, now(6),OLD.hi_link_id, OLD.hi_doc_id); + set NEW.sys_period_start = now(6); +end$$ +delimiter $$ +create trigger hi_link_doc_history_del before delete on hi_link_doc for each row begin + insert into hi_link_doc_history (sys_period_start,sys_period_end,hi_link_id, hi_doc_id) values (OLD.sys_period_start, now(6),OLD.hi_link_id, OLD.hi_doc_id); +end$$ +delimiter $$ +create trigger hi_tone_history_upd before update on hi_tone for each row begin + insert into hi_tone_history (sys_period_start,sys_period_end,id, name, comments, version, when_created, when_modified) values (OLD.sys_period_start, now(6),OLD.id, OLD.name, OLD.comments, OLD.version, OLD.when_created, OLD.when_modified); + set NEW.sys_period_start = now(6); +end$$ +delimiter $$ +create trigger hi_tone_history_del before delete on hi_tone for each row begin + insert into hi_tone_history (sys_period_start,sys_period_end,id, name, comments, version, when_created, when_modified) values (OLD.sys_period_start, now(6),OLD.id, OLD.name, OLD.comments, OLD.version, OLD.when_created, OLD.when_modified); +end$$ +delimiter $$ +create trigger hi_tthree_history_upd before update on hi_tthree for each row begin + insert into hi_tthree_history (sys_period_start,sys_period_end,id, hi_ttwo_id, three, version, when_created, when_modified) values (OLD.sys_period_start, now(6),OLD.id, OLD.hi_ttwo_id, OLD.three, OLD.version, OLD.when_created, OLD.when_modified); + set NEW.sys_period_start = now(6); +end$$ +delimiter $$ +create trigger hi_tthree_history_del before delete on hi_tthree for each row begin + insert into hi_tthree_history (sys_period_start,sys_period_end,id, hi_ttwo_id, three, version, when_created, when_modified) values (OLD.sys_period_start, now(6),OLD.id, OLD.hi_ttwo_id, OLD.three, OLD.version, OLD.when_created, OLD.when_modified); +end$$ +delimiter $$ +create trigger hi_ttwo_history_upd before update on hi_ttwo for each row begin + insert into hi_ttwo_history (sys_period_start,sys_period_end,id, hi_tone_id, two, version, when_created, when_modified) values (OLD.sys_period_start, now(6),OLD.id, OLD.hi_tone_id, OLD.two, OLD.version, OLD.when_created, OLD.when_modified); + set NEW.sys_period_start = now(6); +end$$ +delimiter $$ +create trigger hi_ttwo_history_del before delete on hi_ttwo for each row begin + insert into hi_ttwo_history (sys_period_start,sys_period_end,id, hi_tone_id, two, version, when_created, when_modified) values (OLD.sys_period_start, now(6),OLD.id, OLD.hi_tone_id, OLD.two, OLD.version, OLD.when_created, OLD.when_modified); +end$$ +delimiter $$ +create trigger hsd_setting_history_upd before update on hsd_setting for each row begin + insert into hsd_setting_history (sys_period_start,sys_period_end,id, code, content, user_id, version, when_created, when_modified, deleted) values (OLD.sys_period_start, now(6),OLD.id, OLD.code, OLD.content, OLD.user_id, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); + set NEW.sys_period_start = now(6); +end$$ +delimiter $$ +create trigger hsd_setting_history_del before delete on hsd_setting for each row begin + insert into hsd_setting_history (sys_period_start,sys_period_end,id, code, content, user_id, version, when_created, when_modified, deleted) values (OLD.sys_period_start, now(6),OLD.id, OLD.code, OLD.content, OLD.user_id, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); +end$$ +delimiter $$ +create trigger hsd_user_history_upd before update on hsd_user for each row begin + insert into hsd_user_history (sys_period_start,sys_period_end,id, name, version, when_created, when_modified, deleted) values (OLD.sys_period_start, now(6),OLD.id, OLD.name, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); + set NEW.sys_period_start = now(6); +end$$ +delimiter $$ +create trigger hsd_user_history_del before delete on hsd_user for each row begin + insert into hsd_user_history (sys_period_start,sys_period_end,id, name, version, when_created, when_modified, deleted) values (OLD.sys_period_start, now(6),OLD.id, OLD.name, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); +end$$ +delimiter $$ +create trigger link_history_upd before update on link for each row begin + insert into link_history (sys_period_start,sys_period_end,id, name, location, when_publish, link_comment, version, when_created, when_modified, deleted) values (OLD.sys_period_start, now(6),OLD.id, OLD.name, OLD.location, OLD.when_publish, OLD.link_comment, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); + set NEW.sys_period_start = now(6); +end$$ +delimiter $$ +create trigger link_history_del before delete on link for each row begin + insert into link_history (sys_period_start,sys_period_end,id, name, location, when_publish, link_comment, version, when_created, when_modified, deleted) values (OLD.sys_period_start, now(6),OLD.id, OLD.name, OLD.location, OLD.when_publish, OLD.link_comment, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); +end$$ +delimiter $$ +create trigger c_user_history_upd before update on c_user for each row begin + insert into c_user_history (sys_period_start,sys_period_end,id, inactive, name, email, group_id, version, when_created, when_modified) values (OLD.sys_period_start, now(6),OLD.id, OLD.inactive, OLD.name, OLD.email, OLD.group_id, OLD.version, OLD.when_created, OLD.when_modified); + set NEW.sys_period_start = now(6); +end$$ +delimiter $$ +create trigger c_user_history_del before delete on c_user for each row begin + insert into c_user_history (sys_period_start,sys_period_end,id, inactive, name, email, group_id, version, when_created, when_modified) values (OLD.sys_period_start, now(6),OLD.id, OLD.inactive, OLD.name, OLD.email, OLD.group_id, OLD.version, OLD.when_created, OLD.when_modified); +end$$ diff --git a/ebean-core/src/test/ddl-review/mysql-drop-all.sql b/ebean-core/src/test/ddl-review/mysql-drop-all.sql new file mode 100644 index 000000000..eb2ce81b6 --- /dev/null +++ b/ebean-core/src/test/ddl-review/mysql-drop-all.sql @@ -0,0 +1,1867 @@ +-- Generated by ebean unknown at 2020-02-21T19:45:37.488834Z +alter table bar drop foreign key fk_bar_foo_id; +drop index ix_bar_foo_id on bar; + +alter table acl_container_relation drop foreign key fk_acl_container_relation_container_id; +drop index ix_acl_container_relation_container_id on acl_container_relation; + +alter table acl_container_relation drop foreign key fk_acl_container_relation_acl_entry_id; +drop index ix_acl_container_relation_acl_entry_id on acl_container_relation; + +alter table addr drop foreign key fk_addr_employee_id; +drop index ix_addr_employee_id on addr; + +alter table o_address drop foreign key fk_o_address_country_code; +drop index ix_o_address_country_code on o_address; + +alter table album drop foreign key fk_album_cover_id; + +alter table animal drop foreign key fk_animal_shelter_id; +drop index ix_animal_shelter_id on animal; + +alter table attribute drop foreign key fk_attribute_attribute_holder_id; +drop index ix_attribute_attribute_holder_id on attribute; + +alter table bbookmark drop foreign key fk_bbookmark_user_id; +drop index ix_bbookmark_user_id on bbookmark; + +alter table bbookmark_user drop foreign key fk_bbookmark_user_org_id; +drop index ix_bbookmark_user_org_id on bbookmark_user; + +alter table bsite_user_a drop foreign key fk_bsite_user_a_site_id; +drop index ix_bsite_user_a_site_id on bsite_user_a; + +alter table bsite_user_a drop foreign key fk_bsite_user_a_user_id; +drop index ix_bsite_user_a_user_id on bsite_user_a; + +alter table bsite_user_b drop foreign key fk_bsite_user_b_site; +drop index ix_bsite_user_b_site on bsite_user_b; + +alter table bsite_user_b drop foreign key fk_bsite_user_b_usr; +drop index ix_bsite_user_b_usr on bsite_user_b; + +alter table bsite_user_c drop foreign key fk_bsite_user_c_site_uid; +drop index ix_bsite_user_c_site_uid on bsite_user_c; + +alter table bsite_user_c drop foreign key fk_bsite_user_c_user_uid; +drop index ix_bsite_user_c_user_uid on bsite_user_c; + +alter table bsite_user_e drop foreign key fk_bsite_user_e_site_id; +drop index ix_bsite_user_e_site_id on bsite_user_e; + +alter table bsite_user_e drop foreign key fk_bsite_user_e_user_id; +drop index ix_bsite_user_e_user_id on bsite_user_e; + +alter table basic_draftable_bean drop foreign key fk_basic_draftable_bean_id; + +alter table drel_booking drop foreign key fk_drel_booking_agent_invoice; + +alter table drel_booking drop foreign key fk_drel_booking_client_invoice; + +alter table cepproduct_category drop foreign key fk_cepproduct_category_category_id; +drop index ix_cepproduct_category_category_id on cepproduct_category; + +alter table cepproduct_category drop foreign key fk_cepproduct_category_product_id; +drop index ix_cepproduct_category_product_id on cepproduct_category; + +alter table cinh_ref drop foreign key fk_cinh_ref_ref_id; +drop index ix_cinh_ref_ref_id on cinh_ref; + +alter table ckey_detail drop foreign key fk_ckey_detail_parent; +drop index ix_ckey_detail_parent on ckey_detail; + +alter table ckey_parent drop foreign key fk_ckey_parent_assoc_id; +drop index ix_ckey_parent_assoc_id on ckey_parent; + +alter table coone_many drop foreign key fk_coone_many_coone_id; +drop index ix_coone_many_coone_id on coone_many; + +alter table coroot drop foreign key fk_coroot_one_id; + +alter table calculation_result drop foreign key fk_calculation_result_product_configuration_id; +drop index ix_calculation_result_product_configuration_id on calculation_result; + +alter table calculation_result drop foreign key fk_calculation_result_group_configuration_id; +drop index ix_calculation_result_group_configuration_id on calculation_result; + +alter table sp_car_car_wheels drop foreign key fk_sp_car_car_wheels_sp_car_car; +drop index ix_sp_car_car_wheels_sp_car_car on sp_car_car_wheels; + +alter table sp_car_car_wheels drop foreign key fk_sp_car_car_wheels_sp_car_wheel; +drop index ix_sp_car_car_wheels_sp_car_wheel on sp_car_car_wheels; + +alter table sp_car_car_doors drop foreign key fk_sp_car_car_doors_sp_car_car; +drop index ix_sp_car_car_doors_sp_car_car on sp_car_car_doors; + +alter table sp_car_car_doors drop foreign key fk_sp_car_car_doors_sp_car_door; +drop index ix_sp_car_car_doors_sp_car_door on sp_car_car_doors; + +alter table car_accessory drop foreign key fk_car_accessory_fuse_id; +drop index ix_car_accessory_fuse_id on car_accessory; + +alter table car_accessory drop foreign key fk_car_accessory_car_id; +drop index ix_car_accessory_car_id on car_accessory; + +alter table category drop foreign key fk_category_surveyobjectid; +drop index ix_category_surveyobjectid on category; + +alter table e_save_test_d drop foreign key fk_e_save_test_d_parent_id; + +alter table child_person drop foreign key fk_child_person_some_bean_id; +drop index ix_child_person_some_bean_id on child_person; + +alter table child_person drop foreign key fk_child_person_parent_identifier; +drop index ix_child_person_parent_identifier on child_person; + +alter table cke_client drop foreign key fk_cke_client_user; +drop index ix_cke_client_user on cke_client; + +alter table class_super_monkey drop foreign key fk_class_super_monkey_class_super; + +alter table class_super_monkey drop foreign key fk_class_super_monkey_monkey; + +alter table configuration drop foreign key fk_configuration_configurations_id; +drop index ix_configuration_configurations_id on configuration; + +alter table contact drop foreign key fk_contact_customer_id; +drop index ix_contact_customer_id on contact; + +alter table contact drop foreign key fk_contact_group_id; +drop index ix_contact_group_id on contact; + +alter table contact_note drop foreign key fk_contact_note_contact_id; +drop index ix_contact_note_contact_id on contact_note; + +alter table contract_costs drop foreign key fk_contract_costs_position_id; +drop index ix_contract_costs_position_id on contract_costs; + +alter table c_conversation drop foreign key fk_c_conversation_group_id; +drop index ix_c_conversation_group_id on c_conversation; + +alter table o_customer drop foreign key fk_o_customer_billing_address_id; +drop index ix_o_customer_billing_address_id on o_customer; + +alter table o_customer drop foreign key fk_o_customer_shipping_address_id; +drop index ix_o_customer_shipping_address_id on o_customer; + +alter table dcredit_drol drop foreign key fk_dcredit_drol_dcredit; +drop index ix_dcredit_drol_dcredit on dcredit_drol; + +alter table dcredit_drol drop foreign key fk_dcredit_drol_drol; +drop index ix_dcredit_drol_drol on dcredit_drol; + +alter table dmachine drop foreign key fk_dmachine_organisation_id; +drop index ix_dmachine_organisation_id on dmachine; + +alter table d_machine_aux_use drop foreign key fk_d_machine_aux_use_machine_id; +drop index ix_d_machine_aux_use_machine_id on d_machine_aux_use; + +alter table d_machine_stats drop foreign key fk_d_machine_stats_machine_id; +drop index ix_d_machine_stats_machine_id on d_machine_stats; + +alter table d_machine_use drop foreign key fk_d_machine_use_machine_id; +drop index ix_d_machine_use_machine_id on d_machine_use; + +alter table drot_drol drop foreign key fk_drot_drol_drot; +drop index ix_drot_drol_drot on drot_drol; + +alter table drot_drol drop foreign key fk_drot_drol_drol; +drop index ix_drot_drol_drol on drot_drol; + +alter table dc_detail drop foreign key fk_dc_detail_master_id; +drop index ix_dc_detail_master_id on dc_detail; + +alter table dfk_cascade drop foreign key fk_dfk_cascade_one_id; +drop index ix_dfk_cascade_one_id on dfk_cascade; + +alter table dfk_set_null drop foreign key fk_dfk_set_null_one_id; +drop index ix_dfk_set_null_one_id on dfk_set_null; + +alter table doc drop foreign key fk_doc_id; + +alter table doc_link drop foreign key fk_doc_link_doc; +drop index ix_doc_link_doc on doc_link; + +alter table doc_link drop foreign key fk_doc_link_link; +drop index ix_doc_link_link on doc_link; + +alter table document drop foreign key fk_document_id; + +alter table document drop foreign key fk_document_organisation_id; +drop index ix_document_organisation_id on document; + +alter table document_draft drop foreign key fk_document_draft_organisation_id; +drop index ix_document_draft_organisation_id on document_draft; + +alter table document_media drop foreign key fk_document_media_document_id; +drop index ix_document_media_document_id on document_media; + +alter table document_media_draft drop foreign key fk_document_media_draft_document_id; +drop index ix_document_media_draft_document_id on document_media_draft; + +alter table e_basicenc_relate drop foreign key fk_e_basicenc_relate_other_id; +drop index ix_e_basicenc_relate_other_id on e_basicenc_relate; + +alter table ebasic_json_map_detail drop foreign key fk_ebasic_json_map_detail_owner_id; +drop index ix_ebasic_json_map_detail_owner_id on ebasic_json_map_detail; + +alter table ebasic_no_sdchild drop foreign key fk_ebasic_no_sdchild_owner_id; +drop index ix_ebasic_no_sdchild_owner_id on ebasic_no_sdchild; + +alter table ebasic_sdchild drop foreign key fk_ebasic_sdchild_owner_id; +drop index ix_ebasic_sdchild_owner_id on ebasic_sdchild; + +alter table ecache_child drop foreign key fk_ecache_child_root_id; +drop index ix_ecache_child_root_id on ecache_child; + +alter table edefault_prop drop foreign key fk_edefault_prop_e_simple_usertypeid; + +alter table eemb_inner drop foreign key fk_eemb_inner_outer_id; +drop index ix_eemb_inner_outer_id on eemb_inner; + +alter table einvoice drop foreign key fk_einvoice_person_id; +drop index ix_einvoice_person_id on einvoice; + +alter table enull_collection_detail drop foreign key fk_enull_collection_detail_enull_collection_id; +drop index ix_enull_collection_detail_enull_collection_id on enull_collection_detail; + +alter table eopt_one_a drop foreign key fk_eopt_one_a_b_id; +drop index ix_eopt_one_a_b_id on eopt_one_a; + +alter table eopt_one_b drop foreign key fk_eopt_one_b_c_id; +drop index ix_eopt_one_b_c_id on eopt_one_b; + +alter table eper_addr drop foreign key fk_eper_addr_ma_country_code; +drop index ix_eper_addr_ma_country_code on eper_addr; + +alter table esoft_del_book drop foreign key fk_esoft_del_book_lend_by_id; +drop index ix_esoft_del_book_lend_by_id on esoft_del_book; + +alter table esoft_del_book_esoft_del_user drop foreign key fk_esoft_del_book_esoft_del_user_esoft_del_book; +drop index ix_esoft_del_book_esoft_del_user_esoft_del_book on esoft_del_book_esoft_del_user; + +alter table esoft_del_book_esoft_del_user drop foreign key fk_esoft_del_book_esoft_del_user_esoft_del_user; +drop index ix_esoft_del_book_esoft_del_user_esoft_del_user on esoft_del_book_esoft_del_user; + +alter table esoft_del_down drop foreign key fk_esoft_del_down_esoft_del_mid_id; +drop index ix_esoft_del_down_esoft_del_mid_id on esoft_del_down; + +alter table esoft_del_mid drop foreign key fk_esoft_del_mid_top_id; +drop index ix_esoft_del_mid_top_id on esoft_del_mid; + +alter table esoft_del_mid drop foreign key fk_esoft_del_mid_up_id; +drop index ix_esoft_del_mid_up_id on esoft_del_mid; + +alter table esoft_del_one_a drop foreign key fk_esoft_del_one_a_oneb_id; + +alter table esoft_del_role_esoft_del_user drop foreign key fk_esoft_del_role_esoft_del_user_esoft_del_role; +drop index ix_esoft_del_role_esoft_del_user_esoft_del_role on esoft_del_role_esoft_del_user; + +alter table esoft_del_role_esoft_del_user drop foreign key fk_esoft_del_role_esoft_del_user_esoft_del_user; +drop index ix_esoft_del_role_esoft_del_user_esoft_del_user on esoft_del_role_esoft_del_user; + +alter table esoft_del_user_esoft_del_role drop foreign key fk_esoft_del_user_esoft_del_role_esoft_del_user; +drop index ix_esoft_del_user_esoft_del_role_esoft_del_user on esoft_del_user_esoft_del_role; + +alter table esoft_del_user_esoft_del_role drop foreign key fk_esoft_del_user_esoft_del_role_esoft_del_role; +drop index ix_esoft_del_user_esoft_del_role_esoft_del_role on esoft_del_user_esoft_del_role; + +alter table rawinherit_uncle drop foreign key fk_rawinherit_uncle_parent_id; +drop index ix_rawinherit_uncle_parent_id on rawinherit_uncle; + +alter table evanilla_collection_detail drop foreign key fk_evanilla_collection_detail_evanilla_collection_id; +drop index ix_evanilla_collection_detail_evanilla_collection_id on evanilla_collection_detail; + +alter table ec_enum_person_tags drop foreign key fk_ec_enum_person_tags_ec_enum_person_id; +drop index ix_ec_enum_person_tags_ec_enum_person_id on ec_enum_person_tags; + +alter table ec_person_phone drop foreign key fk_ec_person_phone_owner_id; +drop index ix_ec_person_phone_owner_id on ec_person_phone; + +alter table ec_top drop foreign key fk_ec_top_person_id; +drop index ix_ec_top_person_id on ec_top; + +alter table ec_top_ecs_person drop foreign key fk_ec_top_ecs_person_ec_top; +drop index ix_ec_top_ecs_person_ec_top on ec_top_ecs_person; + +alter table ec_top_ecs_person drop foreign key fk_ec_top_ecs_person_ecs_person; +drop index ix_ec_top_ecs_person_ecs_person on ec_top_ecs_person; + +alter table ecbl_person_phone_numbers drop foreign key fk_ecbl_person_phone_numbers_person_id; +drop index ix_ecbl_person_phone_numbers_person_id on ecbl_person_phone_numbers; + +alter table ecbm_person_phone_numbers drop foreign key fk_ecbm_person_phone_numbers_person_id; +drop index ix_ecbm_person_phone_numbers_person_id on ecbm_person_phone_numbers; + +alter table ecm_person_phone_numbers drop foreign key fk_ecm_person_phone_numbers_ecm_person_id; +drop index ix_ecm_person_phone_numbers_ecm_person_id on ecm_person_phone_numbers; + +alter table ecmc_person_phone_numbers drop foreign key fk_ecmc_person_phone_numbers_ecmc_person_id; +drop index ix_ecmc_person_phone_numbers_ecmc_person_id on ecmc_person_phone_numbers; + +alter table ecs_person_phone drop foreign key fk_ecs_person_phone_ecs_person_id; +drop index ix_ecs_person_phone_ecs_person_id on ecs_person_phone; + +alter table ecsm_child drop foreign key fk_ecsm_child_ecsm_parent_id; +drop index ix_ecsm_child_ecsm_parent_id on ecsm_child; + +alter table td_child drop foreign key fk_td_child_parent_id; +drop index ix_td_child_parent_id on td_child; + +alter table element_bean drop foreign key fk_element_bean_complex_bean_id; +drop index ix_element_bean_complex_bean_id on element_bean; + +alter table empl drop foreign key fk_empl_default_address_id; +drop index ix_empl_default_address_id on empl; + +alter table esd_detail drop foreign key fk_esd_detail_master_id; +drop index ix_esd_detail_master_id on esd_detail; + +alter table grand_parent_person drop foreign key fk_grand_parent_person_some_bean_id; +drop index ix_grand_parent_person_some_bean_id on grand_parent_person; + +alter table survey_group drop foreign key fk_survey_group_categoryobjectid; +drop index ix_survey_group_categoryobjectid on survey_group; + +alter table hx_link_doc drop foreign key fk_hx_link_doc_hx_link; +drop index ix_hx_link_doc_hx_link on hx_link_doc; + +alter table hx_link_doc drop foreign key fk_hx_link_doc_he_doc; +drop index ix_hx_link_doc_he_doc on hx_link_doc; + +alter table hi_link_doc drop foreign key fk_hi_link_doc_hi_link; +drop index ix_hi_link_doc_hi_link on hi_link_doc; + +alter table hi_link_doc drop foreign key fk_hi_link_doc_hi_doc; +drop index ix_hi_link_doc_hi_doc on hi_link_doc; + +alter table hi_tthree drop foreign key fk_hi_tthree_hi_ttwo_id; +drop index ix_hi_tthree_hi_ttwo_id on hi_tthree; + +alter table hi_ttwo drop foreign key fk_hi_ttwo_hi_tone_id; +drop index ix_hi_ttwo_hi_tone_id on hi_ttwo; + +alter table hsd_setting drop foreign key fk_hsd_setting_user_id; + +alter table iaf_segment drop foreign key fk_iaf_segment_status_id; +drop index ix_iaf_segment_status_id on iaf_segment; + +alter table imrelated drop foreign key fk_imrelated_owner_id; +drop index ix_imrelated_owner_id on imrelated; + +alter table info_contact drop foreign key fk_info_contact_company_id; +drop index ix_info_contact_company_id on info_contact; + +alter table info_customer drop foreign key fk_info_customer_company_id; + +alter table inner_report drop foreign key fk_inner_report_forecast_id; + +alter table drel_invoice drop foreign key fk_drel_invoice_booking; +drop index ix_drel_invoice_booking on drel_invoice; + +alter table item drop foreign key fk_item_etype; +drop index ix_item_etype on item; + +alter table item drop foreign key fk_item_eregion; +drop index ix_item_eregion on item; + +alter table mkeygroup_monkey drop foreign key fk_mkeygroup_monkey_mkeygroup; + +alter table mkeygroup_monkey drop foreign key fk_mkeygroup_monkey_monkey; + +alter table trainer_monkey drop foreign key fk_trainer_monkey_trainer; + +alter table trainer_monkey drop foreign key fk_trainer_monkey_monkey; + +alter table troop_monkey drop foreign key fk_troop_monkey_troop; + +alter table troop_monkey drop foreign key fk_troop_monkey_monkey; + +alter table l2_cldf_reset_bean_child drop foreign key fk_l2_cldf_reset_bean_child_parent_id; +drop index ix_l2_cldf_reset_bean_child_parent_id on l2_cldf_reset_bean_child; + +alter table level1_level4 drop foreign key fk_level1_level4_level1; +drop index ix_level1_level4_level1 on level1_level4; + +alter table level1_level4 drop foreign key fk_level1_level4_level4; +drop index ix_level1_level4_level4 on level1_level4; + +alter table level1_level2 drop foreign key fk_level1_level2_level1; +drop index ix_level1_level2_level1 on level1_level2; + +alter table level1_level2 drop foreign key fk_level1_level2_level2; +drop index ix_level1_level2_level2 on level1_level2; + +alter table level2_level3 drop foreign key fk_level2_level3_level2; +drop index ix_level2_level3_level2 on level2_level3; + +alter table level2_level3 drop foreign key fk_level2_level3_level3; +drop index ix_level2_level3_level3 on level2_level3; + +alter table link drop foreign key fk_link_id; + +alter table la_attr_value_attribute drop foreign key fk_la_attr_value_attribute_la_attr_value; +drop index ix_la_attr_value_attribute_la_attr_value on la_attr_value_attribute; + +alter table la_attr_value_attribute drop foreign key fk_la_attr_value_attribute_attribute; +drop index ix_la_attr_value_attribute_attribute on la_attr_value_attribute; + +alter table looney drop foreign key fk_looney_tune_id; +drop index ix_looney_tune_id on looney; + +alter table mcontact drop foreign key fk_mcontact_customer_id; +drop index ix_mcontact_customer_id on mcontact; + +alter table mcontact_message drop foreign key fk_mcontact_message_contact_id; +drop index ix_mcontact_message_contact_id on mcontact_message; + +alter table mcustomer drop foreign key fk_mcustomer_shipping_address_id; +drop index ix_mcustomer_shipping_address_id on mcustomer; + +alter table mcustomer drop foreign key fk_mcustomer_billing_address_id; +drop index ix_mcustomer_billing_address_id on mcustomer; + +alter table mmachine_mgroup drop foreign key fk_mmachine_mgroup_mmachine; +drop index ix_mmachine_mgroup_mmachine on mmachine_mgroup; + +alter table mmachine_mgroup drop foreign key fk_mmachine_mgroup_mgroup; +drop index ix_mmachine_mgroup_mgroup on mmachine_mgroup; + +alter table mprinter drop foreign key fk_mprinter_current_state_id; +drop index ix_mprinter_current_state_id on mprinter; + +alter table mprinter drop foreign key fk_mprinter_last_swap_cyan_id; + +alter table mprinter drop foreign key fk_mprinter_last_swap_magenta_id; + +alter table mprinter drop foreign key fk_mprinter_last_swap_yellow_id; + +alter table mprinter drop foreign key fk_mprinter_last_swap_black_id; + +alter table mprinter_state drop foreign key fk_mprinter_state_printer_id; +drop index ix_mprinter_state_printer_id on mprinter_state; + +alter table mprofile drop foreign key fk_mprofile_picture_id; +drop index ix_mprofile_picture_id on mprofile; + +alter table mrole_muser drop foreign key fk_mrole_muser_mrole; +drop index ix_mrole_muser_mrole on mrole_muser; + +alter table mrole_muser drop foreign key fk_mrole_muser_muser; +drop index ix_mrole_muser_muser on mrole_muser; + +alter table muser drop foreign key fk_muser_user_type_id; +drop index ix_muser_user_type_id on muser; + +alter table mail_user_inbox drop foreign key fk_mail_user_inbox_mail_user; +drop index ix_mail_user_inbox_mail_user on mail_user_inbox; + +alter table mail_user_inbox drop foreign key fk_mail_user_inbox_mail_box; +drop index ix_mail_user_inbox_mail_box on mail_user_inbox; + +alter table mail_user_outbox drop foreign key fk_mail_user_outbox_mail_user; +drop index ix_mail_user_outbox_mail_user on mail_user_outbox; + +alter table mail_user_outbox drop foreign key fk_mail_user_outbox_mail_box; +drop index ix_mail_user_outbox_mail_box on mail_user_outbox; + +alter table c_message drop foreign key fk_c_message_conversation_id; +drop index ix_c_message_conversation_id on c_message; + +alter table c_message drop foreign key fk_c_message_user_id; +drop index ix_c_message_user_id on c_message; + +alter table meter_contract_data drop foreign key fk_meter_contract_data_special_needs_client_id; + +alter table meter_special_needs_client drop foreign key fk_meter_special_needs_client_primary_id; + +alter table meter_version drop foreign key fk_meter_version_address_data_id; + +alter table meter_version drop foreign key fk_meter_version_contract_data_id; + +alter table mnoc_user_mnoc_role drop foreign key fk_mnoc_user_mnoc_role_mnoc_user; +drop index ix_mnoc_user_mnoc_role_mnoc_user on mnoc_user_mnoc_role; + +alter table mnoc_user_mnoc_role drop foreign key fk_mnoc_user_mnoc_role_mnoc_role; +drop index ix_mnoc_user_mnoc_role_mnoc_role on mnoc_user_mnoc_role; + +alter table mny_b drop foreign key fk_mny_b_a_id; +drop index ix_mny_b_a_id on mny_b; + +alter table mny_b_mny_c drop foreign key fk_mny_b_mny_c_mny_b; +drop index ix_mny_b_mny_c_mny_b on mny_b_mny_c; + +alter table mny_b_mny_c drop foreign key fk_mny_b_mny_c_mny_c; +drop index ix_mny_b_mny_c_mny_c on mny_b_mny_c; + +alter table subtopics drop foreign key fk_subtopics_mny_topic_1; +drop index ix_subtopics_mny_topic_1 on subtopics; + +alter table subtopics drop foreign key fk_subtopics_mny_topic_2; +drop index ix_subtopics_mny_topic_2 on subtopics; + +alter table mp_role drop foreign key fk_mp_role_mp_user_id; +drop index ix_mp_role_mp_user_id on mp_role; + +alter table ms_many_a_many_b drop foreign key fk_ms_many_a_many_b_ms_many_a; +drop index ix_ms_many_a_many_b_ms_many_a on ms_many_a_many_b; + +alter table ms_many_a_many_b drop foreign key fk_ms_many_a_many_b_ms_many_b; +drop index ix_ms_many_a_many_b_ms_many_b on ms_many_a_many_b; + +alter table ms_many_b_many_a drop foreign key fk_ms_many_b_many_a_ms_many_b; +drop index ix_ms_many_b_many_a_ms_many_b on ms_many_b_many_a; + +alter table ms_many_b_many_a drop foreign key fk_ms_many_b_many_a_ms_many_a; +drop index ix_ms_many_b_many_a_ms_many_a on ms_many_b_many_a; + +alter table my_lob_size_join_many drop foreign key fk_my_lob_size_join_many_parent_id; +drop index ix_my_lob_size_join_many_parent_id on my_lob_size_join_many; + +alter table o_bean_child drop foreign key fk_o_bean_child_cached_bean_id; +drop index ix_o_bean_child_cached_bean_id on o_bean_child; + +alter table ocached_app_detail drop foreign key fk_ocached_app_detail_app_id; +drop index ix_ocached_app_detail_app_id on ocached_app_detail; + +alter table o_cached_bean_country drop foreign key fk_o_cached_bean_country_o_cached_bean; +drop index ix_o_cached_bean_country_o_cached_bean on o_cached_bean_country; + +alter table o_cached_bean_country drop foreign key fk_o_cached_bean_country_o_country; +drop index ix_o_cached_bean_country_o_country on o_cached_bean_country; + +alter table o_cached_bean_child drop foreign key fk_o_cached_bean_child_cached_bean_id; +drop index ix_o_cached_bean_child_cached_bean_id on o_cached_bean_child; + +alter table oengine drop foreign key fk_oengine_car_id; + +alter table ogear_box drop foreign key fk_ogear_box_car_id; + +alter table omvertex_other drop foreign key fk_omvertex_other_omvertex_id; +drop index ix_omvertex_other_omvertex_id on omvertex_other; + +alter table oroad_show_msg drop foreign key fk_oroad_show_msg_company_id; + +alter table om_account_child_dbo drop foreign key fk_om_account_child_dbo_banana_rama_id; +drop index ix_om_account_child_dbo_banana_rama_id on om_account_child_dbo; + +alter table om_basic_child drop foreign key fk_om_basic_child_parent_id; +drop index ix_om_basic_child_parent_id on om_basic_child; + +alter table om_ordered_detail drop foreign key fk_om_ordered_detail_master_id; +drop index ix_om_ordered_detail_master_id on om_ordered_detail; + +alter table o_order drop foreign key fk_o_order_kcustomer_id; +drop index ix_o_order_kcustomer_id on o_order; + +alter table o_order_detail drop foreign key fk_o_order_detail_order_id; +drop index ix_o_order_detail_order_id on o_order_detail; + +alter table o_order_detail drop foreign key fk_o_order_detail_product_id; +drop index ix_o_order_detail_product_id on o_order_detail; + +alter table s_order_items drop foreign key fk_s_order_items_order_uuid; +drop index ix_s_order_items_order_uuid on s_order_items; + +alter table or_order_ship drop foreign key fk_or_order_ship_order_id; +drop index ix_or_order_ship_order_id on or_order_ship; + +alter table organization_node drop foreign key fk_organization_node_parent_tree_node_id; + +alter table orp_detail drop foreign key fk_orp_detail_master_id; +drop index ix_orp_detail_master_id on orp_detail; + +alter table orp_detail2 drop foreign key fk_orp_detail2_orp_master2_id; +drop index ix_orp_detail2_orp_master2_id on orp_detail2; + +alter table oto_atwo drop foreign key fk_oto_atwo_aone_id; + +alter table oto_bchild drop foreign key fk_oto_bchild_master_id; + +alter table oto_child drop foreign key fk_oto_child_master_id; + +alter table oto_cust_address drop foreign key fk_oto_cust_address_customer_cid; + +alter table oto_level_a drop foreign key fk_oto_level_a_b_id; + +alter table oto_level_b drop foreign key fk_oto_level_b_c_id; + +alter table oto_prime_extra drop foreign key fk_oto_prime_extra_eid; + +alter table oto_sd_child drop foreign key fk_oto_sd_child_master_id; + +alter table oto_th_many drop foreign key fk_oto_th_many_oto_th_top_id; +drop index ix_oto_th_many_oto_th_top_id on oto_th_many; + +alter table oto_th_one drop foreign key fk_oto_th_one_many_id; + +alter table oto_ubprime_extra drop foreign key fk_oto_ubprime_extra_eid; + +alter table oto_user_model drop foreign key fk_oto_user_model_user_optional_id; + +alter table pfile drop foreign key fk_pfile_file_content_id; + +alter table pfile drop foreign key fk_pfile_file_content2_id; + +alter table paggview drop foreign key fk_paggview_pview_id; + +alter table pallet_location drop foreign key fk_pallet_location_zone_sid; +drop index ix_pallet_location_zone_sid on pallet_location; + +alter table parcel_location drop foreign key fk_parcel_location_parcelid; + +alter table rawinherit_parent_rawinherit_data drop foreign key fk_rawinherit_parent_rawinherit_data_rawinherit_parent; +drop index ix_rawinherit_parent_rawinherit_data_rawinherit_parent on rawinherit_parent_rawinherit_data; + +alter table rawinherit_parent_rawinherit_data drop foreign key fk_rawinherit_parent_rawinherit_data_rawinherit_data; +drop index ix_rawinherit_parent_rawinherit_data_rawinherit_data on rawinherit_parent_rawinherit_data; + +alter table parent_person drop foreign key fk_parent_person_some_bean_id; +drop index ix_parent_person_some_bean_id on parent_person; + +alter table parent_person drop foreign key fk_parent_person_parent_identifier; +drop index ix_parent_person_parent_identifier on parent_person; + +alter table c_participation drop foreign key fk_c_participation_conversation_id; +drop index ix_c_participation_conversation_id on c_participation; + +alter table c_participation drop foreign key fk_c_participation_user_id; +drop index ix_c_participation_user_id on c_participation; + +alter table pcf_calendar drop foreign key fk_pcf_calendar_pcf_person_id; +drop index ix_pcf_calendar_pcf_person_id on pcf_calendar; + +alter table pcf_city drop foreign key fk_pcf_city_pcf_country_id; +drop index ix_pcf_city_pcf_country_id on pcf_city; + +alter table pcf_city drop foreign key fk_pcf_city_mayor_id; + +alter table pcf_city drop foreign key fk_pcf_city_vice_mayor_id; + +alter table pcf_event drop foreign key fk_pcf_event_pcf_calendar_id; +drop index ix_pcf_event_pcf_calendar_id on pcf_event; + +alter table persistent_file_content drop foreign key fk_persistent_file_content_persistent_file_id; + +alter table person drop foreign key fk_person_default_address_oid; +drop index ix_person_default_address_oid on person; + +alter table person_cache_email drop foreign key fk_person_cache_email_person_info_person_id; +drop index ix_person_cache_email_person_info_person_id on person_cache_email; + +alter table phones drop foreign key fk_phones_person_id; +drop index ix_phones_person_id on phones; + +alter table e_position drop foreign key fk_e_position_contract_id; +drop index ix_e_position_contract_id on e_position; + +alter table pp_to_ww drop foreign key fk_pp_to_ww_pp; +drop index ix_pp_to_ww_pp on pp_to_ww; + +alter table pp_to_ww drop foreign key fk_pp_to_ww_wview; +drop index ix_pp_to_ww_wview on pp_to_ww; + +alter table question drop foreign key fk_question_groupobjectid; +drop index ix_question_groupobjectid on question; + +alter table r_orders drop foreign key fk_r_orders_customer; +drop index ix_r_orders_customer on r_orders; + +alter table rel_master drop foreign key fk_rel_master_detail_id; +drop index ix_rel_master_detail_id on rel_master; + +alter table resourcefile drop foreign key fk_resourcefile_parentresourcefileid; +drop index ix_resourcefile_parentresourcefileid on resourcefile; + +alter table mt_role drop foreign key fk_mt_role_tenant_id; +drop index ix_mt_role_tenant_id on mt_role; + +alter table mt_role_permission drop foreign key fk_mt_role_permission_mt_role; +drop index ix_mt_role_permission_mt_role on mt_role_permission; + +alter table mt_role_permission drop foreign key fk_mt_role_permission_mt_permission; +drop index ix_mt_role_permission_mt_permission on mt_role_permission; + +alter table root_bean drop foreign key fk_root_bean_referencing_bean_id; +drop index ix_root_bean_referencing_bean_id on root_bean; + +alter table f_second drop foreign key fk_f_second_first; + +alter table section drop foreign key fk_section_article_id; +drop index ix_section_article_id on section; + +alter table self_parent drop foreign key fk_self_parent_parent_id; +drop index ix_self_parent_parent_id on self_parent; + +alter table self_ref_customer drop foreign key fk_self_ref_customer_referred_by_id; +drop index ix_self_ref_customer_referred_by_id on self_ref_customer; + +alter table self_ref_example drop foreign key fk_self_ref_example_parent_id; +drop index ix_self_ref_example_parent_id on self_ref_example; + +alter table e_save_test_b drop foreign key fk_e_save_test_b_sibling_a_id; + +alter table site drop foreign key fk_site_parent_id; +drop index ix_site_parent_id on site; + +alter table site drop foreign key fk_site_data_container_id; + +alter table site drop foreign key fk_site_site_address_id; + +alter table source_base drop foreign key fk_source_base_target_id; +drop index ix_source_base_target_id on source_base; + +alter table stockforecast drop foreign key fk_stockforecast_inner_report_id; +drop index ix_stockforecast_inner_report_id on stockforecast; + +alter table sub_section drop foreign key fk_sub_section_section_id; +drop index ix_sub_section_section_id on sub_section; + +alter table tevent_many drop foreign key fk_tevent_many_event_id; +drop index ix_tevent_many_event_id on tevent_many; + +alter table tevent_one drop foreign key fk_tevent_one_event_id; + +alter table t_detail_with_other_namexxxyy drop foreign key fk_t_detail_with_other_namexxxyy_master_id; +drop index ix_t_detail_with_other_namexxxyy_master_id on t_detail_with_other_namexxxyy; + +alter table ttruck_holder drop foreign key fk_ttruck_holder_truck_plate_no; +drop index ix_ttruck_holder_truck_plate_no on ttruck_holder; + +alter table ttruck_holder drop foreign key fk_ttruck_holder_basic_id; +drop index ix_ttruck_holder_basic_id on ttruck_holder; + +alter table ttruck_holder_item drop foreign key fk_ttruck_holder_item_owner_id; +drop index ix_ttruck_holder_item_owner_id on ttruck_holder_item; + +alter table twheel drop foreign key fk_twheel_owner_plate_no; +drop index ix_twheel_owner_plate_no on twheel; + +alter table tire drop foreign key fk_tire_wheel; + +alter table tree_entity drop foreign key fk_tree_entity_parent_id; +drop index ix_tree_entity_parent_id on tree_entity; + +alter table trip drop foreign key fk_trip_vehicle_driver_id; +drop index ix_trip_vehicle_driver_id on trip; + +alter table trip drop foreign key fk_trip_address_id; +drop index ix_trip_address_id on trip; + +alter table `type` drop foreign key fk_type_sub_type_id; +drop index ix_type_sub_type_id on `type`; + +alter table usib_child drop foreign key fk_usib_child_parent_id; +drop index ix_usib_child_parent_id on usib_child; + +alter table usib_child_sibling drop foreign key fk_usib_child_sibling_child_id; + +alter table ut_detail drop foreign key fk_ut_detail_utmaster_id; +drop index ix_ut_detail_utmaster_id on ut_detail; + +alter table uutwo drop foreign key fk_uutwo_master_id; +drop index ix_uutwo_master_id on uutwo; + +alter table oto_user drop foreign key fk_oto_user_account_id; + +alter table c_user drop foreign key fk_c_user_group_id; +drop index ix_c_user_group_id on c_user; + +alter table em_user_role drop foreign key fk_em_user_role_user_id; +drop index ix_em_user_role_user_id on em_user_role; + +alter table em_user_role drop foreign key fk_em_user_role_role_id; +drop index ix_em_user_role_role_id on em_user_role; + +alter table vehicle drop foreign key fk_vehicle_lease_id; +drop index ix_vehicle_lease_id on vehicle; + +alter table vehicle drop foreign key fk_vehicle_car_ref_id; +drop index ix_vehicle_car_ref_id on vehicle; + +alter table vehicle drop foreign key fk_vehicle_truck_ref_id; +drop index ix_vehicle_truck_ref_id on vehicle; + +alter table vehicle_driver drop foreign key fk_vehicle_driver_vehicle_id; +drop index ix_vehicle_driver_vehicle_id on vehicle_driver; + +alter table vehicle_driver drop foreign key fk_vehicle_driver_address_id; +drop index ix_vehicle_driver_address_id on vehicle_driver; + +alter table warehouses drop foreign key fk_warehouses_officezoneid; +drop index ix_warehouses_officezoneid on warehouses; + +alter table warehousesshippingzones drop foreign key fk_warehousesshippingzones_warehouses; +drop index ix_warehousesshippingzones_warehouses on warehousesshippingzones; + +alter table warehousesshippingzones drop foreign key fk_warehousesshippingzones_zones; +drop index ix_warehousesshippingzones_zones on warehousesshippingzones; + +alter table sa_wheel drop foreign key fk_sa_wheel_tire; +drop index ix_sa_wheel_tire on sa_wheel; + +alter table sa_wheel drop foreign key fk_sa_wheel_car; +drop index ix_sa_wheel_car on sa_wheel; + +alter table g_who_props_otm drop foreign key fk_g_who_props_otm_who_created_id; +drop index ix_g_who_props_otm_who_created_id on g_who_props_otm; + +alter table g_who_props_otm drop foreign key fk_g_who_props_otm_who_modified_id; +drop index ix_g_who_props_otm_who_modified_id on g_who_props_otm; + +alter table with_zero drop foreign key fk_with_zero_parent_id; +drop index ix_with_zero_parent_id on with_zero; + +drop table if exists asimple_bean; + +drop table if exists bar; + +drop table if exists block; + +drop table if exists oto_account; + +drop table if exists acl; + +drop table if exists acl_container_relation; + +drop table if exists addr; + +drop table if exists address; + +drop table if exists o_address; + +drop table if exists album; + +drop table if exists animal; + +drop table if exists animal_shelter; + +drop table if exists article; + +drop table if exists attribute; + +drop table if exists attribute_holder; + +drop table if exists audit_log; + +drop table if exists bbookmark; + +drop table if exists bbookmark_org; + +drop table if exists bbookmark_user; + +drop table if exists bsimple_with_gen; + +drop table if exists bsite; + +drop table if exists bsite_user_a; + +drop table if exists bsite_user_b; + +drop table if exists bsite_user_c; + +drop table if exists bsite_user_d; + +drop table if exists bsite_user_e; + +drop table if exists buser; + +drop table if exists bwith_qident; + +drop table if exists basic_draftable_bean; + +drop table if exists basic_draftable_bean_draft; + +drop table if exists basic_joda_entity; + +drop table if exists bean_with_time_zone; + +drop table if exists drel_booking; + +drop table if exists bw_bean; + +drop table if exists cepcategory; + +drop table if exists cepproduct; + +drop table if exists cepproduct_category; + +drop table if exists cinh_ref; + +drop table if exists cinh_root; + +drop table if exists ckey_assoc; + +drop table if exists ckey_detail; + +drop table if exists ckey_parent; + +drop table if exists coone; + +drop table if exists coone_many; + +drop table if exists coroot; + +drop table if exists calculation_result; + +drop table if exists cao_bean; + +drop table if exists sp_car_car; + +drop table if exists sp_car_car_wheels; + +drop table if exists sp_car_car_doors; + +drop table if exists sa_car; + +drop table if exists car_accessory; + +drop table if exists car_fuse; + +drop table if exists category; + +drop table if exists e_save_test_d; + +drop table if exists child_person; + +drop table if exists cke_client; + +drop table if exists cke_user; + +drop table if exists class_super; + +drop table if exists class_super_monkey; + +drop table if exists configuration; + +drop table if exists configurations; + +drop table if exists contact; + +drop table if exists contact_group; + +drop table if exists contact_note; + +drop table if exists contract; + +drop table if exists contract_costs; + +drop table if exists c_conversation; + +drop table if exists o_country; + +drop table if exists cover; + +drop table if exists o_customer; + +drop table if exists dcredit; + +drop table if exists dcredit_drol; + +drop table if exists dexh_entity; + +drop table if exists dint_parent; + +drop table if exists dmachine; + +drop table if exists d_machine_aux_use; + +drop table if exists d_machine_stats; + +drop table if exists d_machine_use; + +drop table if exists dorg; + +drop table if exists dperson; + +drop table if exists drol; + +drop table if exists drot; + +drop table if exists drot_drol; + +drop table if exists rawinherit_data; + +drop table if exists data_container; + +drop table if exists dc_detail; + +drop table if exists dc_master; + +drop table if exists dfk_cascade; + +drop table if exists dfk_cascade_one; + +drop table if exists dfk_none; + +drop table if exists dfk_none_via_join; + +drop table if exists dfk_none_via_mto_m; + +drop table if exists dfk_none_via_mto_m_dfk_one; + +drop table if exists dfk_one; + +drop table if exists dfk_set_null; + +drop table if exists doc; + +drop table if exists doc_link; + +drop table if exists doc_link_draft; + +drop table if exists doc_draft; + +drop table if exists document; + +drop table if exists document_draft; + +drop table if exists document_media; + +drop table if exists document_media_draft; + +drop table if exists sp_car_door; + +drop table if exists earray_bean; + +drop table if exists earray_set_bean; + +drop table if exists e_basic; + +drop table if exists ebasic_change_log; + +drop table if exists ebasic_clob; + +drop table if exists ebasic_clob_fetch_eager; + +drop table if exists ebasic_clob_no_ver; + +drop table if exists e_basicenc; + +drop table if exists e_basicenc_bin; + +drop table if exists e_basicenc_client; + +drop table if exists e_basicenc_relate; + +drop table if exists e_basic_enum_id; + +drop table if exists e_basic_eni; + +drop table if exists ebasic_hstore; + +drop table if exists ebasic_json_jackson; + +drop table if exists ebasic_json_jackson2; + +drop table if exists ebasic_json_list; + +drop table if exists ebasic_json_map; + +drop table if exists ebasic_json_map_blob; + +drop table if exists ebasic_json_map_clob; + +drop table if exists ebasic_json_map_detail; + +drop table if exists ebasic_json_map_json_b; + +drop table if exists ebasic_json_map_varchar; + +drop table if exists ebasic_json_node; + +drop table if exists ebasic_json_node_blob; + +drop table if exists ebasic_json_node_json_b; + +drop table if exists ebasic_json_node_varchar; + +drop table if exists ebasic_json_unmapped; + +drop table if exists e_basic_ndc; + +drop table if exists ebasic_no_sdchild; + +drop table if exists ebasic_sdchild; + +drop table if exists ebasic_soft_delete; + +drop table if exists e_basicver; + +drop table if exists e_basic_withlife; + +drop table if exists e_basic_with_ex; + +drop table if exists e_basicverucon; + +drop table if exists ecache_child; + +drop table if exists ecache_root; + +drop table if exists e_col_ab; + +drop table if exists ecustom_id; + +drop table if exists edefault_prop; + +drop table if exists eemb_inner; + +drop table if exists eemb_outer; + +drop table if exists efile2_no_fk; + +drop table if exists efile_no_fk; + +drop table if exists efile_no_fk_euser_no_fk; + +drop table if exists efile_no_fk_euser_no_fk_soft_del; + +drop table if exists egen_props; + +drop table if exists eid_uid_bean; + +drop table if exists einvoice; + +drop table if exists e_main; + +drop table if exists enull_collection; + +drop table if exists enull_collection_detail; + +drop table if exists eopt_one_a; + +drop table if exists eopt_one_b; + +drop table if exists eopt_one_c; + +drop table if exists eper_addr; + +drop table if exists eperson; + +drop table if exists e_person_online; + +drop table if exists esimple; + +drop table if exists esoft_del_book; + +drop table if exists esoft_del_book_esoft_del_user; + +drop table if exists esoft_del_down; + +drop table if exists esoft_del_mid; + +drop table if exists esoft_del_one_a; + +drop table if exists esoft_del_one_b; + +drop table if exists esoft_del_role; + +drop table if exists esoft_del_role_esoft_del_user; + +drop table if exists esoft_del_top; + +drop table if exists esoft_del_up; + +drop table if exists esoft_del_user; + +drop table if exists esoft_del_user_esoft_del_role; + +drop table if exists esome_convert_type; + +drop table if exists esome_type; + +drop table if exists etrans_many; + +drop table if exists rawinherit_uncle; + +drop table if exists euser_no_fk; + +drop table if exists euser_no_fk_soft_del; + +drop table if exists evanilla_collection; + +drop table if exists evanilla_collection_detail; + +drop table if exists ewho_props; + +drop table if exists e_withinet; + +drop table if exists ec_enum_person; + +drop table if exists ec_enum_person_tags; + +drop table if exists ec_person; + +drop table if exists ec_person_phone; + +drop table if exists ec_top; + +drop table if exists ec_top_ecs_person; + +drop table if exists ecbl_person; + +drop table if exists ecbl_person_phone_numbers; + +drop table if exists ecbm_person; + +drop table if exists ecbm_person_phone_numbers; + +drop table if exists ecm_person; + +drop table if exists ecm_person_phone_numbers; + +drop table if exists ecmc_person; + +drop table if exists ecmc_person_phone_numbers; + +drop table if exists ecs_person; + +drop table if exists ecs_person_phone; + +drop table if exists ecsm_child; + +drop table if exists ecsm_values; + +drop table if exists ecsm_one; + +drop table if exists ecsm_parent; + +drop table if exists ecsm_two; + +drop table if exists td_child; + +drop table if exists td_parent; + +drop table if exists element_bean; + +drop table if exists empl; + +drop table if exists esd_detail; + +drop table if exists esd_master; + +drop table if exists feature_desc; + +drop table if exists f_first; + +drop table if exists foo; + +drop table if exists gen_key_identity; + +drop table if exists gen_key_sequence; + +drop table if exists gen_key_table; + +drop table if exists grand_parent_person; + +drop table if exists survey_group; + +drop table if exists c_group; + +drop table if exists he_doc; + +drop trigger hx_link_history_upd; +drop trigger hx_link_history_del; +drop view hx_link_with_history; +alter table hx_link drop column sys_period_start; +alter table hx_link drop column sys_period_end; +drop table hx_link_history; + +drop table if exists hx_link; + +drop table if exists hx_link_doc; + +drop table if exists hi_doc; + +drop trigger hi_link_history_upd; +drop trigger hi_link_history_del; +drop view hi_link_with_history; +alter table hi_link drop column sys_period_start; +alter table hi_link drop column sys_period_end; +drop table hi_link_history; + +drop table if exists hi_link; + +drop trigger hi_link_doc_history_upd; +drop trigger hi_link_doc_history_del; +drop view hi_link_doc_with_history; +alter table hi_link_doc drop column sys_period_start; +alter table hi_link_doc drop column sys_period_end; +drop table hi_link_doc_history; + +drop table if exists hi_link_doc; + +drop trigger hi_tone_history_upd; +drop trigger hi_tone_history_del; +drop view hi_tone_with_history; +alter table hi_tone drop column sys_period_start; +alter table hi_tone drop column sys_period_end; +drop table hi_tone_history; + +drop table if exists hi_tone; + +drop trigger hi_tthree_history_upd; +drop trigger hi_tthree_history_del; +drop view hi_tthree_with_history; +alter table hi_tthree drop column sys_period_start; +alter table hi_tthree drop column sys_period_end; +drop table hi_tthree_history; + +drop table if exists hi_tthree; + +drop trigger hi_ttwo_history_upd; +drop trigger hi_ttwo_history_del; +drop view hi_ttwo_with_history; +alter table hi_ttwo drop column sys_period_start; +alter table hi_ttwo drop column sys_period_end; +drop table hi_ttwo_history; + +drop table if exists hi_ttwo; + +drop trigger hsd_setting_history_upd; +drop trigger hsd_setting_history_del; +drop view hsd_setting_with_history; +alter table hsd_setting drop column sys_period_start; +alter table hsd_setting drop column sys_period_end; +drop table hsd_setting_history; + +drop table if exists hsd_setting; + +drop trigger hsd_user_history_upd; +drop trigger hsd_user_history_del; +drop view hsd_user_with_history; +alter table hsd_user drop column sys_period_start; +alter table hsd_user drop column sys_period_end; +drop table hsd_user_history; + +drop table if exists hsd_user; + +drop table if exists iaf_segment; + +drop table if exists iaf_segment_status; + +drop table if exists imrelated; + +drop table if exists imroot; + +drop table if exists ixresource; + +drop table if exists info_company; + +drop table if exists info_contact; + +drop table if exists info_customer; + +drop table if exists inner_report; + +drop table if exists drel_invoice; + +drop table if exists item; + +drop table if exists monkey; + +drop table if exists mkeygroup; + +drop table if exists mkeygroup_monkey; + +drop table if exists trainer; + +drop table if exists trainer_monkey; + +drop table if exists troop; + +drop table if exists troop_monkey; + +drop table if exists l2_cldf_reset_bean; + +drop table if exists l2_cldf_reset_bean_child; + +drop table if exists level1; + +drop table if exists level1_level4; + +drop table if exists level1_level2; + +drop table if exists level2; + +drop table if exists level2_level3; + +drop table if exists level3; + +drop table if exists level4; + +drop trigger link_history_upd; +drop trigger link_history_del; +drop view link_with_history; +alter table link drop column sys_period_start; +alter table link drop column sys_period_end; +drop table link_history; + +drop table if exists link; + +drop table if exists link_draft; + +drop table if exists la_attr_value; + +drop table if exists la_attr_value_attribute; + +drop table if exists looney; + +drop table if exists maddress; + +drop table if exists mcontact; + +drop table if exists mcontact_message; + +drop table if exists mcustomer; + +drop table if exists mgroup; + +drop table if exists mmachine; + +drop table if exists mmachine_mgroup; + +drop table if exists mmedia; + +drop table if exists non_updateprop; + +drop table if exists mprinter; + +drop table if exists mprinter_state; + +drop table if exists mprofile; + +drop table if exists mprotected_construct_bean; + +drop table if exists mrole; + +drop table if exists mrole_muser; + +drop table if exists msome_other; + +drop table if exists muser; + +drop table if exists muser_type; + +drop table if exists mail_box; + +drop table if exists mail_user; + +drop table if exists mail_user_inbox; + +drop table if exists mail_user_outbox; + +drop table if exists main_entity; + +drop table if exists main_entity_relation; + +drop table if exists map_super_actual; + +drop table if exists c_message; + +drop table if exists meter_address_data; + +drop table if exists meter_contract_data; + +drop table if exists meter_special_needs_client; + +drop table if exists meter_special_needs_contact; + +drop table if exists meter_version; + +drop table if exists mnoc_role; + +drop table if exists mnoc_user; + +drop table if exists mnoc_user_mnoc_role; + +drop table if exists mny_a; + +drop table if exists mny_b; + +drop table if exists mny_b_mny_c; + +drop table if exists mny_c; + +drop table if exists mny_topic; + +drop table if exists subtopics; + +drop table if exists mp_role; + +drop table if exists mp_user; + +drop table if exists ms_many_a; + +drop table if exists ms_many_a_many_b; + +drop table if exists ms_many_b; + +drop table if exists ms_many_b_many_a; + +drop table if exists my_lob_size; + +drop table if exists my_lob_size_join_many; + +drop table if exists noidbean; + +drop table if exists o_bean_child; + +drop table if exists ocached_app; + +drop table if exists ocached_app_detail; + +drop table if exists o_cached_bean; + +drop table if exists o_cached_bean_country; + +drop table if exists o_cached_bean_child; + +drop table if exists o_cached_inherit; + +drop table if exists o_cached_natkey; + +drop table if exists o_cached_natkey3; + +drop table if exists ocached_nkey_uid; + +drop table if exists ocar; + +drop table if exists ocompany; + +drop table if exists oengine; + +drop table if exists ogear_box; + +drop table if exists omvertex; + +drop table if exists omvertex_other; + +drop table if exists oroad_show_msg; + +drop table if exists om_account_child_dbo; + +drop table if exists om_account_dbo; + +drop table if exists om_basic_child; + +drop table if exists om_basic_parent; + +drop table if exists om_ordered_detail; + +drop table if exists om_ordered_master; + +drop table if exists only_id_entity; + +drop table if exists o_order; + +drop table if exists o_order_detail; + +drop table if exists s_orders; + +drop table if exists s_order_items; + +drop table if exists or_order_ship; + +drop table if exists organisation; + +drop table if exists organization_node; + +drop table if exists organization_tree_node; + +drop table if exists orp_detail; + +drop table if exists orp_detail2; + +drop table if exists orp_master; + +drop table if exists orp_master2; + +drop table if exists oto_aone; + +drop table if exists oto_atwo; + +drop table if exists oto_bchild; + +drop table if exists oto_bmaster; + +drop table if exists oto_child; + +drop table if exists oto_cust; + +drop table if exists oto_cust_address; + +drop table if exists oto_level_a; + +drop table if exists oto_level_b; + +drop table if exists oto_level_c; + +drop table if exists oto_master; + +drop table if exists oto_prime; + +drop table if exists oto_prime_extra; + +drop table if exists oto_sd_child; + +drop table if exists oto_sd_master; + +drop table if exists oto_th_many; + +drop table if exists oto_th_one; + +drop table if exists oto_th_top; + +drop table if exists oto_ubprime; + +drop table if exists oto_ubprime_extra; + +drop table if exists oto_uprime; + +drop table if exists oto_uprime_extra; + +drop table if exists oto_user_model; + +drop table if exists oto_user_model_optional; + +drop table if exists pfile; + +drop table if exists pfile_content; + +drop table if exists paggview; + +drop table if exists pallet_location; + +drop table if exists parcel; + +drop table if exists parcel_location; + +drop table if exists rawinherit_parent; + +drop table if exists rawinherit_parent_rawinherit_data; + +drop table if exists e_save_test_c; + +drop table if exists parent_person; + +drop table if exists c_participation; + +drop table if exists password_store_model; + +drop table if exists pcf_calendar; + +drop table if exists pcf_city; + +drop table if exists pcf_country; + +drop table if exists pcf_event; + +drop table if exists pcf_person; + +drop table if exists mt_permission; + +drop table if exists persistent_file; + +drop table if exists persistent_file_content; + +drop table if exists person; + +drop table if exists persons; + +drop table if exists person_cache_email; + +drop table if exists person_cache_info; + +drop table if exists phones; + +drop table if exists e_position; + +drop table if exists primary_revision; + +drop table if exists o_product; + +drop table if exists pp; + +drop table if exists pp_to_ww; + +drop table if exists question; + +drop table if exists rcustomer; + +drop table if exists r_orders; + +drop table if exists referencing_bean; + +drop table if exists region; + +drop table if exists rel_detail; + +drop table if exists rel_master; + +drop table if exists resourcefile; + +drop table if exists mt_role; + +drop table if exists mt_role_permission; + +drop table if exists em_role; + +drop table if exists root_bean; + +drop table if exists f_second; + +drop table if exists section; + +drop table if exists self_parent; + +drop table if exists self_ref_customer; + +drop table if exists self_ref_example; + +drop table if exists e_save_test_a; + +drop table if exists e_save_test_b; + +drop table if exists site; + +drop table if exists site_address; + +drop table if exists some_enum_bean; + +drop table if exists some_file_bean; + +drop table if exists some_new_types_bean; + +drop table if exists some_period_bean; + +drop table if exists source_base; + +drop table if exists stockforecast; + +drop table if exists sub_section; + +drop table if exists sub_type; + +drop table if exists survey; + +drop table if exists tbytes_only; + +drop table if exists tcar; + +drop table if exists tevent; + +drop table if exists tevent_many; + +drop table if exists tevent_one; + +drop table if exists tint_root; + +drop table if exists tjoda_entity; + +drop table if exists t_mapsuper1; + +drop table if exists t_oneb; + +drop table if exists t_detail_with_other_namexxxyy; + +drop table if exists t_atable_thatisrelatively; + +drop table if exists ttruck_holder; + +drop table if exists ttruck_holder_item; + +drop table if exists tuuid_entity; + +drop table if exists twheel; + +drop table if exists twith_pre_insert; + +drop table if exists target_base; + +drop table if exists mt_tenant; + +drop table if exists test_annotation_base_entity; + +drop table if exists tire; + +drop table if exists sa_tire; + +drop table if exists tree_entity; + +drop table if exists trip; + +drop table if exists truck_ref; + +drop table if exists tune; + +drop table if exists `type`; + +drop table if exists tz_bean; + +drop table if exists usib_child; + +drop table if exists usib_child_sibling; + +drop table if exists usib_parent; + +drop table if exists ut_detail; + +drop table if exists ut_master; + +drop table if exists uuone; + +drop table if exists uutwo; + +drop table if exists oto_user; + +drop trigger c_user_history_upd; +drop trigger c_user_history_del; +drop view c_user_with_history; +alter table c_user drop column sys_period_start; +alter table c_user drop column sys_period_end; +drop table c_user_history; + +drop table if exists c_user; + +drop table if exists tx_user; + +drop table if exists g_user; + +drop table if exists em_user; + +drop table if exists user_interest_live; + +drop table if exists em_user_role; + +drop table if exists vehicle; + +drop table if exists vehicle_driver; + +drop table if exists vehicle_lease; + +drop table if exists warehouses; + +drop table if exists warehousesshippingzones; + +drop table if exists wheel; + +drop table if exists sa_wheel; + +drop table if exists sp_car_wheel; + +drop table if exists g_who_props_otm; + +drop table if exists with_zero; + +drop table if exists parent; + +drop table if exists wview; + +drop table if exists zones; + +drop index ix_contact_last_name_first_name on contact; +drop index ix_e_basic_name on e_basic; +drop index ix_efile2_no_fk_owner_id on efile2_no_fk; +drop index ix_ecsm_values_host_id on ecsm_values; +drop index ix_organization_node_kind on organization_node; diff --git a/ebean-core/src/test/ddl-review/oracle-create-all.sql b/ebean-core/src/test/ddl-review/oracle-create-all.sql new file mode 100644 index 000000000..6c3b054cf --- /dev/null +++ b/ebean-core/src/test/ddl-review/oracle-create-all.sql @@ -0,0 +1,4826 @@ +-- Generated by ebean unknown at 2020-03-17T09:34:02.384264Z +create table asimple_bean ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_asimple_bean primary key (id) +); + +create table bar ( + bar_type varchar2(31) not null, + bar_id number(10) generated by default as identity not null, + foo_id number(10) not null, + version number(10) not null, + constraint pk_bar primary key (bar_id) +); + +create table block ( + case_type number(31) not null, + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + notes varchar2(255), + constraint pk_block primary key (id) +); + +create table oto_account ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_oto_account primary key (id) +); + +create table acl ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_acl primary key (id) +); + +create table acl_container_relation ( + id number(19) generated by default as identity not null, + container_id number(19) not null, + acl_entry_id number(19) not null, + constraint pk_acl_container_relation primary key (id) +); + +create table addr ( + id number(19) generated by default as identity not null, + employee_id number(19), + name varchar2(255), + address_line1 varchar2(255), + address_line2 varchar2(255), + city varchar2(255), + version number(19) not null, + constraint pk_addr primary key (id) +); + +create table address ( + oid number(19) generated by default as identity not null, + street varchar2(255), + version number(10) not null, + constraint pk_address primary key (oid) +); + +create table o_address ( + id number(10) generated by default as identity not null, + line_1 varchar2(100), + line_2 varchar2(100), + city varchar2(100), + cretime timestamp, + country_code varchar2(2), + updtime timestamp not null, + constraint pk_o_address primary key (id) +); + +create table album ( + id number(19) generated by default as identity not null, + name varchar2(255), + cover_id number(19), + deleted number(1) default 0 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 varchar2(255) not null, + id number(19) generated by default as identity not null, + shelter_id number(19), + version number(19) not null, + name varchar2(255), + registration_number varchar2(255), + date_of_birth date, + dog_size varchar2(255), + constraint pk_animal primary key (id) +); + +create table animal_shelter ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_animal_shelter primary key (id) +); + +create table article ( + id number(10) generated by default as identity not null, + name varchar2(255), + author varchar2(255), + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_article primary key (id) +); + +create table attribute ( + option_type number(31) not null, + id number(10) generated by default as identity not null, + attribute_holder_id number(10), + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_attribute primary key (id) +); + +create table attribute_holder ( + id number(10) generated by default as identity not null, + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_attribute_holder primary key (id) +); + +create table audit_log ( + id number(19) generated by default as identity (start with 1000 cache 100) not null, + description varchar2(255), + modified_description varchar2(255), + constraint pk_audit_log primary key (id) +); + +create table bbookmark ( + id number(10) generated by default as identity not null, + bookmark_reference varchar2(255), + user_id number(10), + constraint pk_bbookmark primary key (id) +); + +create table bbookmark_org ( + id number(10) generated by default as identity not null, + name varchar2(255), + constraint pk_bbookmark_org primary key (id) +); + +create table bbookmark_user ( + id number(10) generated by default as identity not null, + name varchar2(255), + password varchar2(255), + email_address varchar2(255), + country varchar2(255), + org_id number(10), + constraint pk_bbookmark_user primary key (id) +); + +create table bsimple_with_gen ( + id number(10) generated by default as identity not null, + name varchar2(255), + constraint pk_bsimple_with_gen primary key (id) +); + +create table bsite ( + id varchar2(40) not null, + name varchar2(255), + constraint pk_bsite primary key (id) +); + +create table bsite_user_a ( + site_id varchar2(40) not null, + user_id varchar2(40) not null, + access_level number(10), + version number(19) 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 varchar2(40) not null, + usr varchar2(40) not null, + access_level number(10), + 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 varchar2(40) not null, + user_uid varchar2(40) not null, + access_level number(10), + 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 varchar2(40) not null, + user_id varchar2(40) not null, + access_level number(10), + version number(19) not null, + constraint ck_bsite_user_d_access_level check ( access_level in (0,1,2)) +); + +create table bsite_user_e ( + site_id varchar2(40) not null, + user_id varchar2(40) not null, + access_level number(10), + constraint ck_bsite_user_e_access_level check ( access_level in (0,1,2)) +); + +create table buser ( + id varchar2(40) not null, + name varchar2(255), + constraint pk_buser primary key (id) +); + +create table bwith_qident ( + id number(10) generated by default as identity not null, + "Name" varchar2(191), + "CODE" varchar2(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 number(19) generated by default as identity not null, + name varchar2(255), + version number(19) 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 number(19) generated by default as identity not null, + name varchar2(255), + version number(19) 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 number(19) generated by default as identity not null, + name varchar2(255), + period varchar2(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 number(19) generated by default as identity not null, + name varchar2(255), + timezone varchar2(20), + constraint pk_bean_with_time_zone primary key (id) +); + +create table drel_booking ( + id number(19) not null, + booking_uid number(19), + agent_invoice number(19), + client_invoice number(19), + version number(10) not null, + constraint uq_drel_booking_booking_uid unique (booking_uid), + constraint uq_drel_booking_agent_invoice unique (agent_invoice), + constraint uq_drl_bkng_clnt_nvc unique (client_invoice), + constraint pk_drel_booking primary key (id) +); +create sequence drel_booking_seq increment by 1; + +create table bw_bean ( + id number(19) generated by default as identity not null, + name varchar2(255), + flags number(10) not null, + version number(19) not null, + constraint pk_bw_bean primary key (id) +); + +create table cepcategory ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_cepcategory primary key (id) +); + +create table cepproduct ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_cepproduct primary key (id) +); + +create table cepproduct_category ( + customer_id number(19) not null, + address_id number(19) not null, + category_id number(19) not null, + product_id number(19) not null, + priority number(10) +); + +create table ciaddress ( + id number(19) generated by default as identity not null, + street_id number(19), + constraint pk_ciaddress primary key (id) +); + +create table cicustomer_parent ( + dtype number(31) not null, + id number(19) generated by default as identity not null, + address_id number(19), + notes varchar2(255), + constraint pk_cicustomer_parent primary key (id) +); + +create table cistreet_parent ( + dtype number(31) not null, + id number(19) generated by default as identity not null, + name varchar2(255), + num varchar2(255), + constraint pk_cistreet_parent primary key (id) +); + +create table cinh_ref ( + id number(10) generated by default as identity not null, + ref_id number(10), + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_cinh_ref primary key (id) +); + +create table cinh_root ( + dtype varchar2(3) not null, + id number(10) generated by default as identity not null, + license_number varchar2(255), + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + driver varchar2(255), + notes varchar2(255), + action varchar2(255), + constraint pk_cinh_root primary key (id) +); + +create table ckey_assoc ( + id number(10) generated by default as identity not null, + assoc_one varchar2(255), + constraint pk_ckey_assoc primary key (id) +); + +create table ckey_detail ( + id number(10) generated by default as identity not null, + something varchar2(255), + one_key number(10), + two_key varchar2(127), + constraint pk_ckey_detail primary key (id) +); + +create table ckey_parent ( + one_key number(10) not null, + two_key varchar2(127) not null, + name varchar2(255), + assoc_id number(10), + version number(10) not null, + constraint pk_ckey_parent primary key (one_key,two_key) +); + +create table coone ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_coone primary key (id) +); + +create table coone_many ( + id number(19) generated by default as identity not null, + coone_id number(19) not null, + name varchar2(255), + deleted number(1) default 0 not null, + constraint pk_coone_many primary key (id) +); + +create table coroot ( + id number(19) generated by default as identity not null, + name varchar2(255), + one_id number(19), + constraint uq_coroot_one_id unique (one_id), + constraint pk_coroot primary key (id) +); + +create table calculation_result ( + id number(10) generated by default as identity not null, + charge number(19,4) not null, + product_configuration_id number(10), + group_configuration_id number(10), + constraint pk_calculation_result primary key (id) +); + +create table cao_bean ( + x_cust_id number(10) not null, + x_type_id number(10) not null, + description varchar2(255), + version number(19) not null, + constraint pk_cao_bean primary key (x_cust_id,x_type_id) +); + +create table sp_car_car ( + id number(19) not null, + name varchar2(255), + version number(10) 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 number(19) not null, + wheel number(19) not null, + constraint pk_sp_car_car_wheels primary key (car,wheel) +); + +create table sp_car_car_doors ( + car number(19) not null, + door number(19) not null, + constraint pk_sp_car_car_doors primary key (car,door) +); + +create table sa_car ( + id number(19) not null, + brand varchar2(255), + sold number(10) not null, + version number(10) not null, + constraint pk_sa_car primary key (id) +); +create sequence sa_car_seq increment by 1; + +create table car_accessory ( + id number(10) generated by default as identity not null, + name varchar2(255), + fuse_id number(19) not null, + car_id number(10), + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_car_accessory primary key (id) +); + +create table car_fuse ( + id number(19) generated by default as identity not null, + location_code varchar2(255), + constraint pk_car_fuse primary key (id) +); + +create table category ( + id number(19) generated by default as identity not null, + name varchar2(255), + surveyobjectid number(19), + sequence_number number(10) not null, + constraint pk_category primary key (id) +); + +create table e_save_test_d ( + id number(19) generated by default as identity not null, + parent_id number(19), + test_property number(1) default 0 not null, + version number(19) 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 number(10) generated by default as identity not null, + name varchar2(255), + age number(10), + some_bean_id number(10), + parent_identifier number(10), + family_name varchar2(255), + address varchar2(255), + constraint pk_child_person primary key (identifier) +); + +create table cke_client ( + cod_cpny number(10) not null, + cod_client varchar2(100) not null, + username varchar2(100) not null, + notes varchar2(255), + constraint pk_cke_client primary key (cod_cpny,cod_client) +); + +create table cke_user ( + username varchar2(100) not null, + cod_cpny number(10) not null, + name varchar2(255), + constraint pk_cke_user primary key (username,cod_cpny) +); + +create table class_super ( + dtype varchar2(31) not null, + sid number(19) generated by default as identity not null, + constraint pk_class_super primary key (sid) +); + +create table class_super_monkey ( + class_super_sid number(19) not null, + monkey_mid number(19) 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 varchar2(21) not null, + id number(10) generated by default as identity not null, + name varchar2(255), + configurations_id number(10), + group_name varchar2(255), + product_name varchar2(255), + constraint pk_configuration primary key (id) +); + +create table configurations ( + id number(10) generated by default as identity not null, + name varchar2(255), + constraint pk_configurations primary key (id) +); + +create table contact ( + id number(10) generated by default as identity not null, + first_name varchar2(127), + last_name varchar2(127), + phone varchar2(255), + mobile varchar2(255), + email varchar2(255), + is_member number(1) default 0 not null, + customer_id number(10) not null, + group_id number(10), + cretime timestamp not null, + updtime timestamp not null, + constraint pk_contact primary key (id) +); + +create table contact_group ( + id number(10) generated by default as identity not null, + name varchar2(255), + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_contact_group primary key (id) +); + +create table contact_note ( + id number(10) generated by default as identity not null, + contact_id number(10), + title varchar2(255), + note clob, + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_contact_note primary key (id) +); + +create table contract ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_contract primary key (id) +); + +create table contract_costs ( + id number(19) generated by default as identity not null, + status varchar2(255), + position_id number(19) not null, + constraint pk_contract_costs primary key (id) +); + +create table c_conversation ( + id number(19) generated by default as identity not null, + title varchar2(255), + isopen number(1) default 0 not null, + group_id number(19), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_c_conversation primary key (id) +); + +create table o_country ( + code varchar2(2) not null, + name varchar2(60), + constraint pk_o_country primary key (code) +); + +create table cover ( + id number(19) generated by default as identity not null, + s3_url varchar2(255), + deleted number(1) default 0 not null, + constraint pk_cover primary key (id) +); + +create table o_customer ( + id number(10) generated by default as identity not null, + status varchar2(1), + name varchar2(40) not null, + smallnote varchar2(100), + anniversary date, + billing_address_id number(10), + shipping_address_id number(10), + cretime timestamp not null, + updtime timestamp not null, + version number(19) 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 number(19) generated by default as identity not null, + credit varchar2(255), + constraint pk_dcredit primary key (id) +); + +create table dcredit_drol ( + dcredit_id number(19) not null, + drol_id number(19) not null, + constraint pk_dcredit_drol primary key (dcredit_id,drol_id) +); + +create table dexh_entity ( + oid number(19) generated by default as identity not null, + exhange varchar2(255), + an_enum_type varchar2(255), + last_updated timestamp not null, + constraint pk_dexh_entity primary key (oid) +); + +create table dint_parent ( + type number(31) not null, + id number(19) generated by default as identity not null, + val number(10), + more varchar2(255), + constraint pk_dint_parent primary key (id) +); + +create table dmachine ( + id number(19) generated by default as identity not null, + name varchar2(255), + organisation_id number(19), + version number(19) not null, + constraint pk_dmachine primary key (id) +); + +create table d_machine_aux_use ( + id number(19) generated by default as identity not null, + machine_id number(19) not null, + name varchar2(255), + edate date, + use_secs number(19) not null, + fuel number(16,3), + version number(19) not null, + constraint pk_d_machine_aux_use primary key (id) +); + +create table d_machine_stats ( + id number(19) generated by default as identity not null, + machine_id number(19) not null, + edate date, + total_kms number(19) not null, + hours number(19) not null, + rate number(16,3), + cost number(16,3), + version number(19) not null, + constraint pk_d_machine_stats primary key (id) +); + +create table d_machine_use ( + id number(19) generated by default as identity not null, + machine_id number(19) not null, + edate date, + distance_kms number(19) not null, + time_secs number(19) not null, + fuel number(9,3), + version number(19) not null, + constraint pk_d_machine_use primary key (id) +); + +create table dorg ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_dorg primary key (id) +); + +create table dperson ( + id number(19) generated by default as identity not null, + first_name varchar2(255), + last_name varchar2(255), + salary number(16,3), + constraint pk_dperson primary key (id) +); + +create table drol ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_drol primary key (id) +); + +create table drot ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_drot primary key (id) +); + +create table drot_drol ( + drot_id number(19) not null, + drol_id number(19) not null, + constraint pk_drot_drol primary key (drot_id,drol_id) +); + +create table rawinherit_data ( + id number(19) generated by default as identity not null, + val number(10), + constraint pk_rawinherit_data primary key (id) +); + +create table data_container ( + id varchar2(40) not null, + content varchar2(255), + constraint pk_data_container primary key (id) +); + +create table dc_detail ( + id number(19) generated by default as identity not null, + master_id number(19), + description varchar2(255), + version number(19) not null, + constraint pk_dc_detail primary key (id) +); + +create table dc_master ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_dc_master primary key (id) +); + +create table dfk_cascade ( + id number(19) generated by default as identity not null, + name varchar2(255), + one_id number(19), + constraint pk_dfk_cascade primary key (id) +); + +create table dfk_cascade_one ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_dfk_cascade_one primary key (id) +); + +create table dfk_none ( + id number(19) generated by default as identity not null, + name varchar2(255), + one_id number(19), + constraint pk_dfk_none primary key (id) +); + +create table dfk_none_via_join ( + id number(19) generated by default as identity not null, + name varchar2(255), + one_id number(19), + constraint pk_dfk_none_via_join primary key (id) +); + +create table dfk_none_via_mto_m ( + id number(19) generated by default as identity not null, + name varchar2(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 number(19) not null, + dfk_one_id number(19) 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 number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_dfk_one primary key (id) +); + +create table dfk_set_null ( + id number(19) generated by default as identity not null, + name varchar2(255), + one_id number(19), + constraint pk_dfk_set_null primary key (id) +); + +create table doc ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_doc primary key (id) +); + +create table doc_link ( + doc_id number(19) not null, + link_id number(19) not null, + constraint pk_doc_link primary key (doc_id,link_id) +); + +create table doc_link_draft ( + doc_id number(19) not null, + link_id number(19) not null, + constraint pk_doc_link_draft primary key (doc_id,link_id) +); + +create table doc_draft ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_doc_draft primary key (id) +); + +create table document ( + id number(19) generated by default as identity not null, + title varchar2(127), + body varchar2(255), + organisation_id number(19), + version number(19) 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 number(19) generated by default as identity not null, + title varchar2(127), + body varchar2(255), + when_publish timestamp, + organisation_id number(19), + version number(19) 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 number(19) generated by default as identity not null, + document_id number(19), + name varchar2(255), + description varchar2(255), + version number(19) 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 number(19) generated by default as identity not null, + document_id number(19), + name varchar2(255), + description varchar2(255), + version number(19) 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 number(19) not null, + name varchar2(255), + version number(10) not null, + constraint pk_sp_car_door primary key (id) +); +create sequence sp_car_door_seq increment by 1; + +create table earray_bean ( + id number(19) generated by default as identity not null, + foo number(10), + name varchar2(255), + phone_numbers varchar(300), + uids varchar(1000) not null, + other_ids varchar(1000), + doubs varchar(1000), + statuses varchar(1000), + vc_enums varchar(1000), + int_enums varchar(1000), + status2 varchar(1000), + version number(19) 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 number(19) generated by default as identity not null, + name varchar2(255), + phone_numbers varchar(300), + uids varchar(1000), + other_ids varchar(1000), + doubs varchar(1000), + version number(19) not null, + constraint pk_earray_set_bean primary key (id) +); + +create table e_basic ( + id number(10) generated by default as identity not null, + status varchar2(1), + name varchar2(127), + description varchar2(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 number(19) generated by default as identity not null, + name varchar2(20), + short_description varchar2(50), + long_description varchar2(100), + who_created varchar2(255) not null, + who_modified varchar2(255) not null, + when_created timestamp not null, + when_modified timestamp not null, + version number(19) not null, + constraint pk_ebasic_change_log primary key (id) +); + +create table ebasic_clob ( + id number(19) generated by default as identity not null, + name varchar2(255), + title varchar2(255), + description clob, + last_update timestamp not null, + constraint pk_ebasic_clob primary key (id) +); + +create table ebasic_clob_fetch_eager ( + id number(19) generated by default as identity not null, + name varchar2(255), + title varchar2(255), + description clob, + last_update timestamp not null, + constraint pk_ebasic_clob_fetch_eager primary key (id) +); + +create table ebasic_clob_no_ver ( + id number(19) generated by default as identity not null, + name varchar2(255), + description clob, + constraint pk_ebasic_clob_no_ver primary key (id) +); + +create table e_basicenc ( + id number(10) generated by default as identity not null, + name varchar2(255), + description raw(80), + dob raw(20), + status raw(20), + last_update timestamp, + constraint pk_e_basicenc primary key (id) +); + +create table e_basicenc_bin ( + id number(10) generated by default as identity not null, + name varchar2(255), + description varchar2(255), + data blob, + some_time raw(255), + last_update timestamp not null, + constraint pk_e_basicenc_bin primary key (id) +); + +create table e_basicenc_client ( + id number(19) generated by default as identity not null, + name varchar2(255), + description raw(80), + dob raw(20), + status raw(20), + version number(19) not null, + constraint pk_e_basicenc_client primary key (id) +); + +create table e_basicenc_relate ( + id number(19) generated by default as identity not null, + name varchar2(255), + other_id number(10), + constraint pk_e_basicenc_relate primary key (id) +); + +create table e_basic_enum_id ( + status varchar2(1) not null, + name varchar2(255), + description varchar2(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 number(10) generated by default as identity not null, + status number(10), + name varchar2(255), + description varchar2(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 number(19) generated by default as identity not null, + name varchar2(255), + map varchar2(800), + version number(19) not null, + constraint pk_ebasic_hstore primary key (id) +); + +create table ebasic_json_jackson ( + id number(19) generated by default as identity not null, + name varchar2(255), + value_set varchar2(700), + value_list clob, + value_map varchar2(700), + plain_value varchar2(500), + version number(19) not null, + constraint pk_ebasic_json_jackson primary key (id) +); + +create table ebasic_json_jackson2 ( + id number(19) generated by default as identity not null, + name varchar2(255), + value_set varchar2(700), + value_list clob, + value_map varchar2(700), + plain_value varchar2(500), + version number(19) not null, + constraint pk_ebasic_json_jackson2 primary key (id) +); + +create table ebasic_json_list ( + id number(19) generated by default as identity not null, + name varchar2(255), + bean_set varchar2(700), + bean_list clob, + bean_map varchar2(700), + plain_bean varchar2(500), + flags varchar2(50), + tags varchar2(100), + version number(19) not null, + constraint pk_ebasic_json_list primary key (id) +); + +create table ebasic_json_map ( + id number(19) generated by default as identity not null, + name varchar2(255), + content clob, + version number(19) not null, + constraint pk_ebasic_json_map primary key (id) +); + +create table ebasic_json_map_blob ( + id number(19) generated by default as identity not null, + name varchar2(255), + content blob, + version number(19) not null, + constraint pk_ebasic_json_map_blob primary key (id) +); + +create table ebasic_json_map_clob ( + id number(19) generated by default as identity not null, + name varchar2(255), + content clob, + version number(19) not null, + constraint pk_ebasic_json_map_clob primary key (id) +); + +create table ebasic_json_map_detail ( + id number(19) generated by default as identity not null, + owner_id number(19), + name varchar2(255), + content clob, + version number(19) not null, + constraint pk_ebasic_json_map_detail primary key (id) +); + +create table ebasic_json_map_json_b ( + id number(19) generated by default as identity not null, + name varchar2(255), + content clob, + version number(19) not null, + constraint pk_ebasic_json_map_json_b primary key (id) +); + +create table ebasic_json_map_varchar ( + id number(19) generated by default as identity not null, + name varchar2(255), + content varchar2(3000), + version number(19) not null, + constraint pk_ebasic_json_map_varchar primary key (id) +); + +create table ebasic_json_node ( + id number(19) generated by default as identity not null, + name varchar2(255), + content clob, + version number(19) not null, + constraint pk_ebasic_json_node primary key (id) +); + +create table ebasic_json_node_blob ( + id number(19) generated by default as identity not null, + name varchar2(255), + content blob, + version number(19) not null, + constraint pk_ebasic_json_node_blob primary key (id) +); + +create table ebasic_json_node_json_b ( + id number(19) generated by default as identity not null, + name varchar2(255), + content clob, + version number(19) not null, + constraint pk_ebasic_json_node_json_b primary key (id) +); + +create table ebasic_json_node_varchar ( + id number(19) generated by default as identity not null, + name varchar2(255), + content varchar2(1000), + version number(19) not null, + constraint pk_ebasic_json_node_varchar primary key (id) +); + +create table ebasic_json_unmapped ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_ebasic_json_unmapped primary key (id) +); + +create table e_basic_ndc ( + id number(10) generated by default as identity not null, + name varchar2(255), + constraint pk_e_basic_ndc primary key (id) +); + +create table ebasic_no_sdchild ( + id number(19) generated by default as identity not null, + owner_id number(19) not null, + child_name varchar2(255), + amount number(19) not null, + version number(19) not null, + constraint pk_ebasic_no_sdchild primary key (id) +); + +create table ebasic_sdchild ( + id number(19) generated by default as identity not null, + owner_id number(19) not null, + child_name varchar2(255), + amount number(19) not null, + version number(19) not null, + deleted number(1) default 0 not null, + constraint pk_ebasic_sdchild primary key (id) +); + +create table ebasic_soft_delete ( + id number(19) generated by default as identity not null, + name varchar2(255), + description varchar2(255), + version number(19) not null, + deleted number(1) default 0 not null, + constraint pk_ebasic_soft_delete primary key (id) +); + +create table e_basicver ( + id number(10) generated by default as identity not null, + name varchar2(255), + description varchar2(255), + other varchar2(255), + last_update timestamp not null, + constraint pk_e_basicver primary key (id) +); + +create table e_basic_withlife ( + id number(19) generated by default as identity not null, + name varchar2(255), + other varchar2(255), + deleted number(1) default 0 not null, + version number(19) not null, + constraint pk_e_basic_withlife primary key (id) +); + +create table e_basic_with_ex ( + id number(19) generated by default as identity not null, + deleted number(1) default 0 not null, + version number(19) not null, + constraint pk_e_basic_with_ex primary key (id) +); + +create table e_basicverucon ( + id number(10) generated by default as identity not null, + name varchar2(127), + other varchar2(127), + other_one varchar2(127), + description varchar2(255), + last_update timestamp not null, + constraint uq_e_basicverucon_name unique (name), + constraint uq_e_bscvrcn_thr_thr_n unique (other,other_one), + constraint pk_e_basicverucon primary key (id) +); + +create table ecache_child ( + id varchar2(40) not null, + name varchar2(100), + root_id varchar2(40) not null, + constraint pk_ecache_child primary key (id) +); + +create table ecache_root ( + id varchar2(40) not null, + name varchar2(100), + constraint pk_ecache_root primary key (id) +); + +create table e_col_ab ( + id number(19) generated by default as identity not null, + column_a varchar2(255), + column_b varchar2(255), + constraint pk_e_col_ab primary key (id) +); + +create table ecustom_id ( + id varchar2(127) not null, + name varchar2(255), + constraint pk_ecustom_id primary key (id) +); + +create table edefault_prop ( + id number(10) generated by default as identity not null, + e_simple_usertypeid number(10), + name varchar2(255), + constraint uq_edflt_prp__smpl_srtypd unique (e_simple_usertypeid), + constraint pk_edefault_prop primary key (id) +); + +create table eemb_inner ( + id number(10) generated by default as identity not null, + nome_inner varchar2(255), + outer_id number(10), + update_count number(10) not null, + constraint pk_eemb_inner primary key (id) +); + +create table eemb_outer ( + id number(10) generated by default as identity not null, + nome_outer varchar2(255), + date1 timestamp, + date2 timestamp, + update_count number(10) not null, + constraint pk_eemb_outer primary key (id) +); + +create table efile2_no_fk ( + file_name varchar2(64) not null, + owner_id number(10) not null, + constraint pk_efile2_no_fk primary key (file_name) +); + +create table efile_no_fk ( + file_name varchar2(64) not null, + owner_user_id number(10), + owner_soft_del_user_id number(10), + constraint pk_efile_no_fk primary key (file_name) +); + +create table efile_no_fk_euser_no_fk ( + efile_no_fk_file_name varchar2(64) not null, + euser_no_fk_user_id number(10) 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_d ( + efile_no_fk_file_name varchar2(64) not null, + euser_no_fk_soft_del_user_id number(10) not null, + constraint pk_efl_n_fk_sr_n_fk_sft_d primary key (efile_no_fk_file_name,euser_no_fk_soft_del_user_id) +); + +create table egen_props ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) 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 number(19) not null, + long_updated number(19) not null, + constraint pk_egen_props primary key (id) +); + +create table eid_uid_bean ( + id number(19) generated by default as identity not null, + uuid varchar2(40) not null, + name varchar2(255), + constraint uq_eid_uid_bean_uuid unique (uuid), + constraint pk_eid_uid_bean primary key (id) +); + +create table einvoice ( + id number(19) generated by default as identity not null, + invoice_date timestamp, + state number(10), + person_id number(19), + ship_street varchar2(255), + ship_suburb varchar2(255), + ship_city varchar2(255), + ship_status varchar2(3), + bill_street varchar2(255), + bill_suburb varchar2(255), + bill_city varchar2(255), + bill_status varchar2(3), + version number(19) 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 number(10) generated by default as identity not null, + name varchar2(255), + description varchar2(255), + version number(19) not null, + constraint pk_e_main primary key (id) +); + +create table enull_collection ( + id number(10) generated by default as identity not null, + name varchar2(255), + constraint pk_enull_collection primary key (id) +); + +create table enull_collection_detail ( + id number(10) generated by default as identity not null, + enull_collection_id number(10) not null, + something varchar2(255), + constraint pk_enull_collection_detail primary key (id) +); + +create table eopt_one_a ( + id number(10) generated by default as identity not null, + name_for_a varchar2(255), + b_id number(10), + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_eopt_one_a primary key (id) +); + +create table eopt_one_b ( + id number(10) generated by default as identity not null, + name_for_b varchar2(255), + c_id number(10) not null, + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_eopt_one_b primary key (id) +); + +create table eopt_one_c ( + id number(10) generated by default as identity not null, + name_for_c varchar2(255), + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_eopt_one_c primary key (id) +); + +create table eper_addr ( + id number(19) generated by default as identity not null, + name varchar2(255), + ma_street varchar2(255), + ma_suburb varchar2(255), + ma_city varchar2(255), + ma_country_code varchar2(2), + version number(19) not null, + constraint pk_eper_addr primary key (id) +); + +create table eperson ( + id number(19) generated by default as identity not null, + name varchar2(255), + notes varchar2(255), + street varchar2(255), + suburb varchar2(255), + addr_city varchar2(255), + addr_status varchar2(3), + version number(19) not null, + constraint ck_eperson_addr_status check ( addr_status in ('ONE','TWO')), + constraint pk_eperson primary key (id) +); + +create table e_person_online ( + id number(19) generated by default as identity not null, + email varchar2(127), + online_status number(1) default 0 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 number(10) generated by default as identity not null, + name varchar2(255), + constraint pk_esimple primary key (usertypeid) +); + +create table esoft_del_book ( + id number(19) generated by default as identity not null, + book_title varchar2(255), + lend_by_id number(19), + version number(19) not null, + deleted number(1) default 0 not null, + constraint pk_esoft_del_book primary key (id) +); + +create table esoft_del_book_esoft_del_user ( + esoft_del_book_id number(19) not null, + esoft_del_user_id number(19) not null, + constraint pk_esft_dl_bk_sft_dl_sr primary key (esoft_del_book_id,esoft_del_user_id) +); + +create table esoft_del_down ( + id number(19) generated by default as identity not null, + esoft_del_mid_id number(19) not null, + down varchar2(255), + version number(19) not null, + deleted number(1) default 0 not null, + constraint pk_esoft_del_down primary key (id) +); + +create table esoft_del_mid ( + id number(19) generated by default as identity not null, + top_id number(19), + mid varchar2(255), + up_id number(19), + version number(19) not null, + deleted number(1) default 0 not null, + constraint pk_esoft_del_mid primary key (id) +); + +create table esoft_del_one_a ( + id number(19) generated by default as identity not null, + name varchar2(255), + oneb_id number(19), + deleted number(1) default 0 not null, + version number(19) 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 number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_esoft_del_one_b primary key (id) +); + +create table esoft_del_role ( + id number(19) generated by default as identity not null, + role_name varchar2(255), + version number(19) not null, + deleted number(1) default 0 not null, + constraint pk_esoft_del_role primary key (id) +); + +create table esoft_del_role_esoft_del_user ( + esoft_del_role_id number(19) not null, + esoft_del_user_id number(19) not null, + constraint pk_esft_dl_rl_sft_dl_sr primary key (esoft_del_role_id,esoft_del_user_id) +); + +create table esoft_del_top ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + deleted number(1) default 0 not null, + constraint pk_esoft_del_top primary key (id) +); + +create table esoft_del_up ( + id number(19) generated by default as identity not null, + up varchar2(255), + version number(19) not null, + deleted number(1) default 0 not null, + constraint pk_esoft_del_up primary key (id) +); + +create table esoft_del_user ( + id number(19) generated by default as identity not null, + user_name varchar2(255), + version number(19) not null, + deleted number(1) default 0 not null, + constraint pk_esoft_del_user primary key (id) +); + +create table esoft_del_user_esoft_del_role ( + esoft_del_user_id number(19) not null, + esoft_del_role_id number(19) not null, + constraint pk_esft_dl_sr_sft_dl_rl primary key (esoft_del_user_id,esoft_del_role_id) +); + +create table esome_convert_type ( + id number(19) generated by default as identity not null, + name varchar2(255), + money number(16,3), + constraint pk_esome_convert_type primary key (id) +); + +create table esome_type ( + id number(10) generated by default as identity not null, + currency varchar2(3), + locale varchar2(20), + time_zone varchar2(20), + constraint pk_esome_type primary key (id) +); + +create table etrans_many ( + id number(10) generated by default as identity not null, + name varchar2(255), + constraint pk_etrans_many primary key (id) +); + +create table rawinherit_uncle ( + id number(10) generated by default as identity not null, + name varchar2(255), + parent_id number(19) not null, + version number(19) not null, + constraint pk_rawinherit_uncle primary key (id) +); + +create table euser_no_fk ( + user_id number(10) generated by default as identity not null, + user_name varchar2(255), + constraint pk_euser_no_fk primary key (user_id) +); + +create table euser_no_fk_soft_del ( + user_id number(10) generated by default as identity not null, + user_name varchar2(255), + constraint pk_euser_no_fk_soft_del primary key (user_id) +); + +create table evanilla_collection ( + id number(10) generated by default as identity not null, + name varchar2(255), + constraint pk_evanilla_collection primary key (id) +); + +create table evanilla_collection_detail ( + id number(10) generated by default as identity not null, + evanilla_collection_id number(10) not null, + something varchar2(255), + constraint pk_evanilla_collection_detail primary key (id) +); + +create table ewho_props ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + who_created varchar2(255) not null, + who_modified varchar2(255) not null, + constraint pk_ewho_props primary key (id) +); + +create table e_withinet ( + id number(19) generated by default as identity not null, + name varchar2(255), + inet_address varchar2(50), + inet2 varchar2(255), + cidr varchar(50), + version number(19) not null, + constraint pk_e_withinet primary key (id) +); + +create table ec_enum_person ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_ec_enum_person primary key (id) +); + +create table ec_enum_person_tags ( + ec_enum_person_id number(19) not null, + value varchar2(5) not null, + constraint ck_ec_enum_person_tags_value check ( value in ('RED','BLUE','GREEN')) +); + +create table ec_person ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_ec_person primary key (id) +); + +create table ec_person_phone ( + owner_id number(19) not null, + phone varchar2(255) not null +); + +create table ec_top ( + id number(19) generated by default as identity not null, + name varchar2(255), + person_id number(19), + version number(19) not null, + constraint pk_ec_top primary key (id) +); + +create table ec_top_ecs_person ( + ec_top_id number(19) not null, + ecs_person_id number(19) not null, + constraint pk_ec_top_ecs_person primary key (ec_top_id,ecs_person_id) +); + +create table ecbl_person ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_ecbl_person primary key (id) +); + +create table ecbl_person_phone_numbers ( + person_id number(19) not null, + country_code varchar2(2), + area varchar2(6), + phnum varchar2(20) +); + +create table ecbm_person ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_ecbm_person primary key (id) +); + +create table ecbm_person_phone_numbers ( + person_id number(19) not null, + mkey varchar2(255) not null, + country_code varchar2(2), + area varchar2(6), + phnum varchar2(20) +); + +create table ecm_person ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_ecm_person primary key (id) +); + +create table ecm_person_phone_numbers ( + ecm_person_id number(19) not null, + type varchar2(4) not null, + phnum varchar2(10) not null +); + +create table ecmc_person ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_ecmc_person primary key (id) +); + +create table ecmc_person_phone_numbers ( + ecmc_person_id number(19) not null, + type varchar2(4) not null, + value clob not null +); + +create table ecs_person ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_ecs_person primary key (id) +); + +create table ecs_person_phone ( + ecs_person_id number(19) not null, + phone varchar2(255) not null +); + +create table ecsm_child ( + one_id varchar2(40) not null, + ecsm_parent_id number(19) not null, + name varchar2(255), + version number(19) not null, + constraint pk_ecsm_child primary key (one_id) +); + +create table ecsm_values ( + host_id varchar2(40) not null, + value varchar2(255) not null +); + +create table ecsm_one ( + one_id varchar2(40) not null, + name varchar2(255), + version number(19) not null, + constraint pk_ecsm_one primary key (one_id) +); + +create table ecsm_parent ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_ecsm_parent primary key (id) +); + +create table ecsm_two ( + id varchar2(40) not null, + name varchar2(255), + version number(19) not null, + constraint pk_ecsm_two primary key (id) +); + +create table td_child ( + child_id number(10) generated by default as identity not null, + child_name varchar2(255), + parent_id number(10) not null, + constraint pk_td_child primary key (child_id) +); + +create table td_parent ( + parent_type varchar2(31) not null, + parent_id number(10) generated by default as identity not null, + parent_name varchar2(255), + extended_name varchar2(255), + constraint pk_td_parent primary key (parent_id) +); + +create table element_bean ( + id number(19) generated by default as identity not null, + complex_bean_id varchar2(40) not null, + value varchar2(255) not null, + constraint pk_element_bean primary key (id) +); + +create table empl ( + id number(19) generated by default as identity not null, + name varchar2(255), + age number(10), + default_address_id number(19), + constraint pk_empl primary key (id) +); + +create table esd_detail ( + id number(19) generated by default as identity not null, + name varchar2(255), + master_id number(19) not null, + version number(19) not null, + deleted number(1) default 0 not null, + constraint pk_esd_detail primary key (id) +); + +create table esd_master ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + deleted number(1) default 0 not null, + constraint pk_esd_master primary key (id) +); + +create table feature_desc ( + id number(10) generated by default as identity not null, + name varchar2(255), + description varchar2(255), + constraint pk_feature_desc primary key (id) +); + +create table f_first ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_f_first primary key (id) +); + +create table foo ( + foo_id number(10) generated by default as identity not null, + important_text varchar2(255), + version number(10) not null, + constraint pk_foo primary key (foo_id) +); + +create table gen_key_identity ( + id number(19) generated by default as identity not null, + description varchar2(255), + constraint pk_gen_key_identity primary key (id) +); + +create table gen_key_sequence ( + id number(19) not null, + description varchar2(255), + constraint pk_gen_key_sequence primary key (id) +); +create sequence SEQ_NAME increment by 1; + +create table grand_parent_person ( + identifier number(10) generated by default as identity not null, + name varchar2(255), + age number(10), + some_bean_id number(10), + family_name varchar2(255), + address varchar2(255), + constraint pk_grand_parent_person primary key (identifier) +); + +create table survey_group ( + id number(19) generated by default as identity not null, + name varchar2(255), + categoryobjectid number(19), + sequence_number number(10) not null, + constraint pk_survey_group primary key (id) +); + +create table c_group ( + id number(19) generated by default as identity not null, + inactive number(1) default 0 not null, + name varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_c_group primary key (id) +); + +create table he_doc ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_he_doc primary key (id) +); + +create table hx_link ( + id number(19) generated by default as identity not null, + name varchar2(255), + location varchar2(255), + comments varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + deleted number(1) default 0 not null, + constraint pk_hx_link primary key (id) +); + +create table hx_link_doc ( + hx_link_id number(19) not null, + he_doc_id number(19) not null, + constraint pk_hx_link_doc primary key (hx_link_id,he_doc_id) +); + +create table hi_doc ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_hi_doc primary key (id) +); + +create table hi_link ( + id number(19) generated by default as identity not null, + name varchar2(255), + location varchar2(255), + comments varchar2(255), + version number(19) 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 number(19) not null, + hi_doc_id number(19) not null, + constraint pk_hi_link_doc primary key (hi_link_id,hi_doc_id) +); + +create table hi_tone ( + id number(19) generated by default as identity not null, + name varchar2(255), + comments varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_hi_tone primary key (id) +); + +create table hi_tthree ( + id number(19) generated by default as identity not null, + hi_ttwo_id number(19) not null, + three varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_hi_tthree primary key (id) +); + +create table hi_ttwo ( + id number(19) generated by default as identity not null, + hi_tone_id number(19) not null, + two varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_hi_ttwo primary key (id) +); + +create table hsd_setting ( + id number(19) generated by default as identity not null, + code varchar2(255), + content varchar2(255), + user_id number(19), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + deleted number(1) default 0 not null, + constraint uq_hsd_setting_user_id unique (user_id), + constraint pk_hsd_setting primary key (id) +); + +create table hsd_user ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + deleted number(1) default 0 not null, + constraint pk_hsd_user primary key (id) +); + +create table iaf_segment ( + ptype varchar2(31) not null, + id number(19) generated by default as identity not null, + segment_id_zat number(19) not null, + status_id number(19) not null, + constraint pk_iaf_segment primary key (id) +); + +create table iaf_segment_status ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_iaf_segment_status primary key (id) +); + +create table imrelated ( + id number(19) generated by default as identity not null, + name varchar2(255), + owner_id number(19) not null, + constraint pk_imrelated primary key (id) +); + +create table imroot ( + dtype varchar2(31) not null, + id number(19) generated by default as identity not null, + name varchar2(255), + title varchar2(255), + when_title timestamp, + constraint pk_imroot primary key (id) +); + +create table ixresource ( + dtype varchar2(255), + id varchar2(40) not null, + name varchar2(255), + constraint pk_ixresource primary key (id) +); + +create table info_company ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_info_company primary key (id) +); + +create table info_contact ( + id number(19) generated by default as identity not null, + name varchar2(255), + company_id number(19) not null, + version number(19) not null, + constraint pk_info_contact primary key (id) +); + +create table info_customer ( + id number(19) generated by default as identity not null, + name varchar2(255), + company_id number(19), + version number(19) not null, + constraint uq_info_customer_company_id unique (company_id), + constraint pk_info_customer primary key (id) +); + +create table inner_report ( + id number(19) generated by default as identity not null, + name varchar2(255), + forecast_id number(19), + constraint uq_inner_report_forecast_id unique (forecast_id), + constraint pk_inner_report primary key (id) +); + +create table drel_invoice ( + id number(19) not null, + booking number(19), + version number(10) not null, + constraint pk_drel_invoice primary key (id) +); +create sequence drel_invoice_seq increment by 1; + +create table item ( + customer number(10) not null, + itemnumber varchar2(127) not null, + description varchar2(255), + units varchar2(255), + type number(10) not null, + region number(10) not null, + date_modified timestamp, + date_created timestamp, + modified_by varchar2(255), + created_by varchar2(255), + version number(19) not null, + constraint pk_item primary key (customer,itemnumber) +); + +create table monkey ( + mid number(19) generated by default as identity not null, + name varchar2(255), + food_preference varchar2(255), + version number(19) not null, + constraint pk_monkey primary key (mid) +); + +create table mkeygroup ( + pid number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_mkeygroup primary key (pid) +); + +create table mkeygroup_monkey ( + mkeygroup_pid number(19) not null, + monkey_mid number(19) not null, + constraint uq_mkeygroup_monkey_mid unique (monkey_mid), + constraint pk_mkeygroup_monkey primary key (mkeygroup_pid,monkey_mid) +); + +create table trainer ( + tid number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_trainer primary key (tid) +); + +create table trainer_monkey ( + trainer_tid number(19) not null, + monkey_mid number(19) not null, + constraint uq_trainer_monkey_mid unique (monkey_mid), + constraint pk_trainer_monkey primary key (trainer_tid,monkey_mid) +); + +create table troop ( + pid number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_troop primary key (pid) +); + +create table troop_monkey ( + troop_pid number(19) not null, + monkey_mid number(19) 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 number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_l2_cldf_reset_bean primary key (id) +); + +create table l2_cldf_reset_bean_child ( + id number(19) generated by default as identity not null, + parent_id number(19), + constraint pk_l2_cldf_reset_bean_child primary key (id) +); + +create table level1 ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_level1 primary key (id) +); + +create table level1_level4 ( + level1_id number(19) not null, + level4_id number(19) not null, + constraint pk_level1_level4 primary key (level1_id,level4_id) +); + +create table level1_level2 ( + level1_id number(19) not null, + level2_id number(19) not null, + constraint pk_level1_level2 primary key (level1_id,level2_id) +); + +create table level2 ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_level2 primary key (id) +); + +create table level2_level3 ( + level2_id number(19) not null, + level3_id number(19) not null, + constraint pk_level2_level3 primary key (level2_id,level3_id) +); + +create table level3 ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_level3 primary key (id) +); + +create table level4 ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_level4 primary key (id) +); + +create table link ( + id number(19) generated by default as identity not null, + name varchar2(255), + location varchar2(255), + when_publish timestamp, + link_comment varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + deleted number(1) default 0 not null, + constraint pk_link primary key (id) +); + +create table link_draft ( + id number(19) generated by default as identity not null, + name varchar2(255), + location varchar2(255), + when_publish timestamp, + link_comment varchar2(255), + dirty number(1) default 0 not null, + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + deleted number(1) default 0 not null, + constraint pk_link_draft primary key (id) +); + +create table la_attr_value ( + id number(10) generated by default as identity not null, + name varchar2(255), + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_la_attr_value primary key (id) +); + +create table la_attr_value_attribute ( + la_attr_value_id number(10) not null, + attribute_id number(10) not null, + constraint pk_la_attr_value_attribute primary key (la_attr_value_id,attribute_id) +); + +create table looney ( + id number(19) generated by default as identity not null, + tune_id number(19), + name varchar2(255), + constraint pk_looney primary key (id) +); + +create table maddress ( + id varchar2(40) not null, + street varchar2(255), + city varchar2(255), + version number(19) not null, + constraint pk_maddress primary key (id) +); + +create table mcontact ( + id varchar2(40) not null, + email varchar2(255), + first_name varchar2(255), + last_name varchar2(255), + customer_id varchar2(40), + version number(19) not null, + constraint pk_mcontact primary key (id) +); + +create table mcontact_message ( + id varchar2(40) not null, + title varchar2(255), + subject varchar2(255), + notes varchar2(255), + contact_id varchar2(40) not null, + version number(19) not null, + constraint pk_mcontact_message primary key (id) +); + +create table mcustomer ( + id varchar2(40) not null, + name varchar2(255), + notes varchar2(255), + shipping_address_id varchar2(40), + billing_address_id varchar2(40), + version number(19) not null, + constraint pk_mcustomer primary key (id) +); + +create table mgroup ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_mgroup primary key (id) +); + +create table mmachine ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_mmachine primary key (id) +); + +create table mmachine_mgroup ( + mmachine_id number(19) not null, + mgroup_id number(19) not null, + constraint pk_mmachine_mgroup primary key (mmachine_id,mgroup_id) +); + +create table mmedia ( + type varchar2(31) not null, + id number(19) generated by default as identity not null, + url varchar2(255), + note varchar2(255), + constraint pk_mmedia primary key (id) +); + +create table non_updateprop ( + id number(10) generated by default as identity not null, + non_enum varchar2(5), + name varchar2(255), + note varchar2(255), + constraint ck_non_updateprop_non_enum check ( non_enum in ('BEGIN','END')), + constraint pk_non_updateprop primary key (id) +); + +create table mprinter ( + id number(19) generated by default as identity not null, + name varchar2(255), + flags number(19) not null, + current_state_id number(19), + last_swap_cyan_id number(19), + last_swap_magenta_id number(19), + last_swap_yellow_id number(19), + last_swap_black_id number(19), + version number(19) not null, + constraint uq_mprinter_last_swap_cyan_id unique (last_swap_cyan_id), + constraint uq_mprntr_lst_swp_mgnt_d unique (last_swap_magenta_id), + constraint uq_mprntr_lst_swp_yllw_d unique (last_swap_yellow_id), + constraint uq_mprntr_lst_swp_blck_d unique (last_swap_black_id), + constraint pk_mprinter primary key (id) +); + +create table mprinter_state ( + id number(19) generated by default as identity not null, + flags number(19) not null, + printer_id number(19), + version number(19) not null, + constraint pk_mprinter_state primary key (id) +); + +create table mprofile ( + id number(19) generated by default as identity not null, + picture_id number(19), + name varchar2(255), + constraint pk_mprofile primary key (id) +); + +create table mprotected_construct_bean ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_mprotected_construct_bean primary key (id) +); + +create table mrole ( + roleid number(10) generated by default as identity not null, + role_name varchar2(255), + constraint pk_mrole primary key (roleid) +); + +create table mrole_muser ( + mrole_roleid number(10) not null, + muser_userid number(10) not null, + constraint pk_mrole_muser primary key (mrole_roleid,muser_userid) +); + +create table msome_other ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_msome_other primary key (id) +); + +create table muser ( + userid number(10) generated by default as identity not null, + user_name varchar2(255), + user_type_id number(10), + constraint pk_muser primary key (userid) +); + +create table muser_type ( + id number(10) generated by default as identity not null, + name varchar2(255), + constraint pk_muser_type primary key (id) +); + +create table mail_box ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_mail_box primary key (id) +); + +create table mail_user ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_mail_user primary key (id) +); + +create table mail_user_inbox ( + mail_user_id number(19) not null, + mail_box_id number(19) not null, + constraint pk_mail_user_inbox primary key (mail_user_id,mail_box_id) +); + +create table mail_user_outbox ( + mail_user_id number(19) not null, + mail_box_id number(19) not null, + constraint pk_mail_user_outbox primary key (mail_user_id,mail_box_id) +); + +create table main_entity ( + id varchar2(255) not null, + attr1 varchar2(255), + attr2 varchar2(255), + constraint pk_main_entity primary key (id) +); + +create table main_entity_relation ( + id varchar2(40) not null, + id1 varchar2(255), + id2 varchar2(255), + attr1 varchar2(255), + constraint pk_main_entity_relation primary key (id) +); + +create table map_super_actual ( + id number(19) generated by default as identity not null, + name varchar2(255), + when_created timestamp not null, + when_updated timestamp not null, + constraint pk_map_super_actual primary key (id) +); + +create table c_message ( + id number(19) generated by default as identity not null, + title varchar2(255), + body varchar2(255), + conversation_id number(19), + user_id number(19), + version number(19) 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 varchar2(40) not null, + street varchar2(255) not null, + constraint pk_meter_address_data primary key (id) +); + +create table meter_contract_data ( + id varchar2(40) not null, + special_needs_client_id varchar2(40) not null, + constraint uq_mtr_cntrct_dt_spcl_nds_c_1 unique (special_needs_client_id), + constraint pk_meter_contract_data primary key (id) +); + +create table meter_special_needs_client ( + id varchar2(40) not null, + name varchar2(255), + primary_id varchar2(40), + constraint uq_mtr_spcl_nds_clnt_prmry_d unique (primary_id), + constraint pk_meter_special_needs_client primary key (id) +); + +create table meter_special_needs_contact ( + id varchar2(40) not null, + name varchar2(255), + constraint pk_mtr_spcl_nds_cntct primary key (id) +); + +create table meter_version ( + id varchar2(40) not null, + address_data_id varchar2(40), + contract_data_id varchar2(40) not null, + constraint uq_mtr_vrsn_ddrss_dt_d unique (address_data_id), + constraint uq_mtr_vrsn_cntrct_dt_d unique (contract_data_id), + constraint pk_meter_version primary key (id) +); + +create table mnoc_role ( + role_id number(10) generated by default as identity not null, + role_name varchar2(255), + version number(10) not null, + constraint pk_mnoc_role primary key (role_id) +); + +create table mnoc_user ( + user_id number(10) generated by default as identity not null, + user_name varchar2(255), + version number(10) not null, + constraint pk_mnoc_user primary key (user_id) +); + +create table mnoc_user_mnoc_role ( + mnoc_user_user_id number(10) not null, + mnoc_role_role_id number(10) not null, + constraint pk_mnoc_user_mnoc_role primary key (mnoc_user_user_id,mnoc_role_role_id) +); + +create table mny_a ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_mny_a primary key (id) +); + +create table mny_b ( + id number(19) generated by default as identity not null, + name varchar2(255), + a_id number(19), + version number(19) 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 number(19) not null, + mny_c_id number(19) not null, + constraint pk_mny_b_mny_c primary key (mny_b_id,mny_c_id) +); + +create table mny_c ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_mny_c primary key (id) +); + +create table mny_topic ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_mny_topic primary key (id) +); + +create table subtopics ( + topic number(19) not null, + subtopic number(19) not null, + constraint pk_subtopics primary key (topic,subtopic) +); + +create table mp_role ( + id number(19) generated by default as identity not null, + mp_user_id number(19) not null, + code varchar2(255), + organization_id number(19), + constraint pk_mp_role primary key (id) +); + +create table mp_user ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_mp_user primary key (id) +); + +create table ms_many_a ( + aid number(19) generated by default as identity not null, + name varchar2(255), + ms_many_a_many_b number(1) default 0 not null, + ms_many_b number(1) default 0 not null, + deleted number(1) default 0 not null, + constraint pk_ms_many_a primary key (aid) +); + +create table ms_many_a_many_b ( + ms_many_a_aid number(19) not null, + ms_many_b_bid number(19) 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 number(19) generated by default as identity not null, + name varchar2(255), + deleted number(1) default 0 not null, + constraint pk_ms_many_b primary key (bid) +); + +create table ms_many_b_many_a ( + ms_many_b_bid number(19) not null, + ms_many_a_aid number(19) 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 number(10) generated by default as identity not null, + name varchar2(255), + my_count number(10) not null, + my_lob clob, + constraint pk_my_lob_size primary key (id) +); + +create table my_lob_size_join_many ( + id number(10) generated by default as identity not null, + something varchar2(255), + other varchar2(255), + parent_id number(10), + constraint pk_my_lob_size_join_many primary key (id) +); + +create table noidbean ( + name varchar2(255), + subject varchar2(255), + when_created timestamp not null +); + +create table o_bean_child ( + id number(19) generated by default as identity not null, + cached_bean_id number(19), + constraint pk_o_bean_child primary key (id) +); + +create table ocached_app ( + id number(19) generated by default as identity not null, + app_name varchar2(255), + version number(19) not null, + constraint uq_ocached_app_app_name unique (app_name), + constraint pk_ocached_app primary key (id) +); + +create table ocached_app_detail ( + id number(19) generated by default as identity not null, + app_id number(19) not null, + detail varchar2(255), + version number(19) not null, + constraint uq_occhd_pp_dtl_pp_d_dtl unique (app_id,detail), + constraint pk_ocached_app_detail primary key (id) +); + +create table o_cached_bean ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_o_cached_bean primary key (id) +); + +create table o_cached_bean_country ( + o_cached_bean_id number(19) not null, + o_country_code varchar2(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 number(19) generated by default as identity not null, + cached_bean_id number(19), + constraint pk_o_cached_bean_child primary key (id) +); + +create table o_cached_inherit ( + dtype varchar2(31) not null, + id number(19) generated by default as identity not null, + name varchar2(255), + child_adata varchar2(255), + child_bdata varchar2(255), + constraint pk_o_cached_inherit primary key (id) +); + +create table o_cached_natkey ( + id number(19) generated by default as identity not null, + store varchar2(255), + sku varchar2(255), + description varchar2(255), + constraint pk_o_cached_natkey primary key (id) +); + +create table o_cached_natkey3 ( + id number(19) generated by default as identity not null, + store varchar2(255), + code number(10) not null, + sku varchar2(255), + description varchar2(255), + constraint pk_o_cached_natkey3 primary key (id) +); + +create table ocached_nkey_uid ( + id number(19) generated by default as identity not null, + cid varchar2(40), + other varchar2(255), + version number(19) not null, + constraint pk_ocached_nkey_uid primary key (id) +); + +create table ocar ( + id number(10) generated by default as identity not null, + vin varchar2(255), + name varchar2(255), + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_ocar primary key (id) +); + +create table ocompany ( + id number(10) generated by default as identity not null, + corp_id varchar2(50), + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint uq_ocompany_corp_id unique (corp_id), + constraint pk_ocompany primary key (id) +); + +create table oengine ( + engine_id varchar2(40) not null, + short_desc varchar2(255), + car_id number(10), + version number(10) not null, + constraint uq_oengine_car_id unique (car_id), + constraint pk_oengine primary key (engine_id) +); + +create table ogear_box ( + id varchar2(40) not null, + box_desc varchar2(255), + box_size number(10), + car_id number(10), + version number(10) not null, + constraint uq_ogear_box_car_id unique (car_id), + constraint pk_ogear_box primary key (id) +); + +create table omvertex ( + id varchar2(40) not null, + constraint pk_omvertex primary key (id) +); + +create table omvertex_other ( + id varchar2(40) not null, + omvertex_id varchar2(40) not null, + name varchar2(255), + constraint pk_omvertex_other primary key (id) +); + +create table oroad_show_msg ( + id number(10) generated by default as identity not null, + company_id number(10) not null, + cretime timestamp not null, + updtime timestamp not null, + version number(19) 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 number(19) generated by default as identity not null, + description varchar2(255), + banana_rama_id number(19), + constraint pk_om_account_child_dbo primary key (id) +); + +create table om_account_dbo ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_om_account_dbo primary key (id) +); + +create table om_basic_child ( + id number(19) generated by default as identity not null, + name varchar2(255), + parent_id number(19), + version number(19) not null, + constraint pk_om_basic_child primary key (id) +); + +create table om_basic_parent ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_om_basic_parent primary key (id) +); + +create table om_ordered_detail ( + id number(19) generated by default as identity not null, + name varchar2(255), + master_id number(19), + version number(19) not null, + sort_order number(10), + constraint pk_om_ordered_detail primary key (id) +); + +create table om_ordered_master ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_om_ordered_master primary key (id) +); + +create table only_id_entity ( + id number(19) generated by default as identity not null, + constraint pk_only_id_entity primary key (id) +); + +create table o_order ( + id number(10) generated by default as identity not null, + status number(10), + order_date date, + ship_date date, + kcustomer_id number(10) 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 number(10) generated by default as identity not null, + order_id number(10) not null, + order_qty number(10), + ship_qty number(10), + unit_price number(19,4), + product_id number(10), + cretime timestamp, + updtime timestamp not null, + constraint pk_o_order_detail primary key (id) +); + +create table s_orders ( + uuid varchar2(40) not null, + constraint pk_s_orders primary key (uuid) +); + +create table s_order_items ( + uuid varchar2(40) not null, + product_variant_uuid varchar2(255), + order_uuid varchar2(40), + quantity number(10) not null, + amount number(16,3), + constraint pk_s_order_items primary key (uuid) +); + +create table or_order_ship ( + id number(10) generated by default as identity not null, + order_id number(10), + ship_time timestamp, + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_or_order_ship primary key (id) +); + +create table organisation ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_organisation primary key (id) +); + +create table organization_node ( + kind varchar2(31) not null, + id number(19) generated by default as identity not null, + parent_tree_node_id number(19) not null, + title varchar2(255), + constraint uq_orgnztn_nd_prnt_tr_nd_d unique (parent_tree_node_id), + constraint pk_organization_node primary key (id) +); + +create table organization_tree_node ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_organization_tree_node primary key (id) +); + +create table orp_detail ( + id varchar2(100) not null, + detail varchar2(255), + master_id varchar2(100), + version number(19) not null, + constraint pk_orp_detail primary key (id) +); + +create table orp_detail2 ( + id varchar2(100) not null, + orp_master2_id varchar2(100) not null, + detail varchar2(255), + master_id varchar2(255), + version number(19) not null, + constraint pk_orp_detail2 primary key (id) +); + +create table orp_master ( + id varchar2(100) not null, + name varchar2(255), + version number(19) not null, + constraint pk_orp_master primary key (id) +); + +create table orp_master2 ( + id varchar2(100) not null, + name varchar2(255), + version number(19) not null, + constraint pk_orp_master2 primary key (id) +); + +create table oto_aone ( + id varchar2(100) not null, + description varchar2(255), + constraint pk_oto_aone primary key (id) +); + +create table oto_atwo ( + id varchar2(100) not null, + description varchar2(255), + aone_id varchar2(100), + constraint uq_oto_atwo_aone_id unique (aone_id), + constraint pk_oto_atwo primary key (id) +); + +create table oto_bchild ( + master_id number(19) generated by default as identity not null, + child varchar2(255), + constraint pk_oto_bchild primary key (master_id) +); + +create table oto_bmaster ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_oto_bmaster primary key (id) +); + +create table oto_child ( + id number(10) generated by default as identity not null, + name varchar2(255), + master_id number(19), + constraint uq_oto_child_master_id unique (master_id), + constraint pk_oto_child primary key (id) +); + +create table oto_cust ( + cid number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_oto_cust primary key (cid) +); + +create table oto_cust_address ( + aid number(19) generated by default as identity not null, + line1 varchar2(255), + line2 varchar2(255), + line3 varchar2(255), + customer_cid number(19), + version number(19) not null, + constraint uq_ot_cst_ddrss_cstmr_cd unique (customer_cid), + constraint pk_oto_cust_address primary key (aid) +); + +create table oto_level_a ( + id number(19) generated by default as identity not null, + name varchar2(255), + b_id number(19), + constraint uq_oto_level_a_b_id unique (b_id), + constraint pk_oto_level_a primary key (id) +); + +create table oto_level_b ( + id number(19) generated by default as identity not null, + name varchar2(255), + c_id number(19), + constraint uq_oto_level_b_c_id unique (c_id), + constraint pk_oto_level_b primary key (id) +); + +create table oto_level_c ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_oto_level_c primary key (id) +); + +create table oto_master ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_oto_master primary key (id) +); + +create table oto_prime ( + pid number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_oto_prime primary key (pid) +); + +create table oto_prime_extra ( + eid number(19) generated by default as identity not null, + extra varchar2(255), + version number(19) not null, + constraint pk_oto_prime_extra primary key (eid) +); + +create table oto_sd_child ( + id number(19) generated by default as identity not null, + child varchar2(255), + master_id number(19), + deleted number(1) default 0 not null, + version number(19) 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 number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_oto_sd_master primary key (id) +); + +create table oto_th_many ( + id number(19) generated by default as identity not null, + oto_th_top_id number(19) not null, + many varchar2(255), + version number(19) 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 number(19) generated by default as identity not null, + one number(1) default 0 not null, + many_id number(19), + version number(19) 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 number(19) generated by default as identity not null, + topp varchar2(255), + version number(19) 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 varchar2(40) not null, + name varchar2(255), + version number(19) not null, + constraint pk_oto_ubprime primary key (pid) +); + +create table oto_ubprime_extra ( + eid varchar2(40) not null, + extra varchar2(255), + version number(19) not null, + constraint pk_oto_ubprime_extra primary key (eid) +); + +create table oto_uprime ( + pid varchar2(40) not null, + name varchar2(255), + version number(19) not null, + constraint pk_oto_uprime primary key (pid) +); + +create table oto_uprime_extra ( + eid varchar2(40) not null, + extra varchar2(255), + version number(19) not null, + constraint pk_oto_uprime_extra primary key (eid) +); + +create table oto_user_model ( + id number(19) generated by default as identity not null, + name varchar2(255), + user_optional_id number(19), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint uq_ot_sr_mdl_sr_ptnl_d unique (user_optional_id), + constraint pk_oto_user_model primary key (id) +); + +create table oto_user_model_optional ( + id number(19) generated by default as identity not null, + optional varchar2(255), + version number(19) 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 number(10) generated by default as identity not null, + name varchar2(255), + file_content_id number(10), + file_content2_id number(10), + cretime timestamp not null, + updtime timestamp not null, + version number(19) 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 number(10) generated by default as identity not null, + content blob, + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_pfile_content primary key (id) +); + +create table paggview ( + pview_id varchar2(40), + amount number(10) not null, + constraint uq_paggview_pview_id unique (pview_id) +); + +create table pallet_location ( + type varchar2(31) not null, + id number(10) generated by default as identity not null, + zone_sid number(10) not null, + attribute varchar2(255), + constraint pk_pallet_location primary key (id) +); + +create table parcel ( + parcelid number(19) generated by default as identity not null, + description varchar2(255), + constraint pk_parcel primary key (parcelid) +); + +create table parcel_location ( + parcellocid number(19) generated by default as identity not null, + location varchar2(255), + parcelid number(19), + constraint uq_parcel_location_parcelid unique (parcelid), + constraint pk_parcel_location primary key (parcellocid) +); + +create table rawinherit_parent ( + type varchar2(31) not null, + id number(19) generated by default as identity not null, + val number(10), + more varchar2(255), + constraint pk_rawinherit_parent primary key (id) +); + +create table rawinherit_parent_rawinherit_d ( + rawinherit_parent_id number(19) not null, + rawinherit_data_id number(19) not null, + constraint pk_rwnhrt_prnt_rwnhrt_d primary key (rawinherit_parent_id,rawinherit_data_id) +); + +create table e_save_test_c ( + id number(19) generated by default as identity not null, + version number(19) not null, + constraint pk_e_save_test_c primary key (id) +); + +create table parent_person ( + identifier number(10) generated by default as identity not null, + name varchar2(255), + age number(10), + some_bean_id number(10), + parent_identifier number(10), + family_name varchar2(255), + address varchar2(255), + constraint pk_parent_person primary key (identifier) +); + +create table c_participation ( + id number(19) generated by default as identity not null, + rating number(10), + type number(10), + conversation_id number(19) not null, + user_id number(19) not null, + version number(19) 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 number(19) generated by default as identity not null, + enc1 varchar2(30), + enc2 varchar2(40), + enc3 clob, + enc4 raw(30), + enc5 raw(40), + enc6 blob, + version number(19) 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 number(19) generated by default as identity not null, + pcf_person_id number(19) not null, + version number(19) not null, + constraint pk_pcf_calendar primary key (id) +); + +create table pcf_city ( + id number(19) generated by default as identity not null, + pcf_country_id number(19) not null, + name varchar2(255), + mayor_id number(19) not null, + vice_mayor_id number(19) not null, + version number(19) 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 number(19) generated by default as identity not null, + version number(19) not null, + constraint pk_pcf_country primary key (id) +); + +create table pcf_event ( + id number(19) generated by default as identity not null, + pcf_calendar_id number(19) not null, + name varchar2(255), + version number(19) not null, + constraint pk_pcf_event primary key (id) +); + +create table pcf_person ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_pcf_person primary key (id) +); + +create table mt_permission ( + id varchar2(40) not null, + name varchar2(255), + constraint pk_mt_permission primary key (id) +); + +create table persistent_file ( + id number(10) generated by default as identity not null, + name varchar2(255), + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_persistent_file primary key (id) +); + +create table persistent_file_content ( + id number(10) generated by default as identity not null, + persistent_file_id number(10), + content blob, + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint uq_prsstnt_fl_cntnt_prsstnt_1 unique (persistent_file_id), + constraint pk_persistent_file_content primary key (id) +); + +create table person ( + oid number(19) generated by default as identity not null, + default_address_oid number(19), + version number(10) not null, + constraint pk_person primary key (oid) +); + +create table persons ( + id number(19) generated by default as identity (start with 1000 increment by 40) not null, + surname varchar2(64) not null, + name varchar2(64) not null, + constraint pk_persons primary key (id) +); + +create table person_cache_email ( + id varchar2(128) not null, + person_info_person_id varchar2(128), + email varchar2(255), + constraint pk_person_cache_email primary key (id) +); + +create table person_cache_info ( + person_id varchar2(128) not null, + name varchar2(255), + constraint pk_person_cache_info primary key (person_id) +); + +create table phones ( + id number(19) generated by default as identity not null, + phone_number varchar2(7) not null, + person_id number(19) not null, + constraint uq_phones_phone_number unique (phone_number), + constraint pk_phones primary key (id) +); + +create table e_position ( + id number(19) generated by default as identity not null, + name varchar2(255), + contract_id number(19) not null, + constraint pk_e_position primary key (id) +); + +create table primary_revision ( + id number(19) not null, + revision number(10) not null, + name varchar2(255), + version number(19) not null, + constraint pk_primary_revision primary key (id,revision) +); + +create table o_product ( + id number(10) generated by default as identity not null, + sku varchar2(20), + name varchar2(255), + cretime timestamp not null, + updtime timestamp not null, + constraint pk_o_product primary key (id) +); + +create table pp ( + id varchar2(40) not null, + name varchar2(255), + value varchar2(100) not null, + constraint pk_pp primary key (id) +); + +create table pp_to_ww ( + pp_id varchar2(40) not null, + ww_id varchar2(40) not null, + constraint pk_pp_to_ww primary key (pp_id,ww_id) +); + +create table question ( + id number(19) generated by default as identity not null, + name varchar2(255), + groupobjectid number(19), + sequence_number number(10) not null, + constraint pk_question primary key (id) +); + +create table rcustomer ( + company varchar2(127) not null, + name varchar2(127) not null, + description varchar2(255), + constraint pk_rcustomer primary key (company,name) +); + +create table r_orders ( + company varchar2(127) not null, + order_number number(10) not null, + customername varchar2(127), + item varchar2(255), + constraint pk_r_orders primary key (company,order_number) +); + +create table referencing_bean ( + id varchar2(40) not null, + constraint pk_referencing_bean primary key (id) +); + +create table region ( + customer number(10) not null, + type number(10) not null, + description varchar2(255), + version number(19) not null, + constraint pk_region primary key (customer,type) +); + +create table rel_detail ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(10) not null, + constraint pk_rel_detail primary key (id) +); + +create table rel_master ( + id number(19) generated by default as identity not null, + name varchar2(255), + detail_id number(19), + version number(10) not null, + constraint pk_rel_master primary key (id) +); + +create table resourcefile ( + id varchar2(64) not null, + parentresourcefileid varchar2(64), + name varchar2(128) not null, + constraint pk_resourcefile primary key (id) +); + +create table mt_role ( + id varchar2(40) not null, + name varchar2(50), + tenant_id varchar2(40), + version number(19) not null, + constraint pk_mt_role primary key (id) +); + +create table mt_role_permission ( + mt_role_id varchar2(40) not null, + mt_permission_id varchar2(40) not null, + constraint pk_mt_role_permission primary key (mt_role_id,mt_permission_id) +); + +create table em_role ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_em_role primary key (id) +); + +create table root_bean ( + dtype varchar2(31) not null, + id varchar2(40) not null, + referencing_bean_id varchar2(40) not null, + value varchar2(255), + constraint pk_root_bean primary key (id) +); + +create table f_second ( + id number(19) generated by default as identity not null, + mod_name varchar2(255), + first number(19), + title varchar2(255), + constraint uq_f_second_first unique (first), + constraint pk_f_second primary key (id) +); + +create table section ( + id number(10) generated by default as identity not null, + article_id number(10), + type number(10), + content clob, + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint ck_section_type check ( type in (0,1)), + constraint pk_section primary key (id) +); + +create table self_parent ( + id number(19) generated by default as identity not null, + name varchar2(255), + parent_id number(19), + version number(19) not null, + constraint pk_self_parent primary key (id) +); + +create table self_ref_customer ( + id number(19) generated by default as identity not null, + name varchar2(255), + referred_by_id number(19), + constraint pk_self_ref_customer primary key (id) +); + +create table self_ref_example ( + id number(19) generated by default as identity not null, + name varchar2(255) not null, + parent_id number(19), + constraint pk_self_ref_example primary key (id) +); + +create table e_save_test_a ( + id number(19) generated by default as identity not null, + version number(19) not null, + constraint pk_e_save_test_a primary key (id) +); + +create table e_save_test_b ( + id number(19) generated by default as identity not null, + sibling_a_id number(19), + test_property number(1) default 0 not null, + version number(19) 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 varchar2(40) not null, + name varchar2(255), + parent_id varchar2(40), + data_container_id varchar2(40), + site_address_id varchar2(40), + 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 varchar2(40) not null, + street varchar2(255), + city varchar2(255), + zip_code varchar2(255), + constraint pk_site_address primary key (id) +); + +create table some_enum_bean ( + id number(19) generated by default as identity not null, + some_enum number(10), + name varchar2(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 number(19) generated by default as identity not null, + name varchar2(255), + content blob, + version number(19) not null, + constraint pk_some_file_bean primary key (id) +); + +create table some_new_types_bean ( + id number(19) generated by default as identity not null, + dow number(1), + mth number(1), + yr number(10), + yr_mth date, + month_day date, + sql_date date, + sql_time timestamp, + local_date date, + local_date_time timestamp, + offset_date_time timestamp, + zoned_date_time timestamp, + local_time timestamp, + instant timestamp, + zone_id varchar2(60), + zone_offset varchar2(60), + path varchar2(255), + period varchar2(20), + duration number(19), + version number(19) 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 number(19) generated by default as identity not null, + anniversary date, + version number(19) not null, + constraint pk_some_period_bean primary key (id) +); + +create table source_base ( + dtype varchar2(31) not null, + id varchar2(40) not null, + name varchar2(255), + pos number(10) not null, + target_id varchar2(40), + constraint pk_source_base primary key (id) +); + +create table stockforecast ( + type varchar2(31) not null, + id number(19) generated by default as identity not null, + inner_report_id number(19), + constraint pk_stockforecast primary key (id) +); + +create table sub_section ( + id number(10) generated by default as identity not null, + section_id number(10), + title varchar2(255), + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_sub_section primary key (id) +); + +create table sub_type ( + sub_type_id number(10) generated by default as identity not null, + description varchar2(255), + version number(19) not null, + constraint pk_sub_type primary key (sub_type_id) +); + +create table survey ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_survey primary key (id) +); + +create table tbytes_only ( + id number(10) generated by default as identity not null, + content blob, + constraint pk_tbytes_only primary key (id) +); + +create table tcar ( + type varchar2(31) not null, + plate_no varchar2(32) not null, + truckload number(19), + constraint pk_tcar primary key (plate_no) +); + +create table tevent ( + id number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + constraint pk_tevent primary key (id) +); + +create table tevent_many ( + id number(19) generated by default as identity not null, + description varchar2(255), + event_id number(19), + units number(10) not null, + amount number(19,4) not null, + version number(19) not null, + constraint pk_tevent_many primary key (id) +); + +create table tevent_one ( + id number(19) generated by default as identity not null, + name varchar2(255), + status number(10), + event_id number(19), + version number(19) 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 number(3) not null, + id number(10) generated by default as identity not null, + name varchar2(255), + child_property varchar2(255), + constraint pk_tint_root primary key (id) +); + +create table tjoda_entity ( + id number(10) generated by default as identity not null, + local_time timestamp, + constraint pk_tjoda_entity primary key (id) +); + +create table t_mapsuper1 ( + id number(10) generated by default as identity not null, + something varchar2(255), + name varchar2(255), + version number(10) not null, + constraint pk_t_mapsuper1 primary key (id) +); + +create table t_oneb ( + id number(10) generated by default as identity not null, + name varchar2(255), + description varchar2(255), + active number(1) default 0 not null, + constraint pk_t_oneb primary key (id) +); + +create table t_detail_with_other_namexxxyy ( + id number(10) not null, + name varchar2(255), + description varchar2(255), + some_unique_value varchar2(127), + active number(1) default 0 not null, + master_id number(10), + constraint uq_t_dtl_wth_thr_nmxxxyy_sm_1 unique (some_unique_value), + constraint pk_t_dtl_wth_thr_nmxxxyy primary key (id) +); +create sequence t_atable_detail_seq increment by 1; + +create table t_atable_thatisrelatively ( + id number(10) not null, + name varchar2(255), + description varchar2(255), + active number(1) default 0 not null, + constraint pk_t_atable_thatisrelatively primary key (id) +); +create sequence t_atable_master_seq increment by 1; + +create table ttruck_holder ( + id number(19) generated by default as identity not null, + name varchar2(255), + truck_plate_no varchar2(32) not null, + basic_id number(10), + version number(19) not null, + constraint pk_ttruck_holder primary key (id) +); + +create table ttruck_holder_item ( + id number(19) generated by default as identity not null, + some_uid varchar2(40), + foo varchar2(255), + owner_id number(19) not null, + constraint pk_ttruck_holder_item primary key (id) +); + +create table tuuid_entity ( + id varchar2(40) not null, + name varchar2(255), + constraint pk_tuuid_entity primary key (id) +); + +create table twheel ( + id number(19) generated by default as identity not null, + owner_plate_no varchar2(32) not null, + constraint pk_twheel primary key (id) +); + +create table twith_pre_insert ( + id number(10) generated by default as identity not null, + name varchar2(255) not null, + title varchar2(255), + constraint pk_twith_pre_insert primary key (id) +); + +create table target_base ( + dtype varchar2(31) not null, + id varchar2(40) not null, + name varchar2(255), + constraint pk_target_base primary key (id) +); + +create table mt_tenant ( + id varchar2(40) not null, + name varchar2(255), + version number(19) not null, + constraint pk_mt_tenant primary key (id) +); + +create table test_annotation_base_entity ( + direct varchar2(255), + meta varchar2(255), + mixed varchar2(255), + constraint_annotation varchar2(40), + null1 varchar2(255) not null, + null2 varchar2(255), + null3 varchar2(255) +); + +create table tire ( + id number(19) not null, + wheel number(19), + version number(10) 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 number(19) not null, + version number(10) not null, + constraint pk_sa_tire primary key (id) +); +create sequence sa_tire_seq increment by 1; + +create table tree_entity ( + id number(10) generated by default as identity not null, + text varchar2(255), + parent_id number(10), + constraint pk_tree_entity primary key (id) +); + +create table trip ( + id number(10) generated by default as identity not null, + vehicle_driver_id number(10), + destination varchar2(255), + address_id number(10), + star_date timestamp, + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_trip primary key (id) +); + +create table truck_ref ( + id number(10) generated by default as identity not null, + something varchar2(255), + constraint pk_truck_ref primary key (id) +); + +create table tune ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_tune primary key (id) +); + +create table "type" ( + customer number(10) not null, + type number(10) not null, + description varchar2(255), + sub_type_id number(10), + version number(19) not null, + constraint pk_type primary key (customer,type) +); + +create table tz_bean ( + id number(19) generated by default as identity not null, + moda varchar2(255), + ts timestamp, + tstz timestamp, + constraint pk_tz_bean primary key (id) +); + +create table usib_child ( + id varchar2(40) not null, + parent_id number(19), + deleted number(1) default 0 not null, + constraint pk_usib_child primary key (id) +); + +create table usib_child_sibling ( + id number(19) generated by default as identity not null, + child_id varchar2(40), + deleted number(1) default 0 not null, + constraint uq_usb_chld_sblng_chld_d unique (child_id), + constraint pk_usib_child_sibling primary key (id) +); + +create table usib_parent ( + id number(19) generated by default as identity not null, + deleted number(1) default 0 not null, + constraint pk_usib_parent primary key (id) +); + +create table ut_detail ( + id number(10) generated by default as identity not null, + utmaster_id number(10) not null, + name varchar2(255), + qty number(10), + amount number(19,4), + version number(10) not null, + constraint pk_ut_detail primary key (id) +); + +create table ut_master ( + id number(10) generated by default as identity not null, + name varchar2(255), + description varchar2(255), + event_date date, + version number(10) not null, + constraint pk_ut_master primary key (id) +); + +create table uuone ( + id varchar2(40) not null, + name varchar2(255), + description varchar2(255), + version number(19) not null, + constraint pk_uuone primary key (id) +); + +create table uutwo ( + id varchar2(40) not null, + name varchar2(255), + notes varchar2(255), + master_id varchar2(40), + version number(19) not null, + constraint pk_uutwo primary key (id) +); + +create table oto_user ( + id number(19) generated by default as identity not null, + name varchar2(255), + account_id number(19) not null, + version number(19) 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 number(19) generated by default as identity not null, + inactive number(1) default 0 not null, + name varchar2(255), + email varchar2(255), + password_hash varchar2(255), + group_id number(19), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_c_user primary key (id) +); + +create table tx_user ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_tx_user primary key (id) +); + +create table g_user ( + id number(19) generated by default as identity not null, + username varchar2(255), + version number(19) not null, + constraint pk_g_user primary key (id) +); + +create table em_user ( + id number(19) generated by default as identity not null, + name varchar2(255), + constraint pk_em_user primary key (id) +); + +create table user_interest_live ( + user_id number(19) not null, + live_id number(19) 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 number(19) not null, + role_id number(19) not null, + constraint pk_em_user_role primary key (user_id,role_id) +); + +create table vehicle ( + dtype varchar2(3) not null, + id number(10) generated by default as identity not null, + license_number varchar2(255), + registration_date timestamp, + lease_id number(19), + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + siz varchar2(3), + driver varchar2(255), + car_ref_id number(10), + notes varchar2(255), + truck_ref_id number(10), + capacity number(19,4), + constraint ck_vehicle_siz check ( siz in ('S','M','L','H')), + constraint pk_vehicle primary key (id) +); + +create table vehicle_driver ( + id number(10) generated by default as identity not null, + name varchar2(255), + vehicle_id number(10), + address_id number(10), + license_issued_on timestamp, + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_vehicle_driver primary key (id) +); + +create table vehicle_lease ( + dtype varchar2(31) not null, + id number(19) generated by default as identity not null, + name varchar2(255), + active_start date, + active_end date, + version number(19) not null, + bond number(16,3), + min_duration number(10) not null, + day_rate number(16,3), + max_days number(10), + constraint pk_vehicle_lease primary key (id) +); + +create table warehouses ( + id number(10) generated by default as identity not null, + officezoneid number(10), + constraint pk_warehouses primary key (id) +); + +create table warehousesshippingzones ( + warehouseid number(10) not null, + shippingzoneid number(10) not null, + constraint pk_warehousesshippingzones primary key (warehouseid,shippingzoneid) +); + +create table wheel ( + id number(19) not null, + version number(10) not null, + constraint pk_wheel primary key (id) +); +create sequence wheel_seq increment by 1; + +create table sa_wheel ( + id number(19) not null, + tire number(19), + car number(19), + version number(10) not null, + constraint pk_sa_wheel primary key (id) +); +create sequence sa_wheel_seq increment by 1; + +create table sp_car_wheel ( + id number(19) not null, + name varchar2(255), + version number(10) 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 number(19) generated by default as identity not null, + name varchar2(255), + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + who_created_id number(19), + who_modified_id number(19), + constraint pk_g_who_props_otm primary key (id) +); + +create table with_zero ( + id number(19) generated by default as identity not null, + name varchar2(255), + parent_id number(10), + lang varchar2(2) default 'en' not null, + version number(19) not null, + constraint pk_with_zero primary key (id) +); + +create table parent ( + id number(10) generated by default as identity not null, + name varchar2(255), + constraint pk_parent primary key (id) +); + +create table wview ( + id varchar2(40) not null, + name varchar2(127) not null, + constraint uq_wview_name unique (name), + constraint pk_wview primary key (id) +); + +create table zones ( + type varchar2(31) not null, + id number(10) generated by default as identity not null, + attribute varchar2(255), + constraint pk_zones primary key (id) +); + +create index ix_cntct_lst_nm_frst_nm 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_organization_node_kind on organization_node (kind); +create index ano_3 on test_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); + +create index ix_acl_cntnr_rltn_cntnr_d on acl_container_relation (container_id); +alter table acl_container_relation add constraint fk_acl_cntnr_rltn_cntnr_d foreign key (container_id) references contract (id); + +create index ix_acl_cntnr_rltn_cl_ntry_d on acl_container_relation (acl_entry_id); +alter table acl_container_relation add constraint fk_acl_cntnr_rltn_cl_ntry_d foreign key (acl_entry_id) references acl (id); + +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); + +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); + +alter table album add constraint fk_album_cover_id foreign key (cover_id) references cover (id); + +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); + +create index ix_attrbt_ttrbt_hldr_d on attribute (attribute_holder_id); +alter table attribute add constraint fk_attrbt_ttrbt_hldr_d foreign key (attribute_holder_id) references attribute_holder (id); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +alter table basic_draftable_bean add constraint fk_basic_draftable_bean_id foreign key (id) references basic_draftable_bean_draft (id); + +alter table drel_booking add constraint fk_drel_booking_agent_invoice foreign key (agent_invoice) references drel_invoice (id); + +alter table drel_booking add constraint fk_drl_bkng_clnt_nvc foreign key (client_invoice) references drel_invoice (id); + +create index ix_cpprdct_ctgry_ctgry_d on cepproduct_category (category_id); +alter table cepproduct_category add constraint fk_cpprdct_ctgry_ctgry_d foreign key (category_id) references cepcategory (id); + +create index ix_cpprdct_ctgry_prdct_d on cepproduct_category (product_id); +alter table cepproduct_category add constraint fk_cpprdct_ctgry_prdct_d foreign key (product_id) references cepproduct (id); + +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); + +create index ix_ccstmr_prnt_ddrss_d on cicustomer_parent (address_id); +alter table cicustomer_parent add constraint fk_ccstmr_prnt_ddrss_d foreign key (address_id) references ciaddress (id); + +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); + +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); + +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); + +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); + +alter table coroot add constraint fk_coroot_one_id foreign key (one_id) references coone (id); + +create index ix_clcltn_rslt_prdct_cnfgrt_1 on calculation_result (product_configuration_id); +alter table calculation_result add constraint fk_clcltn_rslt_prdct_cnfgrt_1 foreign key (product_configuration_id) references configuration (id); + +create index ix_clcltn_rslt_grp_cnfgrtn_d on calculation_result (group_configuration_id); +alter table calculation_result add constraint fk_clcltn_rslt_grp_cnfgrtn_d foreign key (group_configuration_id) references configuration (id); + +create index ix_sp_cr_cr_whls_sp_cr_cr on sp_car_car_wheels (car); +alter table sp_car_car_wheels add constraint fk_sp_cr_cr_whls_sp_cr_cr foreign key (car) references sp_car_car (id); + +create index ix_sp_cr_cr_whls_sp_cr_whl on sp_car_car_wheels (wheel); +alter table sp_car_car_wheels add constraint fk_sp_cr_cr_whls_sp_cr_whl foreign key (wheel) references sp_car_wheel (id); + +create index ix_sp_cr_cr_drs_sp_cr_cr on sp_car_car_doors (car); +alter table sp_car_car_doors add constraint fk_sp_cr_cr_drs_sp_cr_cr foreign key (car) references sp_car_car (id); + +create index ix_sp_cr_cr_drs_sp_cr_dr on sp_car_car_doors (door); +alter table sp_car_car_doors add constraint fk_sp_cr_cr_drs_sp_cr_dr foreign key (door) references sp_car_door (id); + +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); + +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); + +create index ix_category_surveyobjectid on category (surveyobjectid); +alter table category add constraint fk_category_surveyobjectid foreign key (surveyobjectid) references survey (id); + +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); + +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); + +create index ix_chld_prsn_prnt_dntfr on child_person (parent_identifier); +alter table child_person add constraint fk_chld_prsn_prnt_dntfr foreign key (parent_identifier) references parent_person (identifier); + +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); + +alter table class_super_monkey add constraint fk_clss_spr_mnky_clss_spr foreign key (class_super_sid) references class_super (sid); + +alter table class_super_monkey add constraint fk_class_super_monkey_monkey foreign key (monkey_mid) references monkey (mid); + +create index ix_cnfgrtn_cnfgrtns_d on configuration (configurations_id); +alter table configuration add constraint fk_cnfgrtn_cnfgrtns_d foreign key (configurations_id) references configurations (id); + +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); + +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); + +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); + +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); + +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); + +create index ix_o_cstmr_bllng_ddrss_d on o_customer (billing_address_id); +alter table o_customer add constraint fk_o_cstmr_bllng_ddrss_d foreign key (billing_address_id) references o_address (id); + +create index ix_o_cstmr_shppng_ddrss_d on o_customer (shipping_address_id); +alter table o_customer add constraint fk_o_cstmr_shppng_ddrss_d foreign key (shipping_address_id) references o_address (id); + +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); + +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); + +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); + +create index ix_d_mchn_x_s_mchn_d on d_machine_aux_use (machine_id); +alter table d_machine_aux_use add constraint fk_d_mchn_x_s_mchn_d foreign key (machine_id) references dmachine (id); + +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); + +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); + +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); + +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); + +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); + +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; + +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; + +alter table doc add constraint fk_doc_id foreign key (id) references doc_draft (id); + +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); + +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); + +alter table document add constraint fk_document_id foreign key (id) references document_draft (id); + +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); + +create index ix_dcmnt_drft_rgnstn_d on document_draft (organisation_id); +alter table document_draft add constraint fk_dcmnt_drft_rgnstn_d foreign key (organisation_id) references organisation (id); + +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); + +create index ix_dcmnt_md_drft_dcmnt_d on document_media_draft (document_id); +alter table document_media_draft add constraint fk_dcmnt_md_drft_dcmnt_d foreign key (document_id) references document_draft (id); + +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); + +create index ix_ebsc_jsn_mp_dtl_wnr_d on ebasic_json_map_detail (owner_id); +alter table ebasic_json_map_detail add constraint fk_ebsc_jsn_mp_dtl_wnr_d foreign key (owner_id) references ebasic_json_map (id); + +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); + +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); + +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); + +alter table edefault_prop add constraint fk_edflt_prp__smpl_srtypd foreign key (e_simple_usertypeid) references esimple (usertypeid); + +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); + +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); + +create index ix_enll_cllctn_dtl_nll_cllc_1 on enull_collection_detail (enull_collection_id); +alter table enull_collection_detail add constraint fk_enll_cllctn_dtl_nll_cllc_1 foreign key (enull_collection_id) references enull_collection (id); + +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); + +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); + +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); + +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); + +create index ix_esft_dl_bk_sft_dl_sr_sft_1 on esoft_del_book_esoft_del_user (esoft_del_book_id); +alter table esoft_del_book_esoft_del_user add constraint fk_esft_dl_bk_sft_dl_sr_sft_1 foreign key (esoft_del_book_id) references esoft_del_book (id); + +create index ix_esft_dl_bk_sft_dl_sr_sft_2 on esoft_del_book_esoft_del_user (esoft_del_user_id); +alter table esoft_del_book_esoft_del_user add constraint fk_esft_dl_bk_sft_dl_sr_sft_2 foreign key (esoft_del_user_id) references esoft_del_user (id); + +create index ix_esft_dl_dwn_sft_dl_md_d on esoft_del_down (esoft_del_mid_id); +alter table esoft_del_down add constraint fk_esft_dl_dwn_sft_dl_md_d foreign key (esoft_del_mid_id) references esoft_del_mid (id); + +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); + +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); + +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); + +create index ix_esft_dl_rl_sft_dl_sr_sft_1 on esoft_del_role_esoft_del_user (esoft_del_role_id); +alter table esoft_del_role_esoft_del_user add constraint fk_esft_dl_rl_sft_dl_sr_sft_1 foreign key (esoft_del_role_id) references esoft_del_role (id); + +create index ix_esft_dl_rl_sft_dl_sr_sft_2 on esoft_del_role_esoft_del_user (esoft_del_user_id); +alter table esoft_del_role_esoft_del_user add constraint fk_esft_dl_rl_sft_dl_sr_sft_2 foreign key (esoft_del_user_id) references esoft_del_user (id); + +create index ix_esft_dl_sr_sft_dl_rl_sft_1 on esoft_del_user_esoft_del_role (esoft_del_user_id); +alter table esoft_del_user_esoft_del_role add constraint fk_esft_dl_sr_sft_dl_rl_sft_1 foreign key (esoft_del_user_id) references esoft_del_user (id); + +create index ix_esft_dl_sr_sft_dl_rl_sft_2 on esoft_del_user_esoft_del_role (esoft_del_role_id); +alter table esoft_del_user_esoft_del_role add constraint fk_esft_dl_sr_sft_dl_rl_sft_2 foreign key (esoft_del_role_id) references esoft_del_role (id); + +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); + +create index ix_evnll_cllctn_dtl_vnll_cl_1 on evanilla_collection_detail (evanilla_collection_id); +alter table evanilla_collection_detail add constraint fk_evnll_cllctn_dtl_vnll_cl_1 foreign key (evanilla_collection_id) references evanilla_collection (id); + +create index ix_ec_nm_prsn_tgs_c_nm_prsn_d on ec_enum_person_tags (ec_enum_person_id); +alter table ec_enum_person_tags add constraint fk_ec_nm_prsn_tgs_c_nm_prsn_d foreign key (ec_enum_person_id) references ec_enum_person (id); + +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); + +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); + +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); + +create index ix_ec_tp_cs_prsn_cs_prsn on ec_top_ecs_person (ecs_person_id); +alter table ec_top_ecs_person add constraint fk_ec_tp_cs_prsn_cs_prsn foreign key (ecs_person_id) references ecs_person (id); + +create index ix_ecbl_prsn_phn_nmbrs_prsn_d on ecbl_person_phone_numbers (person_id); +alter table ecbl_person_phone_numbers add constraint fk_ecbl_prsn_phn_nmbrs_prsn_d foreign key (person_id) references ecbl_person (id); + +create index ix_ecbm_prsn_phn_nmbrs_prsn_d on ecbm_person_phone_numbers (person_id); +alter table ecbm_person_phone_numbers add constraint fk_ecbm_prsn_phn_nmbrs_prsn_d foreign key (person_id) references ecbm_person (id); + +create index ix_ecm_prsn_phn_nmbrs_cm_pr_1 on ecm_person_phone_numbers (ecm_person_id); +alter table ecm_person_phone_numbers add constraint fk_ecm_prsn_phn_nmbrs_cm_pr_1 foreign key (ecm_person_id) references ecm_person (id); + +create index ix_ecmc_prsn_phn_nmbrs_cmc__1 on ecmc_person_phone_numbers (ecmc_person_id); +alter table ecmc_person_phone_numbers add constraint fk_ecmc_prsn_phn_nmbrs_cmc__1 foreign key (ecmc_person_id) references ecmc_person (id); + +create index ix_ecs_prsn_phn_cs_prsn_d on ecs_person_phone (ecs_person_id); +alter table ecs_person_phone add constraint fk_ecs_prsn_phn_cs_prsn_d foreign key (ecs_person_id) references ecs_person (id); + +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); + +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); + +create index ix_elmnt_bn_cmplx_bn_d on element_bean (complex_bean_id); +alter table element_bean add constraint fk_elmnt_bn_cmplx_bn_d foreign key (complex_bean_id) references root_bean (id); + +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); + +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); + +create index ix_grnd_prnt_prsn_sm_bn_d on grand_parent_person (some_bean_id); +alter table grand_parent_person add constraint fk_grnd_prnt_prsn_sm_bn_d foreign key (some_bean_id) references e_basic (id); + +create index ix_srvy_grp_ctgrybjctd on survey_group (categoryobjectid); +alter table survey_group add constraint fk_srvy_grp_ctgrybjctd foreign key (categoryobjectid) references category (id); + +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); + +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); + +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); + +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); + +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); + +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); + +alter table hsd_setting add constraint fk_hsd_setting_user_id foreign key (user_id) references hsd_user (id); + +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); + +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); + +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); + +alter table info_customer add constraint fk_info_customer_company_id foreign key (company_id) references info_company (id); + +alter table inner_report add constraint fk_inner_report_forecast_id foreign key (forecast_id) references stockforecast (id); + +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); + +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); + +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); + +alter table mkeygroup_monkey add constraint fk_mkeygroup_monkey_mkeygroup foreign key (mkeygroup_pid) references mkeygroup (pid); + +alter table mkeygroup_monkey add constraint fk_mkeygroup_monkey_monkey foreign key (monkey_mid) references monkey (mid); + +alter table trainer_monkey add constraint fk_trainer_monkey_trainer foreign key (trainer_tid) references trainer (tid); + +alter table trainer_monkey add constraint fk_trainer_monkey_monkey foreign key (monkey_mid) references monkey (mid); + +alter table troop_monkey add constraint fk_troop_monkey_troop foreign key (troop_pid) references troop (pid); + +alter table troop_monkey add constraint fk_troop_monkey_monkey foreign key (monkey_mid) references monkey (mid); + +create index ix_l2_cldf_rst_bn_chld_prnt_d on l2_cldf_reset_bean_child (parent_id); +alter table l2_cldf_reset_bean_child add constraint fk_l2_cldf_rst_bn_chld_prnt_d foreign key (parent_id) references l2_cldf_reset_bean (id); + +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); + +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); + +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); + +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); + +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); + +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); + +alter table link add constraint fk_link_id foreign key (id) references link_draft (id); + +create index ix_l_ttr_vl_ttrbt_l_ttr_vl on la_attr_value_attribute (la_attr_value_id); +alter table la_attr_value_attribute add constraint fk_l_ttr_vl_ttrbt_l_ttr_vl foreign key (la_attr_value_id) references la_attr_value (id); + +create index ix_l_ttr_vl_ttrbt_ttrbt on la_attr_value_attribute (attribute_id); +alter table la_attr_value_attribute add constraint fk_l_ttr_vl_ttrbt_ttrbt foreign key (attribute_id) references attribute (id); + +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); + +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); + +create index ix_mcntct_mssg_cntct_d on mcontact_message (contact_id); +alter table mcontact_message add constraint fk_mcntct_mssg_cntct_d foreign key (contact_id) references mcontact (id); + +create index ix_mcstmr_shppng_ddrss_d on mcustomer (shipping_address_id); +alter table mcustomer add constraint fk_mcstmr_shppng_ddrss_d foreign key (shipping_address_id) references maddress (id); + +create index ix_mcstmr_bllng_ddrss_d on mcustomer (billing_address_id); +alter table mcustomer add constraint fk_mcstmr_bllng_ddrss_d foreign key (billing_address_id) references maddress (id); + +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); + +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); + +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); + +alter table mprinter add constraint fk_mprinter_last_swap_cyan_id foreign key (last_swap_cyan_id) references mprinter_state (id); + +alter table mprinter add constraint fk_mprntr_lst_swp_mgnt_d foreign key (last_swap_magenta_id) references mprinter_state (id); + +alter table mprinter add constraint fk_mprntr_lst_swp_yllw_d foreign key (last_swap_yellow_id) references mprinter_state (id); + +alter table mprinter add constraint fk_mprntr_lst_swp_blck_d foreign key (last_swap_black_id) references mprinter_state (id); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +alter table meter_contract_data add constraint fk_mtr_cntrct_dt_spcl_nds_c_1 foreign key (special_needs_client_id) references meter_special_needs_client (id); + +alter table meter_special_needs_client add constraint fk_mtr_spcl_nds_clnt_prmry_d foreign key (primary_id) references meter_special_needs_contact (id); + +alter table meter_version add constraint fk_mtr_vrsn_ddrss_dt_d foreign key (address_data_id) references meter_address_data (id); + +alter table meter_version add constraint fk_mtr_vrsn_cntrct_dt_d foreign key (contract_data_id) references meter_contract_data (id); + +create index ix_mnc_sr_mnc_rl_mnc_sr on mnoc_user_mnoc_role (mnoc_user_user_id); +alter table mnoc_user_mnoc_role add constraint fk_mnc_sr_mnc_rl_mnc_sr foreign key (mnoc_user_user_id) references mnoc_user (user_id); + +create index ix_mnc_sr_mnc_rl_mnc_rl on mnoc_user_mnoc_role (mnoc_role_role_id); +alter table mnoc_user_mnoc_role add constraint fk_mnc_sr_mnc_rl_mnc_rl foreign key (mnoc_role_role_id) references mnoc_role (role_id); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +create index ix_my_lb_sz_jn_mny_prnt_d on my_lob_size_join_many (parent_id); +alter table my_lob_size_join_many add constraint fk_my_lb_sz_jn_mny_prnt_d foreign key (parent_id) references my_lob_size (id); + +create index ix_o_bn_chld_cchd_bn_d on o_bean_child (cached_bean_id); +alter table o_bean_child add constraint fk_o_bn_chld_cchd_bn_d foreign key (cached_bean_id) references o_cached_bean (id); + +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); + +create index ix_o_cchd_bn_cntry__cchd_bn on o_cached_bean_country (o_cached_bean_id); +alter table o_cached_bean_country add constraint fk_o_cchd_bn_cntry__cchd_bn foreign key (o_cached_bean_id) references o_cached_bean (id); + +create index ix_o_cchd_bn_cntry__cntry on o_cached_bean_country (o_country_code); +alter table o_cached_bean_country add constraint fk_o_cchd_bn_cntry__cntry foreign key (o_country_code) references o_country (code); + +create index ix_o_cchd_bn_chld_cchd_bn_d on o_cached_bean_child (cached_bean_id); +alter table o_cached_bean_child add constraint fk_o_cchd_bn_chld_cchd_bn_d foreign key (cached_bean_id) references o_cached_bean (id); + +alter table oengine add constraint fk_oengine_car_id foreign key (car_id) references ocar (id); + +alter table ogear_box add constraint fk_ogear_box_car_id foreign key (car_id) references ocar (id); + +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); + +alter table oroad_show_msg add constraint fk_oroad_show_msg_company_id foreign key (company_id) references ocompany (id); + +create index ix_om_ccnt_chld_db_bnn_rm_d on om_account_child_dbo (banana_rama_id); +alter table om_account_child_dbo add constraint fk_om_ccnt_chld_db_bnn_rm_d foreign key (banana_rama_id) references om_account_dbo (id); + +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); + +create index ix_om_rdrd_dtl_mstr_d on om_ordered_detail (master_id); +alter table om_ordered_detail add constraint fk_om_rdrd_dtl_mstr_d foreign key (master_id) references om_ordered_master (id); + +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); + +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); + +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); + +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); + +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); + +alter table organization_node add constraint fk_orgnztn_nd_prnt_tr_nd_d foreign key (parent_tree_node_id) references organization_tree_node (id); + +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); + +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); + +alter table oto_atwo add constraint fk_oto_atwo_aone_id foreign key (aone_id) references oto_aone (id); + +alter table oto_bchild add constraint fk_oto_bchild_master_id foreign key (master_id) references oto_bmaster (id); + +alter table oto_child add constraint fk_oto_child_master_id foreign key (master_id) references oto_master (id); + +alter table oto_cust_address add constraint fk_ot_cst_ddrss_cstmr_cd foreign key (customer_cid) references oto_cust (cid); + +alter table oto_level_a add constraint fk_oto_level_a_b_id foreign key (b_id) references oto_level_b (id); + +alter table oto_level_b add constraint fk_oto_level_b_c_id foreign key (c_id) references oto_level_c (id); + +alter table oto_prime_extra add constraint fk_oto_prime_extra_eid foreign key (eid) references oto_prime (pid); + +alter table oto_sd_child add constraint fk_oto_sd_child_master_id foreign key (master_id) references oto_sd_master (id); + +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); + +alter table oto_th_one add constraint fk_oto_th_one_many_id foreign key (many_id) references oto_th_many (id); + +alter table oto_ubprime_extra add constraint fk_oto_ubprime_extra_eid foreign key (eid) references oto_ubprime (pid); + +alter table oto_user_model add constraint fk_ot_sr_mdl_sr_ptnl_d foreign key (user_optional_id) references oto_user_model_optional (id); + +alter table pfile add constraint fk_pfile_file_content_id foreign key (file_content_id) references pfile_content (id); + +alter table pfile add constraint fk_pfile_file_content2_id foreign key (file_content2_id) references pfile_content (id); + +alter table paggview add constraint fk_paggview_pview_id foreign key (pview_id) references pp (id); + +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); + +alter table parcel_location add constraint fk_parcel_location_parcelid foreign key (parcelid) references parcel (parcelid); + +create index ix_rwnhrt_prnt_rwnhrt_d_rwn_1 on rawinherit_parent_rawinherit_d (rawinherit_parent_id); +alter table rawinherit_parent_rawinherit_d add constraint fk_rwnhrt_prnt_rwnhrt_d_rwn_1 foreign key (rawinherit_parent_id) references rawinherit_parent (id); + +create index ix_rwnhrt_prnt_rwnhrt_d_rwn_2 on rawinherit_parent_rawinherit_d (rawinherit_data_id); +alter table rawinherit_parent_rawinherit_d add constraint fk_rwnhrt_prnt_rwnhrt_d_rwn_2 foreign key (rawinherit_data_id) references rawinherit_data (id); + +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); + +create index ix_prnt_prsn_prnt_dntfr on parent_person (parent_identifier); +alter table parent_person add constraint fk_prnt_prsn_prnt_dntfr foreign key (parent_identifier) references grand_parent_person (identifier); + +create index ix_c_prtcptn_cnvrstn_d on c_participation (conversation_id); +alter table c_participation add constraint fk_c_prtcptn_cnvrstn_d foreign key (conversation_id) references c_conversation (id); + +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); + +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); + +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); + +alter table pcf_city add constraint fk_pcf_city_mayor_id foreign key (mayor_id) references pcf_person (id); + +alter table pcf_city add constraint fk_pcf_city_vice_mayor_id foreign key (vice_mayor_id) references pcf_person (id); + +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); + +alter table persistent_file_content add constraint fk_prsstnt_fl_cntnt_prsstnt_1 foreign key (persistent_file_id) references persistent_file (id); + +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); + +create index ix_prsn_cch_ml_prsn_nf_prsn_d on person_cache_email (person_info_person_id); +alter table person_cache_email add constraint fk_prsn_cch_ml_prsn_nf_prsn_d foreign key (person_info_person_id) references person_cache_info (person_id); + +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); + +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); + +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); + +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); + +create index ix_question_groupobjectid on question (groupobjectid); +alter table question add constraint fk_question_groupobjectid foreign key (groupobjectid) references survey_group (id); + +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); + +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); + +create index ix_rsrcfl_prntrsrcfld on resourcefile (parentresourcefileid); +alter table resourcefile add constraint fk_rsrcfl_prntrsrcfld foreign key (parentresourcefileid) references resourcefile (id); + +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); + +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); + +create index ix_mt_rl_prmssn_mt_prmssn on mt_role_permission (mt_permission_id); +alter table mt_role_permission add constraint fk_mt_rl_prmssn_mt_prmssn foreign key (mt_permission_id) references mt_permission (id); + +create index ix_rt_bn_rfrncng_bn_d on root_bean (referencing_bean_id); +alter table root_bean add constraint fk_rt_bn_rfrncng_bn_d foreign key (referencing_bean_id) references referencing_bean (id); + +alter table f_second add constraint fk_f_second_first foreign key (first) references f_first (id); + +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); + +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); + +create index ix_slf_rf_cstmr_rfrrd_by_d on self_ref_customer (referred_by_id); +alter table self_ref_customer add constraint fk_slf_rf_cstmr_rfrrd_by_d foreign key (referred_by_id) references self_ref_customer (id); + +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); + +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); + +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); + +alter table site add constraint fk_site_data_container_id foreign key (data_container_id) references data_container (id); + +alter table site add constraint fk_site_site_address_id foreign key (site_address_id) references site_address (id); + +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); + +create index ix_stckfrcst_nnr_rprt_d on stockforecast (inner_report_id); +alter table stockforecast add constraint fk_stckfrcst_nnr_rprt_d foreign key (inner_report_id) references inner_report (id); + +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); + +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); + +alter table tevent_one add constraint fk_tevent_one_event_id foreign key (event_id) references tevent (id); + +create index ix_t_dtl_wth_thr_nmxxxyy_ms_1 on t_detail_with_other_namexxxyy (master_id); +alter table t_detail_with_other_namexxxyy add constraint fk_t_dtl_wth_thr_nmxxxyy_ms_1 foreign key (master_id) references t_atable_thatisrelatively (id); + +create index ix_ttrck_hldr_trck_plt_n on ttruck_holder (truck_plate_no); +alter table ttruck_holder add constraint fk_ttrck_hldr_trck_plt_n foreign key (truck_plate_no) references tcar (plate_no); + +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); + +create index ix_ttrck_hldr_tm_wnr_d on ttruck_holder_item (owner_id); +alter table ttruck_holder_item add constraint fk_ttrck_hldr_tm_wnr_d foreign key (owner_id) references ttruck_holder (id); + +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); + +alter table tire add constraint fk_tire_wheel foreign key (wheel) references wheel (id); + +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); + +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); + +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); + +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); + +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); + +alter table usib_child_sibling add constraint fk_usb_chld_sblng_chld_d foreign key (child_id) references usib_child (id); + +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); + +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); + +alter table oto_user add constraint fk_oto_user_account_id foreign key (account_id) references oto_account (id); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +create index ix_warehouses_officezoneid on warehouses (officezoneid); +alter table warehouses add constraint fk_warehouses_officezoneid foreign key (officezoneid) references zones (id); + +create index ix_wrhssshppngzns_wrhss on warehousesshippingzones (warehouseid); +alter table warehousesshippingzones add constraint fk_wrhssshppngzns_wrhss foreign key (warehouseid) references warehouses (id); + +create index ix_wrhssshppngzns_zns on warehousesshippingzones (shippingzoneid); +alter table warehousesshippingzones add constraint fk_wrhssshppngzns_zns foreign key (shippingzoneid) references zones (id); + +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); + +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); + +create index ix_g_wh_prps_tm_wh_crtd_d on g_who_props_otm (who_created_id); +alter table g_who_props_otm add constraint fk_g_wh_prps_tm_wh_crtd_d foreign key (who_created_id) references g_user (id); + +create index ix_g_wh_prps_tm_wh_mdfd_d on g_who_props_otm (who_modified_id); +alter table g_who_props_otm add constraint fk_g_wh_prps_tm_wh_mdfd_d foreign key (who_modified_id) references g_user (id); + +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); + diff --git a/ebean-core/src/test/ddl-review/oracle-drop-all.sql b/ebean-core/src/test/ddl-review/oracle-drop-all.sql new file mode 100644 index 000000000..318c4b276 --- /dev/null +++ b/ebean-core/src/test/ddl-review/oracle-drop-all.sql @@ -0,0 +1,1821 @@ +-- Generated by ebean unknown at 2020-03-17T09:34:02.384264Z +alter table bar drop constraint fk_bar_foo_id; +drop index ix_bar_foo_id; + +alter table acl_container_relation drop constraint fk_acl_cntnr_rltn_cntnr_d; +drop index ix_acl_cntnr_rltn_cntnr_d; + +alter table acl_container_relation drop constraint fk_acl_cntnr_rltn_cl_ntry_d; +drop index ix_acl_cntnr_rltn_cl_ntry_d; + +alter table addr drop constraint fk_addr_employee_id; +drop index ix_addr_employee_id; + +alter table o_address drop constraint fk_o_address_country_code; +drop index ix_o_address_country_code; + +alter table album drop constraint fk_album_cover_id; + +alter table animal drop constraint fk_animal_shelter_id; +drop index ix_animal_shelter_id; + +alter table attribute drop constraint fk_attrbt_ttrbt_hldr_d; +drop index ix_attrbt_ttrbt_hldr_d; + +alter table bbookmark drop constraint fk_bbookmark_user_id; +drop index ix_bbookmark_user_id; + +alter table bbookmark_user drop constraint fk_bbookmark_user_org_id; +drop index ix_bbookmark_user_org_id; + +alter table bsite_user_a drop constraint fk_bsite_user_a_site_id; +drop index ix_bsite_user_a_site_id; + +alter table bsite_user_a drop constraint fk_bsite_user_a_user_id; +drop index ix_bsite_user_a_user_id; + +alter table bsite_user_b drop constraint fk_bsite_user_b_site; +drop index ix_bsite_user_b_site; + +alter table bsite_user_b drop constraint fk_bsite_user_b_usr; +drop index ix_bsite_user_b_usr; + +alter table bsite_user_c drop constraint fk_bsite_user_c_site_uid; +drop index ix_bsite_user_c_site_uid; + +alter table bsite_user_c drop constraint fk_bsite_user_c_user_uid; +drop index ix_bsite_user_c_user_uid; + +alter table bsite_user_e drop constraint fk_bsite_user_e_site_id; +drop index ix_bsite_user_e_site_id; + +alter table bsite_user_e drop constraint fk_bsite_user_e_user_id; +drop index ix_bsite_user_e_user_id; + +alter table basic_draftable_bean drop constraint fk_basic_draftable_bean_id; + +alter table drel_booking drop constraint fk_drel_booking_agent_invoice; + +alter table drel_booking drop constraint fk_drl_bkng_clnt_nvc; + +alter table cepproduct_category drop constraint fk_cpprdct_ctgry_ctgry_d; +drop index ix_cpprdct_ctgry_ctgry_d; + +alter table cepproduct_category drop constraint fk_cpprdct_ctgry_prdct_d; +drop index ix_cpprdct_ctgry_prdct_d; + +alter table ciaddress drop constraint fk_ciaddress_street_id; +drop index ix_ciaddress_street_id; + +alter table cicustomer_parent drop constraint fk_ccstmr_prnt_ddrss_d; +drop index ix_ccstmr_prnt_ddrss_d; + +alter table cinh_ref drop constraint fk_cinh_ref_ref_id; +drop index ix_cinh_ref_ref_id; + +alter table ckey_detail drop constraint fk_ckey_detail_parent; +drop index ix_ckey_detail_parent; + +alter table ckey_parent drop constraint fk_ckey_parent_assoc_id; +drop index ix_ckey_parent_assoc_id; + +alter table coone_many drop constraint fk_coone_many_coone_id; +drop index ix_coone_many_coone_id; + +alter table coroot drop constraint fk_coroot_one_id; + +alter table calculation_result drop constraint fk_clcltn_rslt_prdct_cnfgrt_1; +drop index ix_clcltn_rslt_prdct_cnfgrt_1; + +alter table calculation_result drop constraint fk_clcltn_rslt_grp_cnfgrtn_d; +drop index ix_clcltn_rslt_grp_cnfgrtn_d; + +alter table sp_car_car_wheels drop constraint fk_sp_cr_cr_whls_sp_cr_cr; +drop index ix_sp_cr_cr_whls_sp_cr_cr; + +alter table sp_car_car_wheels drop constraint fk_sp_cr_cr_whls_sp_cr_whl; +drop index ix_sp_cr_cr_whls_sp_cr_whl; + +alter table sp_car_car_doors drop constraint fk_sp_cr_cr_drs_sp_cr_cr; +drop index ix_sp_cr_cr_drs_sp_cr_cr; + +alter table sp_car_car_doors drop constraint fk_sp_cr_cr_drs_sp_cr_dr; +drop index ix_sp_cr_cr_drs_sp_cr_dr; + +alter table car_accessory drop constraint fk_car_accessory_fuse_id; +drop index ix_car_accessory_fuse_id; + +alter table car_accessory drop constraint fk_car_accessory_car_id; +drop index ix_car_accessory_car_id; + +alter table category drop constraint fk_category_surveyobjectid; +drop index ix_category_surveyobjectid; + +alter table e_save_test_d drop constraint fk_e_save_test_d_parent_id; + +alter table child_person drop constraint fk_child_person_some_bean_id; +drop index ix_child_person_some_bean_id; + +alter table child_person drop constraint fk_chld_prsn_prnt_dntfr; +drop index ix_chld_prsn_prnt_dntfr; + +alter table cke_client drop constraint fk_cke_client_user; +drop index ix_cke_client_user; + +alter table class_super_monkey drop constraint fk_clss_spr_mnky_clss_spr; + +alter table class_super_monkey drop constraint fk_class_super_monkey_monkey; + +alter table configuration drop constraint fk_cnfgrtn_cnfgrtns_d; +drop index ix_cnfgrtn_cnfgrtns_d; + +alter table contact drop constraint fk_contact_customer_id; +drop index ix_contact_customer_id; + +alter table contact drop constraint fk_contact_group_id; +drop index ix_contact_group_id; + +alter table contact_note drop constraint fk_contact_note_contact_id; +drop index ix_contact_note_contact_id; + +alter table contract_costs drop constraint fk_contract_costs_position_id; +drop index ix_contract_costs_position_id; + +alter table c_conversation drop constraint fk_c_conversation_group_id; +drop index ix_c_conversation_group_id; + +alter table o_customer drop constraint fk_o_cstmr_bllng_ddrss_d; +drop index ix_o_cstmr_bllng_ddrss_d; + +alter table o_customer drop constraint fk_o_cstmr_shppng_ddrss_d; +drop index ix_o_cstmr_shppng_ddrss_d; + +alter table dcredit_drol drop constraint fk_dcredit_drol_dcredit; +drop index ix_dcredit_drol_dcredit; + +alter table dcredit_drol drop constraint fk_dcredit_drol_drol; +drop index ix_dcredit_drol_drol; + +alter table dmachine drop constraint fk_dmachine_organisation_id; +drop index ix_dmachine_organisation_id; + +alter table d_machine_aux_use drop constraint fk_d_mchn_x_s_mchn_d; +drop index ix_d_mchn_x_s_mchn_d; + +alter table d_machine_stats drop constraint fk_d_machine_stats_machine_id; +drop index ix_d_machine_stats_machine_id; + +alter table d_machine_use drop constraint fk_d_machine_use_machine_id; +drop index ix_d_machine_use_machine_id; + +alter table drot_drol drop constraint fk_drot_drol_drot; +drop index ix_drot_drol_drot; + +alter table drot_drol drop constraint fk_drot_drol_drol; +drop index ix_drot_drol_drol; + +alter table dc_detail drop constraint fk_dc_detail_master_id; +drop index ix_dc_detail_master_id; + +alter table dfk_cascade drop constraint fk_dfk_cascade_one_id; +drop index ix_dfk_cascade_one_id; + +alter table dfk_set_null drop constraint fk_dfk_set_null_one_id; +drop index ix_dfk_set_null_one_id; + +alter table doc drop constraint fk_doc_id; + +alter table doc_link drop constraint fk_doc_link_doc; +drop index ix_doc_link_doc; + +alter table doc_link drop constraint fk_doc_link_link; +drop index ix_doc_link_link; + +alter table document drop constraint fk_document_id; + +alter table document drop constraint fk_document_organisation_id; +drop index ix_document_organisation_id; + +alter table document_draft drop constraint fk_dcmnt_drft_rgnstn_d; +drop index ix_dcmnt_drft_rgnstn_d; + +alter table document_media drop constraint fk_document_media_document_id; +drop index ix_document_media_document_id; + +alter table document_media_draft drop constraint fk_dcmnt_md_drft_dcmnt_d; +drop index ix_dcmnt_md_drft_dcmnt_d; + +alter table e_basicenc_relate drop constraint fk_e_basicenc_relate_other_id; +drop index ix_e_basicenc_relate_other_id; + +alter table ebasic_json_map_detail drop constraint fk_ebsc_jsn_mp_dtl_wnr_d; +drop index ix_ebsc_jsn_mp_dtl_wnr_d; + +alter table ebasic_no_sdchild drop constraint fk_ebasic_no_sdchild_owner_id; +drop index ix_ebasic_no_sdchild_owner_id; + +alter table ebasic_sdchild drop constraint fk_ebasic_sdchild_owner_id; +drop index ix_ebasic_sdchild_owner_id; + +alter table ecache_child drop constraint fk_ecache_child_root_id; +drop index ix_ecache_child_root_id; + +alter table edefault_prop drop constraint fk_edflt_prp__smpl_srtypd; + +alter table eemb_inner drop constraint fk_eemb_inner_outer_id; +drop index ix_eemb_inner_outer_id; + +alter table einvoice drop constraint fk_einvoice_person_id; +drop index ix_einvoice_person_id; + +alter table enull_collection_detail drop constraint fk_enll_cllctn_dtl_nll_cllc_1; +drop index ix_enll_cllctn_dtl_nll_cllc_1; + +alter table eopt_one_a drop constraint fk_eopt_one_a_b_id; +drop index ix_eopt_one_a_b_id; + +alter table eopt_one_b drop constraint fk_eopt_one_b_c_id; +drop index ix_eopt_one_b_c_id; + +alter table eper_addr drop constraint fk_eper_addr_ma_country_code; +drop index ix_eper_addr_ma_country_code; + +alter table esoft_del_book drop constraint fk_esoft_del_book_lend_by_id; +drop index ix_esoft_del_book_lend_by_id; + +alter table esoft_del_book_esoft_del_user drop constraint fk_esft_dl_bk_sft_dl_sr_sft_1; +drop index ix_esft_dl_bk_sft_dl_sr_sft_1; + +alter table esoft_del_book_esoft_del_user drop constraint fk_esft_dl_bk_sft_dl_sr_sft_2; +drop index ix_esft_dl_bk_sft_dl_sr_sft_2; + +alter table esoft_del_down drop constraint fk_esft_dl_dwn_sft_dl_md_d; +drop index ix_esft_dl_dwn_sft_dl_md_d; + +alter table esoft_del_mid drop constraint fk_esoft_del_mid_top_id; +drop index ix_esoft_del_mid_top_id; + +alter table esoft_del_mid drop constraint fk_esoft_del_mid_up_id; +drop index ix_esoft_del_mid_up_id; + +alter table esoft_del_one_a drop constraint fk_esoft_del_one_a_oneb_id; + +alter table esoft_del_role_esoft_del_user drop constraint fk_esft_dl_rl_sft_dl_sr_sft_1; +drop index ix_esft_dl_rl_sft_dl_sr_sft_1; + +alter table esoft_del_role_esoft_del_user drop constraint fk_esft_dl_rl_sft_dl_sr_sft_2; +drop index ix_esft_dl_rl_sft_dl_sr_sft_2; + +alter table esoft_del_user_esoft_del_role drop constraint fk_esft_dl_sr_sft_dl_rl_sft_1; +drop index ix_esft_dl_sr_sft_dl_rl_sft_1; + +alter table esoft_del_user_esoft_del_role drop constraint fk_esft_dl_sr_sft_dl_rl_sft_2; +drop index ix_esft_dl_sr_sft_dl_rl_sft_2; + +alter table rawinherit_uncle drop constraint fk_rawinherit_uncle_parent_id; +drop index ix_rawinherit_uncle_parent_id; + +alter table evanilla_collection_detail drop constraint fk_evnll_cllctn_dtl_vnll_cl_1; +drop index ix_evnll_cllctn_dtl_vnll_cl_1; + +alter table ec_enum_person_tags drop constraint fk_ec_nm_prsn_tgs_c_nm_prsn_d; +drop index ix_ec_nm_prsn_tgs_c_nm_prsn_d; + +alter table ec_person_phone drop constraint fk_ec_person_phone_owner_id; +drop index ix_ec_person_phone_owner_id; + +alter table ec_top drop constraint fk_ec_top_person_id; +drop index ix_ec_top_person_id; + +alter table ec_top_ecs_person drop constraint fk_ec_top_ecs_person_ec_top; +drop index ix_ec_top_ecs_person_ec_top; + +alter table ec_top_ecs_person drop constraint fk_ec_tp_cs_prsn_cs_prsn; +drop index ix_ec_tp_cs_prsn_cs_prsn; + +alter table ecbl_person_phone_numbers drop constraint fk_ecbl_prsn_phn_nmbrs_prsn_d; +drop index ix_ecbl_prsn_phn_nmbrs_prsn_d; + +alter table ecbm_person_phone_numbers drop constraint fk_ecbm_prsn_phn_nmbrs_prsn_d; +drop index ix_ecbm_prsn_phn_nmbrs_prsn_d; + +alter table ecm_person_phone_numbers drop constraint fk_ecm_prsn_phn_nmbrs_cm_pr_1; +drop index ix_ecm_prsn_phn_nmbrs_cm_pr_1; + +alter table ecmc_person_phone_numbers drop constraint fk_ecmc_prsn_phn_nmbrs_cmc__1; +drop index ix_ecmc_prsn_phn_nmbrs_cmc__1; + +alter table ecs_person_phone drop constraint fk_ecs_prsn_phn_cs_prsn_d; +drop index ix_ecs_prsn_phn_cs_prsn_d; + +alter table ecsm_child drop constraint fk_ecsm_child_ecsm_parent_id; +drop index ix_ecsm_child_ecsm_parent_id; + +alter table td_child drop constraint fk_td_child_parent_id; +drop index ix_td_child_parent_id; + +alter table element_bean drop constraint fk_elmnt_bn_cmplx_bn_d; +drop index ix_elmnt_bn_cmplx_bn_d; + +alter table empl drop constraint fk_empl_default_address_id; +drop index ix_empl_default_address_id; + +alter table esd_detail drop constraint fk_esd_detail_master_id; +drop index ix_esd_detail_master_id; + +alter table grand_parent_person drop constraint fk_grnd_prnt_prsn_sm_bn_d; +drop index ix_grnd_prnt_prsn_sm_bn_d; + +alter table survey_group drop constraint fk_srvy_grp_ctgrybjctd; +drop index ix_srvy_grp_ctgrybjctd; + +alter table hx_link_doc drop constraint fk_hx_link_doc_hx_link; +drop index ix_hx_link_doc_hx_link; + +alter table hx_link_doc drop constraint fk_hx_link_doc_he_doc; +drop index ix_hx_link_doc_he_doc; + +alter table hi_link_doc drop constraint fk_hi_link_doc_hi_link; +drop index ix_hi_link_doc_hi_link; + +alter table hi_link_doc drop constraint fk_hi_link_doc_hi_doc; +drop index ix_hi_link_doc_hi_doc; + +alter table hi_tthree drop constraint fk_hi_tthree_hi_ttwo_id; +drop index ix_hi_tthree_hi_ttwo_id; + +alter table hi_ttwo drop constraint fk_hi_ttwo_hi_tone_id; +drop index ix_hi_ttwo_hi_tone_id; + +alter table hsd_setting drop constraint fk_hsd_setting_user_id; + +alter table iaf_segment drop constraint fk_iaf_segment_status_id; +drop index ix_iaf_segment_status_id; + +alter table imrelated drop constraint fk_imrelated_owner_id; +drop index ix_imrelated_owner_id; + +alter table info_contact drop constraint fk_info_contact_company_id; +drop index ix_info_contact_company_id; + +alter table info_customer drop constraint fk_info_customer_company_id; + +alter table inner_report drop constraint fk_inner_report_forecast_id; + +alter table drel_invoice drop constraint fk_drel_invoice_booking; +drop index ix_drel_invoice_booking; + +alter table item drop constraint fk_item_etype; +drop index ix_item_etype; + +alter table item drop constraint fk_item_eregion; +drop index ix_item_eregion; + +alter table mkeygroup_monkey drop constraint fk_mkeygroup_monkey_mkeygroup; + +alter table mkeygroup_monkey drop constraint fk_mkeygroup_monkey_monkey; + +alter table trainer_monkey drop constraint fk_trainer_monkey_trainer; + +alter table trainer_monkey drop constraint fk_trainer_monkey_monkey; + +alter table troop_monkey drop constraint fk_troop_monkey_troop; + +alter table troop_monkey drop constraint fk_troop_monkey_monkey; + +alter table l2_cldf_reset_bean_child drop constraint fk_l2_cldf_rst_bn_chld_prnt_d; +drop index ix_l2_cldf_rst_bn_chld_prnt_d; + +alter table level1_level4 drop constraint fk_level1_level4_level1; +drop index ix_level1_level4_level1; + +alter table level1_level4 drop constraint fk_level1_level4_level4; +drop index ix_level1_level4_level4; + +alter table level1_level2 drop constraint fk_level1_level2_level1; +drop index ix_level1_level2_level1; + +alter table level1_level2 drop constraint fk_level1_level2_level2; +drop index ix_level1_level2_level2; + +alter table level2_level3 drop constraint fk_level2_level3_level2; +drop index ix_level2_level3_level2; + +alter table level2_level3 drop constraint fk_level2_level3_level3; +drop index ix_level2_level3_level3; + +alter table link drop constraint fk_link_id; + +alter table la_attr_value_attribute drop constraint fk_l_ttr_vl_ttrbt_l_ttr_vl; +drop index ix_l_ttr_vl_ttrbt_l_ttr_vl; + +alter table la_attr_value_attribute drop constraint fk_l_ttr_vl_ttrbt_ttrbt; +drop index ix_l_ttr_vl_ttrbt_ttrbt; + +alter table looney drop constraint fk_looney_tune_id; +drop index ix_looney_tune_id; + +alter table mcontact drop constraint fk_mcontact_customer_id; +drop index ix_mcontact_customer_id; + +alter table mcontact_message drop constraint fk_mcntct_mssg_cntct_d; +drop index ix_mcntct_mssg_cntct_d; + +alter table mcustomer drop constraint fk_mcstmr_shppng_ddrss_d; +drop index ix_mcstmr_shppng_ddrss_d; + +alter table mcustomer drop constraint fk_mcstmr_bllng_ddrss_d; +drop index ix_mcstmr_bllng_ddrss_d; + +alter table mmachine_mgroup drop constraint fk_mmachine_mgroup_mmachine; +drop index ix_mmachine_mgroup_mmachine; + +alter table mmachine_mgroup drop constraint fk_mmachine_mgroup_mgroup; +drop index ix_mmachine_mgroup_mgroup; + +alter table mprinter drop constraint fk_mprinter_current_state_id; +drop index ix_mprinter_current_state_id; + +alter table mprinter drop constraint fk_mprinter_last_swap_cyan_id; + +alter table mprinter drop constraint fk_mprntr_lst_swp_mgnt_d; + +alter table mprinter drop constraint fk_mprntr_lst_swp_yllw_d; + +alter table mprinter drop constraint fk_mprntr_lst_swp_blck_d; + +alter table mprinter_state drop constraint fk_mprinter_state_printer_id; +drop index ix_mprinter_state_printer_id; + +alter table mprofile drop constraint fk_mprofile_picture_id; +drop index ix_mprofile_picture_id; + +alter table mrole_muser drop constraint fk_mrole_muser_mrole; +drop index ix_mrole_muser_mrole; + +alter table mrole_muser drop constraint fk_mrole_muser_muser; +drop index ix_mrole_muser_muser; + +alter table muser drop constraint fk_muser_user_type_id; +drop index ix_muser_user_type_id; + +alter table mail_user_inbox drop constraint fk_mail_user_inbox_mail_user; +drop index ix_mail_user_inbox_mail_user; + +alter table mail_user_inbox drop constraint fk_mail_user_inbox_mail_box; +drop index ix_mail_user_inbox_mail_box; + +alter table mail_user_outbox drop constraint fk_mail_user_outbox_mail_user; +drop index ix_mail_user_outbox_mail_user; + +alter table mail_user_outbox drop constraint fk_mail_user_outbox_mail_box; +drop index ix_mail_user_outbox_mail_box; + +alter table c_message drop constraint fk_c_message_conversation_id; +drop index ix_c_message_conversation_id; + +alter table c_message drop constraint fk_c_message_user_id; +drop index ix_c_message_user_id; + +alter table meter_contract_data drop constraint fk_mtr_cntrct_dt_spcl_nds_c_1; + +alter table meter_special_needs_client drop constraint fk_mtr_spcl_nds_clnt_prmry_d; + +alter table meter_version drop constraint fk_mtr_vrsn_ddrss_dt_d; + +alter table meter_version drop constraint fk_mtr_vrsn_cntrct_dt_d; + +alter table mnoc_user_mnoc_role drop constraint fk_mnc_sr_mnc_rl_mnc_sr; +drop index ix_mnc_sr_mnc_rl_mnc_sr; + +alter table mnoc_user_mnoc_role drop constraint fk_mnc_sr_mnc_rl_mnc_rl; +drop index ix_mnc_sr_mnc_rl_mnc_rl; + +alter table mny_b drop constraint fk_mny_b_a_id; +drop index ix_mny_b_a_id; + +alter table mny_b_mny_c drop constraint fk_mny_b_mny_c_mny_b; +drop index ix_mny_b_mny_c_mny_b; + +alter table mny_b_mny_c drop constraint fk_mny_b_mny_c_mny_c; +drop index ix_mny_b_mny_c_mny_c; + +alter table subtopics drop constraint fk_subtopics_mny_topic_1; +drop index ix_subtopics_mny_topic_1; + +alter table subtopics drop constraint fk_subtopics_mny_topic_2; +drop index ix_subtopics_mny_topic_2; + +alter table mp_role drop constraint fk_mp_role_mp_user_id; +drop index ix_mp_role_mp_user_id; + +alter table ms_many_a_many_b drop constraint fk_ms_many_a_many_b_ms_many_a; +drop index ix_ms_many_a_many_b_ms_many_a; + +alter table ms_many_a_many_b drop constraint fk_ms_many_a_many_b_ms_many_b; +drop index ix_ms_many_a_many_b_ms_many_b; + +alter table ms_many_b_many_a drop constraint fk_ms_many_b_many_a_ms_many_b; +drop index ix_ms_many_b_many_a_ms_many_b; + +alter table ms_many_b_many_a drop constraint fk_ms_many_b_many_a_ms_many_a; +drop index ix_ms_many_b_many_a_ms_many_a; + +alter table my_lob_size_join_many drop constraint fk_my_lb_sz_jn_mny_prnt_d; +drop index ix_my_lb_sz_jn_mny_prnt_d; + +alter table o_bean_child drop constraint fk_o_bn_chld_cchd_bn_d; +drop index ix_o_bn_chld_cchd_bn_d; + +alter table ocached_app_detail drop constraint fk_ocached_app_detail_app_id; +drop index ix_ocached_app_detail_app_id; + +alter table o_cached_bean_country drop constraint fk_o_cchd_bn_cntry__cchd_bn; +drop index ix_o_cchd_bn_cntry__cchd_bn; + +alter table o_cached_bean_country drop constraint fk_o_cchd_bn_cntry__cntry; +drop index ix_o_cchd_bn_cntry__cntry; + +alter table o_cached_bean_child drop constraint fk_o_cchd_bn_chld_cchd_bn_d; +drop index ix_o_cchd_bn_chld_cchd_bn_d; + +alter table oengine drop constraint fk_oengine_car_id; + +alter table ogear_box drop constraint fk_ogear_box_car_id; + +alter table omvertex_other drop constraint fk_omvertex_other_omvertex_id; +drop index ix_omvertex_other_omvertex_id; + +alter table oroad_show_msg drop constraint fk_oroad_show_msg_company_id; + +alter table om_account_child_dbo drop constraint fk_om_ccnt_chld_db_bnn_rm_d; +drop index ix_om_ccnt_chld_db_bnn_rm_d; + +alter table om_basic_child drop constraint fk_om_basic_child_parent_id; +drop index ix_om_basic_child_parent_id; + +alter table om_ordered_detail drop constraint fk_om_rdrd_dtl_mstr_d; +drop index ix_om_rdrd_dtl_mstr_d; + +alter table o_order drop constraint fk_o_order_kcustomer_id; +drop index ix_o_order_kcustomer_id; + +alter table o_order_detail drop constraint fk_o_order_detail_order_id; +drop index ix_o_order_detail_order_id; + +alter table o_order_detail drop constraint fk_o_order_detail_product_id; +drop index ix_o_order_detail_product_id; + +alter table s_order_items drop constraint fk_s_order_items_order_uuid; +drop index ix_s_order_items_order_uuid; + +alter table or_order_ship drop constraint fk_or_order_ship_order_id; +drop index ix_or_order_ship_order_id; + +alter table organization_node drop constraint fk_orgnztn_nd_prnt_tr_nd_d; + +alter table orp_detail drop constraint fk_orp_detail_master_id; +drop index ix_orp_detail_master_id; + +alter table orp_detail2 drop constraint fk_orp_detail2_orp_master2_id; +drop index ix_orp_detail2_orp_master2_id; + +alter table oto_atwo drop constraint fk_oto_atwo_aone_id; + +alter table oto_bchild drop constraint fk_oto_bchild_master_id; + +alter table oto_child drop constraint fk_oto_child_master_id; + +alter table oto_cust_address drop constraint fk_ot_cst_ddrss_cstmr_cd; + +alter table oto_level_a drop constraint fk_oto_level_a_b_id; + +alter table oto_level_b drop constraint fk_oto_level_b_c_id; + +alter table oto_prime_extra drop constraint fk_oto_prime_extra_eid; + +alter table oto_sd_child drop constraint fk_oto_sd_child_master_id; + +alter table oto_th_many drop constraint fk_oto_th_many_oto_th_top_id; +drop index ix_oto_th_many_oto_th_top_id; + +alter table oto_th_one drop constraint fk_oto_th_one_many_id; + +alter table oto_ubprime_extra drop constraint fk_oto_ubprime_extra_eid; + +alter table oto_user_model drop constraint fk_ot_sr_mdl_sr_ptnl_d; + +alter table pfile drop constraint fk_pfile_file_content_id; + +alter table pfile drop constraint fk_pfile_file_content2_id; + +alter table paggview drop constraint fk_paggview_pview_id; + +alter table pallet_location drop constraint fk_pallet_location_zone_sid; +drop index ix_pallet_location_zone_sid; + +alter table parcel_location drop constraint fk_parcel_location_parcelid; + +alter table rawinherit_parent_rawinherit_d drop constraint fk_rwnhrt_prnt_rwnhrt_d_rwn_1; +drop index ix_rwnhrt_prnt_rwnhrt_d_rwn_1; + +alter table rawinherit_parent_rawinherit_d drop constraint fk_rwnhrt_prnt_rwnhrt_d_rwn_2; +drop index ix_rwnhrt_prnt_rwnhrt_d_rwn_2; + +alter table parent_person drop constraint fk_parent_person_some_bean_id; +drop index ix_parent_person_some_bean_id; + +alter table parent_person drop constraint fk_prnt_prsn_prnt_dntfr; +drop index ix_prnt_prsn_prnt_dntfr; + +alter table c_participation drop constraint fk_c_prtcptn_cnvrstn_d; +drop index ix_c_prtcptn_cnvrstn_d; + +alter table c_participation drop constraint fk_c_participation_user_id; +drop index ix_c_participation_user_id; + +alter table pcf_calendar drop constraint fk_pcf_calendar_pcf_person_id; +drop index ix_pcf_calendar_pcf_person_id; + +alter table pcf_city drop constraint fk_pcf_city_pcf_country_id; +drop index ix_pcf_city_pcf_country_id; + +alter table pcf_city drop constraint fk_pcf_city_mayor_id; + +alter table pcf_city drop constraint fk_pcf_city_vice_mayor_id; + +alter table pcf_event drop constraint fk_pcf_event_pcf_calendar_id; +drop index ix_pcf_event_pcf_calendar_id; + +alter table persistent_file_content drop constraint fk_prsstnt_fl_cntnt_prsstnt_1; + +alter table person drop constraint fk_person_default_address_oid; +drop index ix_person_default_address_oid; + +alter table person_cache_email drop constraint fk_prsn_cch_ml_prsn_nf_prsn_d; +drop index ix_prsn_cch_ml_prsn_nf_prsn_d; + +alter table phones drop constraint fk_phones_person_id; +drop index ix_phones_person_id; + +alter table e_position drop constraint fk_e_position_contract_id; +drop index ix_e_position_contract_id; + +alter table pp_to_ww drop constraint fk_pp_to_ww_pp; +drop index ix_pp_to_ww_pp; + +alter table pp_to_ww drop constraint fk_pp_to_ww_wview; +drop index ix_pp_to_ww_wview; + +alter table question drop constraint fk_question_groupobjectid; +drop index ix_question_groupobjectid; + +alter table r_orders drop constraint fk_r_orders_customer; +drop index ix_r_orders_customer; + +alter table rel_master drop constraint fk_rel_master_detail_id; +drop index ix_rel_master_detail_id; + +alter table resourcefile drop constraint fk_rsrcfl_prntrsrcfld; +drop index ix_rsrcfl_prntrsrcfld; + +alter table mt_role drop constraint fk_mt_role_tenant_id; +drop index ix_mt_role_tenant_id; + +alter table mt_role_permission drop constraint fk_mt_role_permission_mt_role; +drop index ix_mt_role_permission_mt_role; + +alter table mt_role_permission drop constraint fk_mt_rl_prmssn_mt_prmssn; +drop index ix_mt_rl_prmssn_mt_prmssn; + +alter table root_bean drop constraint fk_rt_bn_rfrncng_bn_d; +drop index ix_rt_bn_rfrncng_bn_d; + +alter table f_second drop constraint fk_f_second_first; + +alter table section drop constraint fk_section_article_id; +drop index ix_section_article_id; + +alter table self_parent drop constraint fk_self_parent_parent_id; +drop index ix_self_parent_parent_id; + +alter table self_ref_customer drop constraint fk_slf_rf_cstmr_rfrrd_by_d; +drop index ix_slf_rf_cstmr_rfrrd_by_d; + +alter table self_ref_example drop constraint fk_self_ref_example_parent_id; +drop index ix_self_ref_example_parent_id; + +alter table e_save_test_b drop constraint fk_e_save_test_b_sibling_a_id; + +alter table site drop constraint fk_site_parent_id; +drop index ix_site_parent_id; + +alter table site drop constraint fk_site_data_container_id; + +alter table site drop constraint fk_site_site_address_id; + +alter table source_base drop constraint fk_source_base_target_id; +drop index ix_source_base_target_id; + +alter table stockforecast drop constraint fk_stckfrcst_nnr_rprt_d; +drop index ix_stckfrcst_nnr_rprt_d; + +alter table sub_section drop constraint fk_sub_section_section_id; +drop index ix_sub_section_section_id; + +alter table tevent_many drop constraint fk_tevent_many_event_id; +drop index ix_tevent_many_event_id; + +alter table tevent_one drop constraint fk_tevent_one_event_id; + +alter table t_detail_with_other_namexxxyy drop constraint fk_t_dtl_wth_thr_nmxxxyy_ms_1; +drop index ix_t_dtl_wth_thr_nmxxxyy_ms_1; + +alter table ttruck_holder drop constraint fk_ttrck_hldr_trck_plt_n; +drop index ix_ttrck_hldr_trck_plt_n; + +alter table ttruck_holder drop constraint fk_ttruck_holder_basic_id; +drop index ix_ttruck_holder_basic_id; + +alter table ttruck_holder_item drop constraint fk_ttrck_hldr_tm_wnr_d; +drop index ix_ttrck_hldr_tm_wnr_d; + +alter table twheel drop constraint fk_twheel_owner_plate_no; +drop index ix_twheel_owner_plate_no; + +alter table tire drop constraint fk_tire_wheel; + +alter table tree_entity drop constraint fk_tree_entity_parent_id; +drop index ix_tree_entity_parent_id; + +alter table trip drop constraint fk_trip_vehicle_driver_id; +drop index ix_trip_vehicle_driver_id; + +alter table trip drop constraint fk_trip_address_id; +drop index ix_trip_address_id; + +alter table "type" drop constraint fk_type_sub_type_id; +drop index ix_type_sub_type_id; + +alter table usib_child drop constraint fk_usib_child_parent_id; +drop index ix_usib_child_parent_id; + +alter table usib_child_sibling drop constraint fk_usb_chld_sblng_chld_d; + +alter table ut_detail drop constraint fk_ut_detail_utmaster_id; +drop index ix_ut_detail_utmaster_id; + +alter table uutwo drop constraint fk_uutwo_master_id; +drop index ix_uutwo_master_id; + +alter table oto_user drop constraint fk_oto_user_account_id; + +alter table c_user drop constraint fk_c_user_group_id; +drop index ix_c_user_group_id; + +alter table em_user_role drop constraint fk_em_user_role_user_id; +drop index ix_em_user_role_user_id; + +alter table em_user_role drop constraint fk_em_user_role_role_id; +drop index ix_em_user_role_role_id; + +alter table vehicle drop constraint fk_vehicle_lease_id; +drop index ix_vehicle_lease_id; + +alter table vehicle drop constraint fk_vehicle_car_ref_id; +drop index ix_vehicle_car_ref_id; + +alter table vehicle drop constraint fk_vehicle_truck_ref_id; +drop index ix_vehicle_truck_ref_id; + +alter table vehicle_driver drop constraint fk_vehicle_driver_vehicle_id; +drop index ix_vehicle_driver_vehicle_id; + +alter table vehicle_driver drop constraint fk_vehicle_driver_address_id; +drop index ix_vehicle_driver_address_id; + +alter table warehouses drop constraint fk_warehouses_officezoneid; +drop index ix_warehouses_officezoneid; + +alter table warehousesshippingzones drop constraint fk_wrhssshppngzns_wrhss; +drop index ix_wrhssshppngzns_wrhss; + +alter table warehousesshippingzones drop constraint fk_wrhssshppngzns_zns; +drop index ix_wrhssshppngzns_zns; + +alter table sa_wheel drop constraint fk_sa_wheel_tire; +drop index ix_sa_wheel_tire; + +alter table sa_wheel drop constraint fk_sa_wheel_car; +drop index ix_sa_wheel_car; + +alter table g_who_props_otm drop constraint fk_g_wh_prps_tm_wh_crtd_d; +drop index ix_g_wh_prps_tm_wh_crtd_d; + +alter table g_who_props_otm drop constraint fk_g_wh_prps_tm_wh_mdfd_d; +drop index ix_g_wh_prps_tm_wh_mdfd_d; + +alter table with_zero drop constraint fk_with_zero_parent_id; +drop index ix_with_zero_parent_id; + +drop table asimple_bean cascade constraints purge; + +drop table bar cascade constraints purge; + +drop table block cascade constraints purge; + +drop table oto_account cascade constraints purge; + +drop table acl cascade constraints purge; + +drop table acl_container_relation cascade constraints purge; + +drop table addr cascade constraints purge; + +drop table address cascade constraints purge; + +drop table o_address cascade constraints purge; + +drop table album cascade constraints purge; + +drop table animal cascade constraints purge; + +drop table animal_shelter cascade constraints purge; + +drop table article cascade constraints purge; + +drop table attribute cascade constraints purge; + +drop table attribute_holder cascade constraints purge; + +drop table audit_log cascade constraints purge; + +drop table bbookmark cascade constraints purge; + +drop table bbookmark_org cascade constraints purge; + +drop table bbookmark_user cascade constraints purge; + +drop table bsimple_with_gen cascade constraints purge; + +drop table bsite cascade constraints purge; + +drop table bsite_user_a cascade constraints purge; + +drop table bsite_user_b cascade constraints purge; + +drop table bsite_user_c cascade constraints purge; + +drop table bsite_user_d cascade constraints purge; + +drop table bsite_user_e cascade constraints purge; + +drop table buser cascade constraints purge; + +drop table bwith_qident cascade constraints purge; + +drop table basic_draftable_bean cascade constraints purge; + +drop table basic_draftable_bean_draft cascade constraints purge; + +drop table basic_joda_entity cascade constraints purge; + +drop table bean_with_time_zone cascade constraints purge; + +drop table drel_booking cascade constraints purge; +drop sequence drel_booking_seq; + +drop table bw_bean cascade constraints purge; + +drop table cepcategory cascade constraints purge; + +drop table cepproduct cascade constraints purge; + +drop table cepproduct_category cascade constraints purge; + +drop table ciaddress cascade constraints purge; + +drop table cicustomer_parent cascade constraints purge; + +drop table cistreet_parent cascade constraints purge; + +drop table cinh_ref cascade constraints purge; + +drop table cinh_root cascade constraints purge; + +drop table ckey_assoc cascade constraints purge; + +drop table ckey_detail cascade constraints purge; + +drop table ckey_parent cascade constraints purge; + +drop table coone cascade constraints purge; + +drop table coone_many cascade constraints purge; + +drop table coroot cascade constraints purge; + +drop table calculation_result cascade constraints purge; + +drop table cao_bean cascade constraints purge; + +drop table sp_car_car cascade constraints purge; +drop sequence sp_car_car_seq; + +drop table sp_car_car_wheels cascade constraints purge; + +drop table sp_car_car_doors cascade constraints purge; + +drop table sa_car cascade constraints purge; +drop sequence sa_car_seq; + +drop table car_accessory cascade constraints purge; + +drop table car_fuse cascade constraints purge; + +drop table category cascade constraints purge; + +drop table e_save_test_d cascade constraints purge; + +drop table child_person cascade constraints purge; + +drop table cke_client cascade constraints purge; + +drop table cke_user cascade constraints purge; + +drop table class_super cascade constraints purge; + +drop table class_super_monkey cascade constraints purge; + +drop table configuration cascade constraints purge; + +drop table configurations cascade constraints purge; + +drop table contact cascade constraints purge; + +drop table contact_group cascade constraints purge; + +drop table contact_note cascade constraints purge; + +drop table contract cascade constraints purge; + +drop table contract_costs cascade constraints purge; + +drop table c_conversation cascade constraints purge; + +drop table o_country cascade constraints purge; + +drop table cover cascade constraints purge; + +drop table o_customer cascade constraints purge; + +drop table dcredit cascade constraints purge; + +drop table dcredit_drol cascade constraints purge; + +drop table dexh_entity cascade constraints purge; + +drop table dint_parent cascade constraints purge; + +drop table dmachine cascade constraints purge; + +drop table d_machine_aux_use cascade constraints purge; + +drop table d_machine_stats cascade constraints purge; + +drop table d_machine_use cascade constraints purge; + +drop table dorg cascade constraints purge; + +drop table dperson cascade constraints purge; + +drop table drol cascade constraints purge; + +drop table drot cascade constraints purge; + +drop table drot_drol cascade constraints purge; + +drop table rawinherit_data cascade constraints purge; + +drop table data_container cascade constraints purge; + +drop table dc_detail cascade constraints purge; + +drop table dc_master cascade constraints purge; + +drop table dfk_cascade cascade constraints purge; + +drop table dfk_cascade_one cascade constraints purge; + +drop table dfk_none cascade constraints purge; + +drop table dfk_none_via_join cascade constraints purge; + +drop table dfk_none_via_mto_m cascade constraints purge; + +drop table dfk_none_via_mto_m_dfk_one cascade constraints purge; + +drop table dfk_one cascade constraints purge; + +drop table dfk_set_null cascade constraints purge; + +drop table doc cascade constraints purge; + +drop table doc_link cascade constraints purge; + +drop table doc_link_draft cascade constraints purge; + +drop table doc_draft cascade constraints purge; + +drop table document cascade constraints purge; + +drop table document_draft cascade constraints purge; + +drop table document_media cascade constraints purge; + +drop table document_media_draft cascade constraints purge; + +drop table sp_car_door cascade constraints purge; +drop sequence sp_car_door_seq; + +drop table earray_bean cascade constraints purge; + +drop table earray_set_bean cascade constraints purge; + +drop table e_basic cascade constraints purge; + +drop table ebasic_change_log cascade constraints purge; + +drop table ebasic_clob cascade constraints purge; + +drop table ebasic_clob_fetch_eager cascade constraints purge; + +drop table ebasic_clob_no_ver cascade constraints purge; + +drop table e_basicenc cascade constraints purge; + +drop table e_basicenc_bin cascade constraints purge; + +drop table e_basicenc_client cascade constraints purge; + +drop table e_basicenc_relate cascade constraints purge; + +drop table e_basic_enum_id cascade constraints purge; + +drop table e_basic_eni cascade constraints purge; + +drop table ebasic_hstore cascade constraints purge; + +drop table ebasic_json_jackson cascade constraints purge; + +drop table ebasic_json_jackson2 cascade constraints purge; + +drop table ebasic_json_list cascade constraints purge; + +drop table ebasic_json_map cascade constraints purge; + +drop table ebasic_json_map_blob cascade constraints purge; + +drop table ebasic_json_map_clob cascade constraints purge; + +drop table ebasic_json_map_detail cascade constraints purge; + +drop table ebasic_json_map_json_b cascade constraints purge; + +drop table ebasic_json_map_varchar cascade constraints purge; + +drop table ebasic_json_node cascade constraints purge; + +drop table ebasic_json_node_blob cascade constraints purge; + +drop table ebasic_json_node_json_b cascade constraints purge; + +drop table ebasic_json_node_varchar cascade constraints purge; + +drop table ebasic_json_unmapped cascade constraints purge; + +drop table e_basic_ndc cascade constraints purge; + +drop table ebasic_no_sdchild cascade constraints purge; + +drop table ebasic_sdchild cascade constraints purge; + +drop table ebasic_soft_delete cascade constraints purge; + +drop table e_basicver cascade constraints purge; + +drop table e_basic_withlife cascade constraints purge; + +drop table e_basic_with_ex cascade constraints purge; + +drop table e_basicverucon cascade constraints purge; + +drop table ecache_child cascade constraints purge; + +drop table ecache_root cascade constraints purge; + +drop table e_col_ab cascade constraints purge; + +drop table ecustom_id cascade constraints purge; + +drop table edefault_prop cascade constraints purge; + +drop table eemb_inner cascade constraints purge; + +drop table eemb_outer cascade constraints purge; + +drop table efile2_no_fk cascade constraints purge; + +drop table efile_no_fk cascade constraints purge; + +drop table efile_no_fk_euser_no_fk cascade constraints purge; + +drop table efile_no_fk_euser_no_fk_soft_d cascade constraints purge; + +drop table egen_props cascade constraints purge; + +drop table eid_uid_bean cascade constraints purge; + +drop table einvoice cascade constraints purge; + +drop table e_main cascade constraints purge; + +drop table enull_collection cascade constraints purge; + +drop table enull_collection_detail cascade constraints purge; + +drop table eopt_one_a cascade constraints purge; + +drop table eopt_one_b cascade constraints purge; + +drop table eopt_one_c cascade constraints purge; + +drop table eper_addr cascade constraints purge; + +drop table eperson cascade constraints purge; + +drop table e_person_online cascade constraints purge; + +drop table esimple cascade constraints purge; + +drop table esoft_del_book cascade constraints purge; + +drop table esoft_del_book_esoft_del_user cascade constraints purge; + +drop table esoft_del_down cascade constraints purge; + +drop table esoft_del_mid cascade constraints purge; + +drop table esoft_del_one_a cascade constraints purge; + +drop table esoft_del_one_b cascade constraints purge; + +drop table esoft_del_role cascade constraints purge; + +drop table esoft_del_role_esoft_del_user cascade constraints purge; + +drop table esoft_del_top cascade constraints purge; + +drop table esoft_del_up cascade constraints purge; + +drop table esoft_del_user cascade constraints purge; + +drop table esoft_del_user_esoft_del_role cascade constraints purge; + +drop table esome_convert_type cascade constraints purge; + +drop table esome_type cascade constraints purge; + +drop table etrans_many cascade constraints purge; + +drop table rawinherit_uncle cascade constraints purge; + +drop table euser_no_fk cascade constraints purge; + +drop table euser_no_fk_soft_del cascade constraints purge; + +drop table evanilla_collection cascade constraints purge; + +drop table evanilla_collection_detail cascade constraints purge; + +drop table ewho_props cascade constraints purge; + +drop table e_withinet cascade constraints purge; + +drop table ec_enum_person cascade constraints purge; + +drop table ec_enum_person_tags cascade constraints purge; + +drop table ec_person cascade constraints purge; + +drop table ec_person_phone cascade constraints purge; + +drop table ec_top cascade constraints purge; + +drop table ec_top_ecs_person cascade constraints purge; + +drop table ecbl_person cascade constraints purge; + +drop table ecbl_person_phone_numbers cascade constraints purge; + +drop table ecbm_person cascade constraints purge; + +drop table ecbm_person_phone_numbers cascade constraints purge; + +drop table ecm_person cascade constraints purge; + +drop table ecm_person_phone_numbers cascade constraints purge; + +drop table ecmc_person cascade constraints purge; + +drop table ecmc_person_phone_numbers cascade constraints purge; + +drop table ecs_person cascade constraints purge; + +drop table ecs_person_phone cascade constraints purge; + +drop table ecsm_child cascade constraints purge; + +drop table ecsm_values cascade constraints purge; + +drop table ecsm_one cascade constraints purge; + +drop table ecsm_parent cascade constraints purge; + +drop table ecsm_two cascade constraints purge; + +drop table td_child cascade constraints purge; + +drop table td_parent cascade constraints purge; + +drop table element_bean cascade constraints purge; + +drop table empl cascade constraints purge; + +drop table esd_detail cascade constraints purge; + +drop table esd_master cascade constraints purge; + +drop table feature_desc cascade constraints purge; + +drop table f_first cascade constraints purge; + +drop table foo cascade constraints purge; + +drop table gen_key_identity cascade constraints purge; + +drop table gen_key_sequence cascade constraints purge; +drop sequence SEQ_NAME; + +drop table grand_parent_person cascade constraints purge; + +drop table survey_group cascade constraints purge; + +drop table c_group cascade constraints purge; + +drop table he_doc cascade constraints purge; + +drop table hx_link cascade constraints purge; + +drop table hx_link_doc cascade constraints purge; + +drop table hi_doc cascade constraints purge; + +drop table hi_link cascade constraints purge; + +drop table hi_link_doc cascade constraints purge; + +drop table hi_tone cascade constraints purge; + +drop table hi_tthree cascade constraints purge; + +drop table hi_ttwo cascade constraints purge; + +drop table hsd_setting cascade constraints purge; + +drop table hsd_user cascade constraints purge; + +drop table iaf_segment cascade constraints purge; + +drop table iaf_segment_status cascade constraints purge; + +drop table imrelated cascade constraints purge; + +drop table imroot cascade constraints purge; + +drop table ixresource cascade constraints purge; + +drop table info_company cascade constraints purge; + +drop table info_contact cascade constraints purge; + +drop table info_customer cascade constraints purge; + +drop table inner_report cascade constraints purge; + +drop table drel_invoice cascade constraints purge; +drop sequence drel_invoice_seq; + +drop table item cascade constraints purge; + +drop table monkey cascade constraints purge; + +drop table mkeygroup cascade constraints purge; + +drop table mkeygroup_monkey cascade constraints purge; + +drop table trainer cascade constraints purge; + +drop table trainer_monkey cascade constraints purge; + +drop table troop cascade constraints purge; + +drop table troop_monkey cascade constraints purge; + +drop table l2_cldf_reset_bean cascade constraints purge; + +drop table l2_cldf_reset_bean_child cascade constraints purge; + +drop table level1 cascade constraints purge; + +drop table level1_level4 cascade constraints purge; + +drop table level1_level2 cascade constraints purge; + +drop table level2 cascade constraints purge; + +drop table level2_level3 cascade constraints purge; + +drop table level3 cascade constraints purge; + +drop table level4 cascade constraints purge; + +drop table link cascade constraints purge; + +drop table link_draft cascade constraints purge; + +drop table la_attr_value cascade constraints purge; + +drop table la_attr_value_attribute cascade constraints purge; + +drop table looney cascade constraints purge; + +drop table maddress cascade constraints purge; + +drop table mcontact cascade constraints purge; + +drop table mcontact_message cascade constraints purge; + +drop table mcustomer cascade constraints purge; + +drop table mgroup cascade constraints purge; + +drop table mmachine cascade constraints purge; + +drop table mmachine_mgroup cascade constraints purge; + +drop table mmedia cascade constraints purge; + +drop table non_updateprop cascade constraints purge; + +drop table mprinter cascade constraints purge; + +drop table mprinter_state cascade constraints purge; + +drop table mprofile cascade constraints purge; + +drop table mprotected_construct_bean cascade constraints purge; + +drop table mrole cascade constraints purge; + +drop table mrole_muser cascade constraints purge; + +drop table msome_other cascade constraints purge; + +drop table muser cascade constraints purge; + +drop table muser_type cascade constraints purge; + +drop table mail_box cascade constraints purge; + +drop table mail_user cascade constraints purge; + +drop table mail_user_inbox cascade constraints purge; + +drop table mail_user_outbox cascade constraints purge; + +drop table main_entity cascade constraints purge; + +drop table main_entity_relation cascade constraints purge; + +drop table map_super_actual cascade constraints purge; + +drop table c_message cascade constraints purge; + +drop table meter_address_data cascade constraints purge; + +drop table meter_contract_data cascade constraints purge; + +drop table meter_special_needs_client cascade constraints purge; + +drop table meter_special_needs_contact cascade constraints purge; + +drop table meter_version cascade constraints purge; + +drop table mnoc_role cascade constraints purge; + +drop table mnoc_user cascade constraints purge; + +drop table mnoc_user_mnoc_role cascade constraints purge; + +drop table mny_a cascade constraints purge; + +drop table mny_b cascade constraints purge; + +drop table mny_b_mny_c cascade constraints purge; + +drop table mny_c cascade constraints purge; + +drop table mny_topic cascade constraints purge; + +drop table subtopics cascade constraints purge; + +drop table mp_role cascade constraints purge; + +drop table mp_user cascade constraints purge; + +drop table ms_many_a cascade constraints purge; + +drop table ms_many_a_many_b cascade constraints purge; + +drop table ms_many_b cascade constraints purge; + +drop table ms_many_b_many_a cascade constraints purge; + +drop table my_lob_size cascade constraints purge; + +drop table my_lob_size_join_many cascade constraints purge; + +drop table noidbean cascade constraints purge; + +drop table o_bean_child cascade constraints purge; + +drop table ocached_app cascade constraints purge; + +drop table ocached_app_detail cascade constraints purge; + +drop table o_cached_bean cascade constraints purge; + +drop table o_cached_bean_country cascade constraints purge; + +drop table o_cached_bean_child cascade constraints purge; + +drop table o_cached_inherit cascade constraints purge; + +drop table o_cached_natkey cascade constraints purge; + +drop table o_cached_natkey3 cascade constraints purge; + +drop table ocached_nkey_uid cascade constraints purge; + +drop table ocar cascade constraints purge; + +drop table ocompany cascade constraints purge; + +drop table oengine cascade constraints purge; + +drop table ogear_box cascade constraints purge; + +drop table omvertex cascade constraints purge; + +drop table omvertex_other cascade constraints purge; + +drop table oroad_show_msg cascade constraints purge; + +drop table om_account_child_dbo cascade constraints purge; + +drop table om_account_dbo cascade constraints purge; + +drop table om_basic_child cascade constraints purge; + +drop table om_basic_parent cascade constraints purge; + +drop table om_ordered_detail cascade constraints purge; + +drop table om_ordered_master cascade constraints purge; + +drop table only_id_entity cascade constraints purge; + +drop table o_order cascade constraints purge; + +drop table o_order_detail cascade constraints purge; + +drop table s_orders cascade constraints purge; + +drop table s_order_items cascade constraints purge; + +drop table or_order_ship cascade constraints purge; + +drop table organisation cascade constraints purge; + +drop table organization_node cascade constraints purge; + +drop table organization_tree_node cascade constraints purge; + +drop table orp_detail cascade constraints purge; + +drop table orp_detail2 cascade constraints purge; + +drop table orp_master cascade constraints purge; + +drop table orp_master2 cascade constraints purge; + +drop table oto_aone cascade constraints purge; + +drop table oto_atwo cascade constraints purge; + +drop table oto_bchild cascade constraints purge; + +drop table oto_bmaster cascade constraints purge; + +drop table oto_child cascade constraints purge; + +drop table oto_cust cascade constraints purge; + +drop table oto_cust_address cascade constraints purge; + +drop table oto_level_a cascade constraints purge; + +drop table oto_level_b cascade constraints purge; + +drop table oto_level_c cascade constraints purge; + +drop table oto_master cascade constraints purge; + +drop table oto_prime cascade constraints purge; + +drop table oto_prime_extra cascade constraints purge; + +drop table oto_sd_child cascade constraints purge; + +drop table oto_sd_master cascade constraints purge; + +drop table oto_th_many cascade constraints purge; + +drop table oto_th_one cascade constraints purge; + +drop table oto_th_top cascade constraints purge; + +drop table oto_ubprime cascade constraints purge; + +drop table oto_ubprime_extra cascade constraints purge; + +drop table oto_uprime cascade constraints purge; + +drop table oto_uprime_extra cascade constraints purge; + +drop table oto_user_model cascade constraints purge; + +drop table oto_user_model_optional cascade constraints purge; + +drop table pfile cascade constraints purge; + +drop table pfile_content cascade constraints purge; + +drop table paggview cascade constraints purge; + +drop table pallet_location cascade constraints purge; + +drop table parcel cascade constraints purge; + +drop table parcel_location cascade constraints purge; + +drop table rawinherit_parent cascade constraints purge; + +drop table rawinherit_parent_rawinherit_d cascade constraints purge; + +drop table e_save_test_c cascade constraints purge; + +drop table parent_person cascade constraints purge; + +drop table c_participation cascade constraints purge; + +drop table password_store_model cascade constraints purge; + +drop table pcf_calendar cascade constraints purge; + +drop table pcf_city cascade constraints purge; + +drop table pcf_country cascade constraints purge; + +drop table pcf_event cascade constraints purge; + +drop table pcf_person cascade constraints purge; + +drop table mt_permission cascade constraints purge; + +drop table persistent_file cascade constraints purge; + +drop table persistent_file_content cascade constraints purge; + +drop table person cascade constraints purge; + +drop table persons cascade constraints purge; + +drop table person_cache_email cascade constraints purge; + +drop table person_cache_info cascade constraints purge; + +drop table phones cascade constraints purge; + +drop table e_position cascade constraints purge; + +drop table primary_revision cascade constraints purge; + +drop table o_product cascade constraints purge; + +drop table pp cascade constraints purge; + +drop table pp_to_ww cascade constraints purge; + +drop table question cascade constraints purge; + +drop table rcustomer cascade constraints purge; + +drop table r_orders cascade constraints purge; + +drop table referencing_bean cascade constraints purge; + +drop table region cascade constraints purge; + +drop table rel_detail cascade constraints purge; + +drop table rel_master cascade constraints purge; + +drop table resourcefile cascade constraints purge; + +drop table mt_role cascade constraints purge; + +drop table mt_role_permission cascade constraints purge; + +drop table em_role cascade constraints purge; + +drop table root_bean cascade constraints purge; + +drop table f_second cascade constraints purge; + +drop table section cascade constraints purge; + +drop table self_parent cascade constraints purge; + +drop table self_ref_customer cascade constraints purge; + +drop table self_ref_example cascade constraints purge; + +drop table e_save_test_a cascade constraints purge; + +drop table e_save_test_b cascade constraints purge; + +drop table site cascade constraints purge; + +drop table site_address cascade constraints purge; + +drop table some_enum_bean cascade constraints purge; + +drop table some_file_bean cascade constraints purge; + +drop table some_new_types_bean cascade constraints purge; + +drop table some_period_bean cascade constraints purge; + +drop table source_base cascade constraints purge; + +drop table stockforecast cascade constraints purge; + +drop table sub_section cascade constraints purge; + +drop table sub_type cascade constraints purge; + +drop table survey cascade constraints purge; + +drop table tbytes_only cascade constraints purge; + +drop table tcar cascade constraints purge; + +drop table tevent cascade constraints purge; + +drop table tevent_many cascade constraints purge; + +drop table tevent_one cascade constraints purge; + +drop table tint_root cascade constraints purge; + +drop table tjoda_entity cascade constraints purge; + +drop table t_mapsuper1 cascade constraints purge; + +drop table t_oneb cascade constraints purge; + +drop table t_detail_with_other_namexxxyy cascade constraints purge; +drop sequence t_atable_detail_seq; + +drop table t_atable_thatisrelatively cascade constraints purge; +drop sequence t_atable_master_seq; + +drop table ttruck_holder cascade constraints purge; + +drop table ttruck_holder_item cascade constraints purge; + +drop table tuuid_entity cascade constraints purge; + +drop table twheel cascade constraints purge; + +drop table twith_pre_insert cascade constraints purge; + +drop table target_base cascade constraints purge; + +drop table mt_tenant cascade constraints purge; + +drop table test_annotation_base_entity cascade constraints purge; + +drop table tire cascade constraints purge; +drop sequence tire_seq; + +drop table sa_tire cascade constraints purge; +drop sequence sa_tire_seq; + +drop table tree_entity cascade constraints purge; + +drop table trip cascade constraints purge; + +drop table truck_ref cascade constraints purge; + +drop table tune cascade constraints purge; + +drop table "type" cascade constraints purge; + +drop table tz_bean cascade constraints purge; + +drop table usib_child cascade constraints purge; + +drop table usib_child_sibling cascade constraints purge; + +drop table usib_parent cascade constraints purge; + +drop table ut_detail cascade constraints purge; + +drop table ut_master cascade constraints purge; + +drop table uuone cascade constraints purge; + +drop table uutwo cascade constraints purge; + +drop table oto_user cascade constraints purge; + +drop table c_user cascade constraints purge; + +drop table tx_user cascade constraints purge; + +drop table g_user cascade constraints purge; + +drop table em_user cascade constraints purge; + +drop table user_interest_live cascade constraints purge; + +drop table em_user_role cascade constraints purge; + +drop table vehicle cascade constraints purge; + +drop table vehicle_driver cascade constraints purge; + +drop table vehicle_lease cascade constraints purge; + +drop table warehouses cascade constraints purge; + +drop table warehousesshippingzones cascade constraints purge; + +drop table wheel cascade constraints purge; +drop sequence wheel_seq; + +drop table sa_wheel cascade constraints purge; +drop sequence sa_wheel_seq; + +drop table sp_car_wheel cascade constraints purge; +drop sequence sp_car_wheel_seq; + +drop table g_who_props_otm cascade constraints purge; + +drop table with_zero cascade constraints purge; + +drop table parent cascade constraints purge; + +drop table wview cascade constraints purge; + +drop table zones cascade constraints purge; + +drop index ix_cntct_lst_nm_frst_nm; +drop index ix_e_basic_name; +drop index ix_efile2_no_fk_owner_id; +drop index ix_ecsm_values_host_id; +drop index ix_organization_node_kind; +drop index ano_3; diff --git a/ebean-core/src/test/ddl-review/pg-create-all.sql b/ebean-core/src/test/ddl-review/pg-create-all.sql new file mode 100644 index 000000000..5b4bc24dd --- /dev/null +++ b/ebean-core/src/test/ddl-review/pg-create-all.sql @@ -0,0 +1,5236 @@ +-- Generated by ebean unknown at 2020-08-24T21:02:32.420817Z +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 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 timestamptz not null, + when_modified timestamptz 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 timestamptz, + country_code varchar(2), + updtime timestamptz 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 timestamptz not null, + last_update timestamptz 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 article ( + id integer generated by default as identity not null, + name varchar(255), + author varchar(255), + cretime timestamptz not null, + updtime timestamptz not null, + version bigint not null, + constraint pk_article primary key (id) +); + +create table attribute ( + option_type integer not null, + id integer generated by default as identity not null, + attribute_holder_id integer, + cretime timestamptz not null, + updtime timestamptz 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 timestamptz not null, + updtime timestamptz 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)) +); + +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 timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + updated timestamptz not null, + version timestamptz 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 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 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 timestamptz not null, + updtime timestamptz 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 timestamptz not null, + updtime timestamptz 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 calculation_result ( + id integer generated by default as identity not null, + charge float 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 timestamptz not null, + updtime timestamptz 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 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 timestamptz not null, + updtime timestamptz 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 timestamptz not null, + updtime timestamptz 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 text, + cretime timestamptz not null, + updtime timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + updtime timestamptz 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 timestamptz not null, + constraint pk_dexh_entity primary key (oid) +); + +create table dint_parent ( + type integer 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz, + organisation_id bigint, + version bigint not null, + when_created timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 varchar[], + uids uuid[] not null, + other_ids bigint[], + doubs float[], + statuses integer[], + vc_enums varchar[], + int_enums integer[], + status2 integer[], + 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 varchar[], + uids uuid[], + other_ids bigint[], + doubs float[], + 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 timestamptz, + 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), + who_created varchar(255) not null, + who_modified varchar(255) not null, + when_created timestamptz not null, + when_modified timestamptz 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 text, + last_update timestamptz 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 text, + last_update timestamptz 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 text, + 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 bytea, + dob bytea, + status bytea, + last_update timestamptz, + 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 bytea, + some_time bytea, + last_update timestamptz 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 bytea, + dob bytea, + status bytea, + 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 timestamptz, + 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 hstore, + 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 json, + value_list jsonb, + value_map json, + plain_value json, + 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 json, + value_list jsonb, + value_map json, + plain_value json, + version bigint not null, + constraint pk_ebasic_json_jackson2 primary key (id) +); + +create table ebasic_json_list ( + id bigint generated by default as identity not null, + name varchar(255), + bean_set json, + bean_list jsonb, + bean_map json, + plain_bean json, + flags json, + 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 json, + 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 bytea, + 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 text, + 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 json, + 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 jsonb, + 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_node ( + id bigint generated by default as identity not null, + name varchar(255), + content json, + 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 bytea, + 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 jsonb, + 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_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_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 timestamptz 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_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 timestamptz 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 timestamptz, + date2 timestamptz, + 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 timestamptz not null, + when_modified timestamptz not null, + ts_created timestamptz not null, + ts_updated timestamptz not null, + ldt_created timestamptz not null, + ldt_updated timestamptz not null, + odt_created timestamptz not null, + odt_updated timestamptz not null, + zdt_created timestamptz not null, + zdt_updated timestamptz not null, + instant_created timestamptz not null, + instant_updated timestamptz 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 timestamptz, + state integer, + person_id bigint, + ship_street varchar(255), + ship_suburb varchar(255), + ship_city varchar(255), + ship_status varchar(3), + bill_street varchar(255), + bill_suburb varchar(255), + bill_city varchar(255), + bill_status varchar(3), + 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 timestamptz not null, + updtime timestamptz 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 timestamptz not null, + updtime timestamptz 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 timestamptz not null, + updtime timestamptz 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), + version bigint not null, + constraint ck_eperson_addr_status check ( addr_status in ('ONE','TWO')), + constraint pk_eperson 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 timestamptz 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 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 timestamptz not null, + when_modified timestamptz 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 inet, + inet2 inet, + cidr cidr, + 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 text 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 timestamptz not null, + when_modified timestamptz not null, + constraint pk_c_group primary key (id) +); + +create table he_doc ( + id bigint generated by default as identity not null, + name varchar(255), + version bigint not null, + when_created timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz, + 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 timestamptz, + date_created timestamptz, + 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 timestamptz, + link_comment varchar(255), + version bigint not null, + when_created timestamptz not null, + when_modified timestamptz 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 timestamptz, + link_comment varchar(255), + dirty boolean default false not null, + version bigint not null, + when_created timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + updtime timestamptz 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 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 timestamptz not null, + when_updated timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz not null, + constraint pk_mny_c 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 text, + 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 timestamptz 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 timestamptz not null, + updtime timestamptz 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 timestamptz not null, + updtime timestamptz 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 timestamptz not null, + updtime timestamptz 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_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 timestamptz not null, + updtime timestamptz 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 float, + product_id integer, + cretime timestamptz, + updtime timestamptz 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 timestamptz, + cretime timestamptz not null, + updtime timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + updtime timestamptz 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 bytea, + cretime timestamptz not null, + updtime timestamptz 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_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 timestamptz not null, + when_modified timestamptz 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 text, + enc4 bytea, + enc5 bytea, + enc6 bytea, + version bigint not null, + when_created timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + updtime timestamptz 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 bytea, + cretime timestamptz not null, + updtime timestamptz 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 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 timestamptz not null, + updtime timestamptz 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 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 text, + cretime timestamptz not null, + updtime timestamptz not null, + version bigint not null, + constraint ck_section_type check ( type in (0,1)), + constraint pk_section primary key (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 bytea, + 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, + mth integer, + yr integer, + yr_mth date, + month_day date, + sql_date date, + sql_time time, + local_date date, + local_date_time timestamptz, + offset_date_time timestamptz, + zoned_date_time timestamptz, + local_time time, + instant timestamptz, + 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 timestamptz not null, + updtime timestamptz 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 bytea, + constraint pk_tbytes_only primary key (id) +); + +create table tcar ( + type varchar(31) not null, + plate_no varchar(32) 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, + units integer not null, + amount float 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 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 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 timestamptz, + cretime timestamptz not null, + updtime timestamptz 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 timestamptz, + tstz timestamptz, + 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 float, + 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 timestamptz not null, + when_modified timestamptz 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 timestamptz not null, + when_modified timestamptz 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 timestamptz 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 timestamptz, + lease_id bigint, + cretime timestamptz not null, + updtime timestamptz not null, + version bigint not null, + siz varchar(3), + driver varchar(255), + car_ref_id integer, + notes varchar(255), + truck_ref_id integer, + capacity float, + 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 timestamptz, + cretime timestamptz not null, + updtime timestamptz 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 timestamptz not null, + when_modified timestamptz 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 unique index concurrently ix_t_detail_with_other_namexxxyy_lowername on t_detail_with_other_namexxxyy (lower(name)); +create index ix_t_detail_with_other_namexxxyy_defn on t_detail_with_other_namexxxyy using hash (lower(name)) where lower(name) like 'r%'; +create index ano_3 on test_annotation_base_entity (direct); +create index ano_1 on test_annotation_base_entity (direct); +create index ano_2 on test_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_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_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; + +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 cascade; + +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 set null; + +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; + +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_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_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_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_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; + +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_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_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 hx_link add column sys_period tstzrange not null default tstzrange(current_timestamp, null); +update hx_link set sys_period = tstzrange(when_created, null); +create table hx_link_history(like hx_link); +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 tstzrange not null default tstzrange(current_timestamp, null); +update hi_link set sys_period = tstzrange(when_created, null); +create table hi_link_history(like hi_link); +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 tstzrange not null default tstzrange(current_timestamp, null); +create table hi_link_doc_history(like hi_link_doc); +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 tstzrange not null default tstzrange(current_timestamp, null); +update hi_tone set sys_period = tstzrange(when_created, null); +create table hi_tone_history(like hi_tone); +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 tstzrange not null default tstzrange(current_timestamp, null); +update hi_tthree set sys_period = tstzrange(when_created, null); +create table hi_tthree_history(like hi_tthree); +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 tstzrange not null default tstzrange(current_timestamp, null); +update hi_ttwo set sys_period = tstzrange(when_created, null); +create table hi_ttwo_history(like hi_ttwo); +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 tstzrange not null default tstzrange(current_timestamp, null); +update hsd_setting set sys_period = tstzrange(when_created, null); +create table hsd_setting_history(like hsd_setting); +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 tstzrange not null default tstzrange(current_timestamp, null); +update hsd_user set sys_period = tstzrange(when_created, null); +create table hsd_user_history(like hsd_user); +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 tstzrange not null default tstzrange(current_timestamp, null); +update link set sys_period = tstzrange(when_created, null); +create table link_history(like link); +create view link_with_history as select * from link union all select * from link_history; + +alter table c_user add column sys_period tstzrange not null default tstzrange(current_timestamp, null); +update c_user set sys_period = tstzrange(when_created, null); +create table c_user_history(like c_user); +create view c_user_with_history as select * from c_user union all select * from c_user_history; + +create or replace function hx_link_history_version() returns trigger as $$ +declare + lowerTs timestamptz; + upperTs timestamptz; +begin + lowerTs = lower(OLD.sys_period); + upperTs = greatest(lowerTs + '1 microsecond',current_timestamp); + if (TG_OP = 'UPDATE') then + insert into hx_link_history (sys_period,id, name, location, comments, version, when_created, when_modified, deleted) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.name, OLD.location, OLD.comments, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); + NEW.sys_period = tstzrange(upperTs,null); + return new; + elsif (TG_OP = 'DELETE') then + insert into hx_link_history (sys_period,id, name, location, comments, version, when_created, when_modified, deleted) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.name, OLD.location, OLD.comments, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); + return old; + end if; +end; +$$ LANGUAGE plpgsql; + +create trigger hx_link_history_upd + before update or delete on hx_link + for each row execute procedure hx_link_history_version(); + +create or replace function hi_link_history_version() returns trigger as $$ +declare + lowerTs timestamptz; + upperTs timestamptz; +begin + lowerTs = lower(OLD.sys_period); + upperTs = greatest(lowerTs + '1 microsecond',current_timestamp); + if (TG_OP = 'UPDATE') then + insert into hi_link_history (sys_period,id, name, location, comments, version, when_created, when_modified) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.name, OLD.location, OLD.comments, OLD.version, OLD.when_created, OLD.when_modified); + NEW.sys_period = tstzrange(upperTs,null); + return new; + elsif (TG_OP = 'DELETE') then + insert into hi_link_history (sys_period,id, name, location, comments, version, when_created, when_modified) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.name, OLD.location, OLD.comments, OLD.version, OLD.when_created, OLD.when_modified); + return old; + end if; +end; +$$ LANGUAGE plpgsql; + +create trigger hi_link_history_upd + before update or delete on hi_link + for each row execute procedure hi_link_history_version(); + +create or replace function hi_link_doc_history_version() returns trigger as $$ +declare + lowerTs timestamptz; + upperTs timestamptz; +begin + lowerTs = lower(OLD.sys_period); + upperTs = greatest(lowerTs + '1 microsecond',current_timestamp); + if (TG_OP = 'UPDATE') then + insert into hi_link_doc_history (sys_period,hi_link_id, hi_doc_id) values (tstzrange(lowerTs,upperTs), OLD.hi_link_id, OLD.hi_doc_id); + NEW.sys_period = tstzrange(upperTs,null); + return new; + elsif (TG_OP = 'DELETE') then + insert into hi_link_doc_history (sys_period,hi_link_id, hi_doc_id) values (tstzrange(lowerTs,upperTs), OLD.hi_link_id, OLD.hi_doc_id); + return old; + end if; +end; +$$ LANGUAGE plpgsql; + +create trigger hi_link_doc_history_upd + before update or delete on hi_link_doc + for each row execute procedure hi_link_doc_history_version(); + +create or replace function hi_tone_history_version() returns trigger as $$ +declare + lowerTs timestamptz; + upperTs timestamptz; +begin + lowerTs = lower(OLD.sys_period); + upperTs = greatest(lowerTs + '1 microsecond',current_timestamp); + if (TG_OP = 'UPDATE') then + insert into hi_tone_history (sys_period,id, name, comments, version, when_created, when_modified) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.name, OLD.comments, OLD.version, OLD.when_created, OLD.when_modified); + NEW.sys_period = tstzrange(upperTs,null); + return new; + elsif (TG_OP = 'DELETE') then + insert into hi_tone_history (sys_period,id, name, comments, version, when_created, when_modified) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.name, OLD.comments, OLD.version, OLD.when_created, OLD.when_modified); + return old; + end if; +end; +$$ LANGUAGE plpgsql; + +create trigger hi_tone_history_upd + before update or delete on hi_tone + for each row execute procedure hi_tone_history_version(); + +create or replace function hi_tthree_history_version() returns trigger as $$ +declare + lowerTs timestamptz; + upperTs timestamptz; +begin + lowerTs = lower(OLD.sys_period); + upperTs = greatest(lowerTs + '1 microsecond',current_timestamp); + if (TG_OP = 'UPDATE') then + insert into hi_tthree_history (sys_period,id, hi_ttwo_id, three, version, when_created, when_modified) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.hi_ttwo_id, OLD.three, OLD.version, OLD.when_created, OLD.when_modified); + NEW.sys_period = tstzrange(upperTs,null); + return new; + elsif (TG_OP = 'DELETE') then + insert into hi_tthree_history (sys_period,id, hi_ttwo_id, three, version, when_created, when_modified) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.hi_ttwo_id, OLD.three, OLD.version, OLD.when_created, OLD.when_modified); + return old; + end if; +end; +$$ LANGUAGE plpgsql; + +create trigger hi_tthree_history_upd + before update or delete on hi_tthree + for each row execute procedure hi_tthree_history_version(); + +create or replace function hi_ttwo_history_version() returns trigger as $$ +declare + lowerTs timestamptz; + upperTs timestamptz; +begin + lowerTs = lower(OLD.sys_period); + upperTs = greatest(lowerTs + '1 microsecond',current_timestamp); + if (TG_OP = 'UPDATE') then + insert into hi_ttwo_history (sys_period,id, hi_tone_id, two, version, when_created, when_modified) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.hi_tone_id, OLD.two, OLD.version, OLD.when_created, OLD.when_modified); + NEW.sys_period = tstzrange(upperTs,null); + return new; + elsif (TG_OP = 'DELETE') then + insert into hi_ttwo_history (sys_period,id, hi_tone_id, two, version, when_created, when_modified) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.hi_tone_id, OLD.two, OLD.version, OLD.when_created, OLD.when_modified); + return old; + end if; +end; +$$ LANGUAGE plpgsql; + +create trigger hi_ttwo_history_upd + before update or delete on hi_ttwo + for each row execute procedure hi_ttwo_history_version(); + +create or replace function hsd_setting_history_version() returns trigger as $$ +declare + lowerTs timestamptz; + upperTs timestamptz; +begin + lowerTs = lower(OLD.sys_period); + upperTs = greatest(lowerTs + '1 microsecond',current_timestamp); + if (TG_OP = 'UPDATE') then + insert into hsd_setting_history (sys_period,id, code, content, user_id, version, when_created, when_modified, deleted) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.code, OLD.content, OLD.user_id, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); + NEW.sys_period = tstzrange(upperTs,null); + return new; + elsif (TG_OP = 'DELETE') then + insert into hsd_setting_history (sys_period,id, code, content, user_id, version, when_created, when_modified, deleted) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.code, OLD.content, OLD.user_id, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); + return old; + end if; +end; +$$ LANGUAGE plpgsql; + +create trigger hsd_setting_history_upd + before update or delete on hsd_setting + for each row execute procedure hsd_setting_history_version(); + +create or replace function hsd_user_history_version() returns trigger as $$ +declare + lowerTs timestamptz; + upperTs timestamptz; +begin + lowerTs = lower(OLD.sys_period); + upperTs = greatest(lowerTs + '1 microsecond',current_timestamp); + if (TG_OP = 'UPDATE') then + insert into hsd_user_history (sys_period,id, name, version, when_created, when_modified, deleted) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.name, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); + NEW.sys_period = tstzrange(upperTs,null); + return new; + elsif (TG_OP = 'DELETE') then + insert into hsd_user_history (sys_period,id, name, version, when_created, when_modified, deleted) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.name, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); + return old; + end if; +end; +$$ LANGUAGE plpgsql; + +create trigger hsd_user_history_upd + before update or delete on hsd_user + for each row execute procedure hsd_user_history_version(); + +create or replace function link_history_version() returns trigger as $$ +declare + lowerTs timestamptz; + upperTs timestamptz; +begin + lowerTs = lower(OLD.sys_period); + upperTs = greatest(lowerTs + '1 microsecond',current_timestamp); + if (TG_OP = 'UPDATE') then + insert into link_history (sys_period,id, name, location, when_publish, link_comment, version, when_created, when_modified, deleted) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.name, OLD.location, OLD.when_publish, OLD.link_comment, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); + NEW.sys_period = tstzrange(upperTs,null); + return new; + elsif (TG_OP = 'DELETE') then + insert into link_history (sys_period,id, name, location, when_publish, link_comment, version, when_created, when_modified, deleted) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.name, OLD.location, OLD.when_publish, OLD.link_comment, OLD.version, OLD.when_created, OLD.when_modified, OLD.deleted); + return old; + end if; +end; +$$ LANGUAGE plpgsql; + +create trigger link_history_upd + before update or delete on link + for each row execute procedure link_history_version(); + +create or replace function c_user_history_version() returns trigger as $$ +declare + lowerTs timestamptz; + upperTs timestamptz; +begin + lowerTs = lower(OLD.sys_period); + upperTs = greatest(lowerTs + '1 microsecond',current_timestamp); + if (TG_OP = 'UPDATE') then + insert into c_user_history (sys_period,id, inactive, name, email, group_id, version, when_created, when_modified) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.inactive, OLD.name, OLD.email, OLD.group_id, OLD.version, OLD.when_created, OLD.when_modified); + NEW.sys_period = tstzrange(upperTs,null); + return new; + elsif (TG_OP = 'DELETE') then + insert into c_user_history (sys_period,id, inactive, name, email, group_id, version, when_created, when_modified) values (tstzrange(lowerTs,upperTs), OLD.id, OLD.inactive, OLD.name, OLD.email, OLD.group_id, OLD.version, OLD.when_created, OLD.when_modified); + return old; + end if; +end; +$$ LANGUAGE plpgsql; + +create trigger c_user_history_upd + before update or delete on c_user + for each row execute procedure c_user_history_version(); + diff --git a/ebean-core/src/test/ddl-review/pg-drop-all.sql b/ebean-core/src/test/ddl-review/pg-drop-all.sql new file mode 100644 index 000000000..e3fbd4432 --- /dev/null +++ b/ebean-core/src/test/ddl-review/pg-drop-all.sql @@ -0,0 +1,1957 @@ +-- Generated by ebean unknown at 2020-08-24T21:02:32.420817Z +alter table if exists bar drop constraint if exists fk_bar_foo_id; +drop index if exists ix_bar_foo_id; + +alter table if exists acl_container_relation drop constraint if exists fk_acl_container_relation_container_id; +drop index if exists ix_acl_container_relation_container_id; + +alter table if exists acl_container_relation drop constraint if exists fk_acl_container_relation_acl_entry_id; +drop index if exists ix_acl_container_relation_acl_entry_id; + +alter table if exists addr drop constraint if exists fk_addr_employee_id; +drop index if exists ix_addr_employee_id; + +alter table if exists o_address drop constraint if exists fk_o_address_country_code; +drop index if exists ix_o_address_country_code; + +alter table if exists album drop constraint if exists fk_album_cover_id; + +alter table if exists animal drop constraint if exists fk_animal_shelter_id; +drop index if exists ix_animal_shelter_id; + +alter table if exists attribute drop constraint if exists fk_attribute_attribute_holder_id; +drop index if exists ix_attribute_attribute_holder_id; + +alter table if exists bbookmark drop constraint if exists fk_bbookmark_user_id; +drop index if exists ix_bbookmark_user_id; + +alter table if exists bbookmark_user drop constraint if exists fk_bbookmark_user_org_id; +drop index if exists ix_bbookmark_user_org_id; + +alter table if exists bsite_user_a drop constraint if exists fk_bsite_user_a_site_id; +drop index if exists ix_bsite_user_a_site_id; + +alter table if exists bsite_user_a drop constraint if exists fk_bsite_user_a_user_id; +drop index if exists ix_bsite_user_a_user_id; + +alter table if exists bsite_user_b drop constraint if exists fk_bsite_user_b_site; +drop index if exists ix_bsite_user_b_site; + +alter table if exists bsite_user_b drop constraint if exists fk_bsite_user_b_usr; +drop index if exists ix_bsite_user_b_usr; + +alter table if exists bsite_user_c drop constraint if exists fk_bsite_user_c_site_uid; +drop index if exists ix_bsite_user_c_site_uid; + +alter table if exists bsite_user_c drop constraint if exists fk_bsite_user_c_user_uid; +drop index if exists ix_bsite_user_c_user_uid; + +alter table if exists bsite_user_e drop constraint if exists fk_bsite_user_e_site_id; +drop index if exists ix_bsite_user_e_site_id; + +alter table if exists bsite_user_e drop constraint if exists fk_bsite_user_e_user_id; +drop index if exists ix_bsite_user_e_user_id; + +alter table if exists basic_draftable_bean drop constraint if exists fk_basic_draftable_bean_id; + +alter table if exists drel_booking drop constraint if exists fk_drel_booking_agent_invoice; + +alter table if exists drel_booking drop constraint if exists fk_drel_booking_client_invoice; + +alter table if exists cepproduct_category drop constraint if exists fk_cepproduct_category_category_id; +drop index if exists ix_cepproduct_category_category_id; + +alter table if exists cepproduct_category drop constraint if exists fk_cepproduct_category_product_id; +drop index if exists ix_cepproduct_category_product_id; + +alter table if exists ciaddress drop constraint if exists fk_ciaddress_street_id; +drop index if exists ix_ciaddress_street_id; + +alter table if exists cicustomer_parent drop constraint if exists fk_cicustomer_parent_address_id; +drop index if exists ix_cicustomer_parent_address_id; + +alter table if exists cinh_ref drop constraint if exists fk_cinh_ref_ref_id; +drop index if exists ix_cinh_ref_ref_id; + +alter table if exists ckey_detail drop constraint if exists fk_ckey_detail_parent; +drop index if exists ix_ckey_detail_parent; + +alter table if exists ckey_parent drop constraint if exists fk_ckey_parent_assoc_id; +drop index if exists ix_ckey_parent_assoc_id; + +alter table if exists coone_many drop constraint if exists fk_coone_many_coone_id; +drop index if exists ix_coone_many_coone_id; + +alter table if exists coroot drop constraint if exists fk_coroot_one_id; + +alter table if exists calculation_result drop constraint if exists fk_calculation_result_product_configuration_id; +drop index if exists ix_calculation_result_product_configuration_id; + +alter table if exists calculation_result drop constraint if exists fk_calculation_result_group_configuration_id; +drop index if exists ix_calculation_result_group_configuration_id; + +alter table if exists sp_car_car_wheels drop constraint if exists fk_sp_car_car_wheels_sp_car_car; +drop index if exists ix_sp_car_car_wheels_sp_car_car; + +alter table if exists sp_car_car_wheels drop constraint if exists fk_sp_car_car_wheels_sp_car_wheel; +drop index if exists ix_sp_car_car_wheels_sp_car_wheel; + +alter table if exists sp_car_car_doors drop constraint if exists fk_sp_car_car_doors_sp_car_car; +drop index if exists ix_sp_car_car_doors_sp_car_car; + +alter table if exists sp_car_car_doors drop constraint if exists fk_sp_car_car_doors_sp_car_door; +drop index if exists ix_sp_car_car_doors_sp_car_door; + +alter table if exists car_accessory drop constraint if exists fk_car_accessory_fuse_id; +drop index if exists ix_car_accessory_fuse_id; + +alter table if exists car_accessory drop constraint if exists fk_car_accessory_car_id; +drop index if exists ix_car_accessory_car_id; + +alter table if exists category drop constraint if exists fk_category_surveyobjectid; +drop index if exists ix_category_surveyobjectid; + +alter table if exists e_save_test_d drop constraint if exists fk_e_save_test_d_parent_id; + +alter table if exists child_person drop constraint if exists fk_child_person_some_bean_id; +drop index if exists ix_child_person_some_bean_id; + +alter table if exists child_person drop constraint if exists fk_child_person_parent_identifier; +drop index if exists ix_child_person_parent_identifier; + +alter table if exists cke_client drop constraint if exists fk_cke_client_user; +drop index if exists ix_cke_client_user; + +alter table if exists class_super_monkey drop constraint if exists fk_class_super_monkey_class_super; + +alter table if exists class_super_monkey drop constraint if exists fk_class_super_monkey_monkey; + +alter table if exists configuration drop constraint if exists fk_configuration_configurations_id; +drop index if exists ix_configuration_configurations_id; + +alter table if exists contact drop constraint if exists fk_contact_customer_id; +drop index if exists ix_contact_customer_id; + +alter table if exists contact drop constraint if exists fk_contact_group_id; +drop index if exists ix_contact_group_id; + +alter table if exists contact_note drop constraint if exists fk_contact_note_contact_id; +drop index if exists ix_contact_note_contact_id; + +alter table if exists contract_costs drop constraint if exists fk_contract_costs_position_id; +drop index if exists ix_contract_costs_position_id; + +alter table if exists c_conversation drop constraint if exists fk_c_conversation_group_id; +drop index if exists ix_c_conversation_group_id; + +alter table if exists o_customer drop constraint if exists fk_o_customer_billing_address_id; +drop index if exists ix_o_customer_billing_address_id; + +alter table if exists o_customer drop constraint if exists fk_o_customer_shipping_address_id; +drop index if exists ix_o_customer_shipping_address_id; + +alter table if exists dcredit_drol drop constraint if exists fk_dcredit_drol_dcredit; +drop index if exists ix_dcredit_drol_dcredit; + +alter table if exists dcredit_drol drop constraint if exists fk_dcredit_drol_drol; +drop index if exists ix_dcredit_drol_drol; + +alter table if exists dmachine drop constraint if exists fk_dmachine_organisation_id; +drop index if exists ix_dmachine_organisation_id; + +alter table if exists d_machine_aux_use drop constraint if exists fk_d_machine_aux_use_machine_id; +drop index if exists ix_d_machine_aux_use_machine_id; + +alter table if exists d_machine_stats drop constraint if exists fk_d_machine_stats_machine_id; +drop index if exists ix_d_machine_stats_machine_id; + +alter table if exists d_machine_use drop constraint if exists fk_d_machine_use_machine_id; +drop index if exists ix_d_machine_use_machine_id; + +alter table if exists drot_drol drop constraint if exists fk_drot_drol_drot; +drop index if exists ix_drot_drol_drot; + +alter table if exists drot_drol drop constraint if exists fk_drot_drol_drol; +drop index if exists ix_drot_drol_drol; + +alter table if exists dc_detail drop constraint if exists fk_dc_detail_master_id; +drop index if exists ix_dc_detail_master_id; + +alter table if exists defaults_model drop constraint if exists fk_defaults_model_id; + +alter table if exists dfk_cascade drop constraint if exists fk_dfk_cascade_one_id; +drop index if exists ix_dfk_cascade_one_id; + +alter table if exists dfk_set_null drop constraint if exists fk_dfk_set_null_one_id; +drop index if exists ix_dfk_set_null_one_id; + +alter table if exists doc drop constraint if exists fk_doc_id; + +alter table if exists doc_link drop constraint if exists fk_doc_link_doc; +drop index if exists ix_doc_link_doc; + +alter table if exists doc_link drop constraint if exists fk_doc_link_link; +drop index if exists ix_doc_link_link; + +alter table if exists document drop constraint if exists fk_document_id; + +alter table if exists document drop constraint if exists fk_document_organisation_id; +drop index if exists ix_document_organisation_id; + +alter table if exists document_draft drop constraint if exists fk_document_draft_organisation_id; +drop index if exists ix_document_draft_organisation_id; + +alter table if exists document_media drop constraint if exists fk_document_media_document_id; +drop index if exists ix_document_media_document_id; + +alter table if exists document_media_draft drop constraint if exists fk_document_media_draft_document_id; +drop index if exists ix_document_media_draft_document_id; + +alter table if exists e_basicenc_relate drop constraint if exists fk_e_basicenc_relate_other_id; +drop index if exists ix_e_basicenc_relate_other_id; + +alter table if exists ebasic_json_map_detail drop constraint if exists fk_ebasic_json_map_detail_owner_id; +drop index if exists ix_ebasic_json_map_detail_owner_id; + +alter table if exists ebasic_no_sdchild drop constraint if exists fk_ebasic_no_sdchild_owner_id; +drop index if exists ix_ebasic_no_sdchild_owner_id; + +alter table if exists ebasic_sdchild drop constraint if exists fk_ebasic_sdchild_owner_id; +drop index if exists ix_ebasic_sdchild_owner_id; + +alter table if exists ecache_child drop constraint if exists fk_ecache_child_root_id; +drop index if exists ix_ecache_child_root_id; + +alter table if exists edefault_prop drop constraint if exists fk_edefault_prop_e_simple_usertypeid; + +alter table if exists eemb_inner drop constraint if exists fk_eemb_inner_outer_id; +drop index if exists ix_eemb_inner_outer_id; + +alter table if exists einvoice drop constraint if exists fk_einvoice_person_id; +drop index if exists ix_einvoice_person_id; + +alter table if exists enull_collection_detail drop constraint if exists fk_enull_collection_detail_enull_collection_id; +drop index if exists ix_enull_collection_detail_enull_collection_id; + +alter table if exists eopt_one_a drop constraint if exists fk_eopt_one_a_b_id; +drop index if exists ix_eopt_one_a_b_id; + +alter table if exists eopt_one_b drop constraint if exists fk_eopt_one_b_c_id; +drop index if exists ix_eopt_one_b_c_id; + +alter table if exists eper_addr drop constraint if exists fk_eper_addr_ma_country_code; +drop index if exists ix_eper_addr_ma_country_code; + +alter table if exists esoft_del_book drop constraint if exists fk_esoft_del_book_lend_by_id; +drop index if exists ix_esoft_del_book_lend_by_id; + +alter table if exists esoft_del_book_esoft_del_user drop constraint if exists fk_esoft_del_book_esoft_del_user_esoft_del_book; +drop index if exists ix_esoft_del_book_esoft_del_user_esoft_del_book; + +alter table if exists esoft_del_book_esoft_del_user drop constraint if exists fk_esoft_del_book_esoft_del_user_esoft_del_user; +drop index if exists ix_esoft_del_book_esoft_del_user_esoft_del_user; + +alter table if exists esoft_del_down drop constraint if exists fk_esoft_del_down_esoft_del_mid_id; +drop index if exists ix_esoft_del_down_esoft_del_mid_id; + +alter table if exists esoft_del_mid drop constraint if exists fk_esoft_del_mid_top_id; +drop index if exists ix_esoft_del_mid_top_id; + +alter table if exists esoft_del_mid drop constraint if exists fk_esoft_del_mid_up_id; +drop index if exists ix_esoft_del_mid_up_id; + +alter table if exists esoft_del_one_a drop constraint if exists fk_esoft_del_one_a_oneb_id; + +alter table if exists esoft_del_role_esoft_del_user drop constraint if exists fk_esoft_del_role_esoft_del_user_esoft_del_role; +drop index if exists ix_esoft_del_role_esoft_del_user_esoft_del_role; + +alter table if exists esoft_del_role_esoft_del_user drop constraint if exists fk_esoft_del_role_esoft_del_user_esoft_del_user; +drop index if exists ix_esoft_del_role_esoft_del_user_esoft_del_user; + +alter table if exists esoft_del_user_esoft_del_role drop constraint if exists fk_esoft_del_user_esoft_del_role_esoft_del_user; +drop index if exists ix_esoft_del_user_esoft_del_role_esoft_del_user; + +alter table if exists esoft_del_user_esoft_del_role drop constraint if exists fk_esoft_del_user_esoft_del_role_esoft_del_role; +drop index if exists ix_esoft_del_user_esoft_del_role_esoft_del_role; + +alter table if exists rawinherit_uncle drop constraint if exists fk_rawinherit_uncle_parent_id; +drop index if exists ix_rawinherit_uncle_parent_id; + +alter table if exists evanilla_collection_detail drop constraint if exists fk_evanilla_collection_detail_evanilla_collection_id; +drop index if exists ix_evanilla_collection_detail_evanilla_collection_id; + +alter table if exists ec_enum_person_tags drop constraint if exists fk_ec_enum_person_tags_ec_enum_person_id; +drop index if exists ix_ec_enum_person_tags_ec_enum_person_id; + +alter table if exists ec_person_phone drop constraint if exists fk_ec_person_phone_owner_id; +drop index if exists ix_ec_person_phone_owner_id; + +alter table if exists ec_top drop constraint if exists fk_ec_top_person_id; +drop index if exists ix_ec_top_person_id; + +alter table if exists ec_top_ecs_person drop constraint if exists fk_ec_top_ecs_person_ec_top; +drop index if exists ix_ec_top_ecs_person_ec_top; + +alter table if exists ec_top_ecs_person drop constraint if exists fk_ec_top_ecs_person_ecs_person; +drop index if exists ix_ec_top_ecs_person_ecs_person; + +alter table if exists ecbl_person_phone_numbers drop constraint if exists fk_ecbl_person_phone_numbers_person_id; +drop index if exists ix_ecbl_person_phone_numbers_person_id; + +alter table if exists ecbm_person_phone_numbers drop constraint if exists fk_ecbm_person_phone_numbers_person_id; +drop index if exists ix_ecbm_person_phone_numbers_person_id; + +alter table if exists ecm_person_phone_numbers drop constraint if exists fk_ecm_person_phone_numbers_ecm_person_id; +drop index if exists ix_ecm_person_phone_numbers_ecm_person_id; + +alter table if exists ecmc_person_phone_numbers drop constraint if exists fk_ecmc_person_phone_numbers_ecmc_person_id; +drop index if exists ix_ecmc_person_phone_numbers_ecmc_person_id; + +alter table if exists ecs_person_phone drop constraint if exists fk_ecs_person_phone_ecs_person_id; +drop index if exists ix_ecs_person_phone_ecs_person_id; + +alter table if exists ecsm_child drop constraint if exists fk_ecsm_child_ecsm_parent_id; +drop index if exists ix_ecsm_child_ecsm_parent_id; + +alter table if exists td_child drop constraint if exists fk_td_child_parent_id; +drop index if exists ix_td_child_parent_id; + +alter table if exists element_bean drop constraint if exists fk_element_bean_complex_bean_id; +drop index if exists ix_element_bean_complex_bean_id; + +alter table if exists empl drop constraint if exists fk_empl_default_address_id; +drop index if exists ix_empl_default_address_id; + +alter table if exists esd_detail drop constraint if exists fk_esd_detail_master_id; +drop index if exists ix_esd_detail_master_id; + +alter table if exists grand_parent_person drop constraint if exists fk_grand_parent_person_some_bean_id; +drop index if exists ix_grand_parent_person_some_bean_id; + +alter table if exists survey_group drop constraint if exists fk_survey_group_categoryobjectid; +drop index if exists ix_survey_group_categoryobjectid; + +alter table if exists hx_link_doc drop constraint if exists fk_hx_link_doc_hx_link; +drop index if exists ix_hx_link_doc_hx_link; + +alter table if exists hx_link_doc drop constraint if exists fk_hx_link_doc_he_doc; +drop index if exists ix_hx_link_doc_he_doc; + +alter table if exists hi_link_doc drop constraint if exists fk_hi_link_doc_hi_link; +drop index if exists ix_hi_link_doc_hi_link; + +alter table if exists hi_link_doc drop constraint if exists fk_hi_link_doc_hi_doc; +drop index if exists ix_hi_link_doc_hi_doc; + +alter table if exists hi_tthree drop constraint if exists fk_hi_tthree_hi_ttwo_id; +drop index if exists ix_hi_tthree_hi_ttwo_id; + +alter table if exists hi_ttwo drop constraint if exists fk_hi_ttwo_hi_tone_id; +drop index if exists ix_hi_ttwo_hi_tone_id; + +alter table if exists hsd_setting drop constraint if exists fk_hsd_setting_user_id; + +alter table if exists iaf_segment drop constraint if exists fk_iaf_segment_status_id; +drop index if exists ix_iaf_segment_status_id; + +alter table if exists imrelated drop constraint if exists fk_imrelated_owner_id; +drop index if exists ix_imrelated_owner_id; + +alter table if exists info_contact drop constraint if exists fk_info_contact_company_id; +drop index if exists ix_info_contact_company_id; + +alter table if exists info_customer drop constraint if exists fk_info_customer_company_id; + +alter table if exists inner_report drop constraint if exists fk_inner_report_forecast_id; + +alter table if exists drel_invoice drop constraint if exists fk_drel_invoice_booking; +drop index if exists ix_drel_invoice_booking; + +alter table if exists item drop constraint if exists fk_item_etype; +drop index if exists ix_item_etype; + +alter table if exists item drop constraint if exists fk_item_eregion; +drop index if exists ix_item_eregion; + +alter table if exists mkeygroup_monkey drop constraint if exists fk_mkeygroup_monkey_mkeygroup; + +alter table if exists mkeygroup_monkey drop constraint if exists fk_mkeygroup_monkey_monkey; + +alter table if exists trainer_monkey drop constraint if exists fk_trainer_monkey_trainer; + +alter table if exists trainer_monkey drop constraint if exists fk_trainer_monkey_monkey; + +alter table if exists troop_monkey drop constraint if exists fk_troop_monkey_troop; + +alter table if exists troop_monkey drop constraint if exists fk_troop_monkey_monkey; + +alter table if exists l2_cldf_reset_bean_child drop constraint if exists fk_l2_cldf_reset_bean_child_parent_id; +drop index if exists ix_l2_cldf_reset_bean_child_parent_id; + +alter table if exists level1_level4 drop constraint if exists fk_level1_level4_level1; +drop index if exists ix_level1_level4_level1; + +alter table if exists level1_level4 drop constraint if exists fk_level1_level4_level4; +drop index if exists ix_level1_level4_level4; + +alter table if exists level1_level2 drop constraint if exists fk_level1_level2_level1; +drop index if exists ix_level1_level2_level1; + +alter table if exists level1_level2 drop constraint if exists fk_level1_level2_level2; +drop index if exists ix_level1_level2_level2; + +alter table if exists level2_level3 drop constraint if exists fk_level2_level3_level2; +drop index if exists ix_level2_level3_level2; + +alter table if exists level2_level3 drop constraint if exists fk_level2_level3_level3; +drop index if exists ix_level2_level3_level3; + +alter table if exists link drop constraint if exists fk_link_id; + +alter table if exists la_attr_value_attribute drop constraint if exists fk_la_attr_value_attribute_la_attr_value; +drop index if exists ix_la_attr_value_attribute_la_attr_value; + +alter table if exists la_attr_value_attribute drop constraint if exists fk_la_attr_value_attribute_attribute; +drop index if exists ix_la_attr_value_attribute_attribute; + +alter table if exists looney drop constraint if exists fk_looney_tune_id; +drop index if exists ix_looney_tune_id; + +alter table if exists mcontact drop constraint if exists fk_mcontact_customer_id; +drop index if exists ix_mcontact_customer_id; + +alter table if exists mcontact_message drop constraint if exists fk_mcontact_message_contact_id; +drop index if exists ix_mcontact_message_contact_id; + +alter table if exists mcustomer drop constraint if exists fk_mcustomer_shipping_address_id; +drop index if exists ix_mcustomer_shipping_address_id; + +alter table if exists mcustomer drop constraint if exists fk_mcustomer_billing_address_id; +drop index if exists ix_mcustomer_billing_address_id; + +alter table if exists mmachine_mgroup drop constraint if exists fk_mmachine_mgroup_mmachine; +drop index if exists ix_mmachine_mgroup_mmachine; + +alter table if exists mmachine_mgroup drop constraint if exists fk_mmachine_mgroup_mgroup; +drop index if exists ix_mmachine_mgroup_mgroup; + +alter table if exists mprinter drop constraint if exists fk_mprinter_current_state_id; +drop index if exists ix_mprinter_current_state_id; + +alter table if exists mprinter drop constraint if exists fk_mprinter_last_swap_cyan_id; + +alter table if exists mprinter drop constraint if exists fk_mprinter_last_swap_magenta_id; + +alter table if exists mprinter drop constraint if exists fk_mprinter_last_swap_yellow_id; + +alter table if exists mprinter drop constraint if exists fk_mprinter_last_swap_black_id; + +alter table if exists mprinter_state drop constraint if exists fk_mprinter_state_printer_id; +drop index if exists ix_mprinter_state_printer_id; + +alter table if exists mprofile drop constraint if exists fk_mprofile_picture_id; +drop index if exists ix_mprofile_picture_id; + +alter table if exists mrole_muser drop constraint if exists fk_mrole_muser_mrole; +drop index if exists ix_mrole_muser_mrole; + +alter table if exists mrole_muser drop constraint if exists fk_mrole_muser_muser; +drop index if exists ix_mrole_muser_muser; + +alter table if exists muser drop constraint if exists fk_muser_user_type_id; +drop index if exists ix_muser_user_type_id; + +alter table if exists mail_user_inbox drop constraint if exists fk_mail_user_inbox_mail_user; +drop index if exists ix_mail_user_inbox_mail_user; + +alter table if exists mail_user_inbox drop constraint if exists fk_mail_user_inbox_mail_box; +drop index if exists ix_mail_user_inbox_mail_box; + +alter table if exists mail_user_outbox drop constraint if exists fk_mail_user_outbox_mail_user; +drop index if exists ix_mail_user_outbox_mail_user; + +alter table if exists mail_user_outbox drop constraint if exists fk_mail_user_outbox_mail_box; +drop index if exists ix_mail_user_outbox_mail_box; + +alter table if exists c_message drop constraint if exists fk_c_message_conversation_id; +drop index if exists ix_c_message_conversation_id; + +alter table if exists c_message drop constraint if exists fk_c_message_user_id; +drop index if exists ix_c_message_user_id; + +alter table if exists meter_contract_data drop constraint if exists fk_meter_contract_data_special_needs_client_id; + +alter table if exists meter_special_needs_client drop constraint if exists fk_meter_special_needs_client_primary_id; + +alter table if exists meter_version drop constraint if exists fk_meter_version_address_data_id; + +alter table if exists meter_version drop constraint if exists fk_meter_version_contract_data_id; + +alter table if exists mnoc_user_mnoc_role drop constraint if exists fk_mnoc_user_mnoc_role_mnoc_user; +drop index if exists ix_mnoc_user_mnoc_role_mnoc_user; + +alter table if exists mnoc_user_mnoc_role drop constraint if exists fk_mnoc_user_mnoc_role_mnoc_role; +drop index if exists ix_mnoc_user_mnoc_role_mnoc_role; + +alter table if exists mny_b drop constraint if exists fk_mny_b_a_id; +drop index if exists ix_mny_b_a_id; + +alter table if exists mny_b_mny_c drop constraint if exists fk_mny_b_mny_c_mny_b; +drop index if exists ix_mny_b_mny_c_mny_b; + +alter table if exists mny_b_mny_c drop constraint if exists fk_mny_b_mny_c_mny_c; +drop index if exists ix_mny_b_mny_c_mny_c; + +alter table if exists subtopics drop constraint if exists fk_subtopics_mny_topic_1; +drop index if exists ix_subtopics_mny_topic_1; + +alter table if exists subtopics drop constraint if exists fk_subtopics_mny_topic_2; +drop index if exists ix_subtopics_mny_topic_2; + +alter table if exists mp_role drop constraint if exists fk_mp_role_mp_user_id; +drop index if exists ix_mp_role_mp_user_id; + +alter table if exists ms_many_a_many_b drop constraint if exists fk_ms_many_a_many_b_ms_many_a; +drop index if exists ix_ms_many_a_many_b_ms_many_a; + +alter table if exists ms_many_a_many_b drop constraint if exists fk_ms_many_a_many_b_ms_many_b; +drop index if exists ix_ms_many_a_many_b_ms_many_b; + +alter table if exists ms_many_b_many_a drop constraint if exists fk_ms_many_b_many_a_ms_many_b; +drop index if exists ix_ms_many_b_many_a_ms_many_b; + +alter table if exists ms_many_b_many_a drop constraint if exists fk_ms_many_b_many_a_ms_many_a; +drop index if exists ix_ms_many_b_many_a_ms_many_a; + +alter table if exists my_lob_size_join_many drop constraint if exists fk_my_lob_size_join_many_parent_id; +drop index if exists ix_my_lob_size_join_many_parent_id; + +alter table if exists o_bean_child drop constraint if exists fk_o_bean_child_cached_bean_id; +drop index if exists ix_o_bean_child_cached_bean_id; + +alter table if exists ocached_app_detail drop constraint if exists fk_ocached_app_detail_app_id; +drop index if exists ix_ocached_app_detail_app_id; + +alter table if exists o_cached_bean_country drop constraint if exists fk_o_cached_bean_country_o_cached_bean; +drop index if exists ix_o_cached_bean_country_o_cached_bean; + +alter table if exists o_cached_bean_country drop constraint if exists fk_o_cached_bean_country_o_country; +drop index if exists ix_o_cached_bean_country_o_country; + +alter table if exists o_cached_bean_child drop constraint if exists fk_o_cached_bean_child_cached_bean_id; +drop index if exists ix_o_cached_bean_child_cached_bean_id; + +alter table if exists oengine drop constraint if exists fk_oengine_car_id; + +alter table if exists ogear_box drop constraint if exists fk_ogear_box_car_id; + +alter table if exists omvertex_other drop constraint if exists fk_omvertex_other_omvertex_id; +drop index if exists ix_omvertex_other_omvertex_id; + +alter table if exists oroad_show_msg drop constraint if exists fk_oroad_show_msg_company_id; + +alter table if exists om_account_child_dbo drop constraint if exists fk_om_account_child_dbo_banana_rama_id; +drop index if exists ix_om_account_child_dbo_banana_rama_id; + +alter table if exists om_basic_child drop constraint if exists fk_om_basic_child_parent_id; +drop index if exists ix_om_basic_child_parent_id; + +alter table if exists om_ordered_detail drop constraint if exists fk_om_ordered_detail_master_id; +drop index if exists ix_om_ordered_detail_master_id; + +alter table if exists oml_baz drop constraint if exists fk_oml_baz_foo_id; +drop index if exists ix_oml_baz_foo_id; + +alter table if exists oml_foo drop constraint if exists fk_oml_foo_bar_id; +drop index if exists ix_oml_foo_bar_id; + +alter table if exists o_order drop constraint if exists fk_o_order_kcustomer_id; +drop index if exists ix_o_order_kcustomer_id; + +alter table if exists o_order_detail drop constraint if exists fk_o_order_detail_order_id; +drop index if exists ix_o_order_detail_order_id; + +alter table if exists o_order_detail drop constraint if exists fk_o_order_detail_product_id; +drop index if exists ix_o_order_detail_product_id; + +alter table if exists s_order_items drop constraint if exists fk_s_order_items_order_uuid; +drop index if exists ix_s_order_items_order_uuid; + +alter table if exists order_referenced_parent drop constraint if exists fk_order_referenced_parent_master_id; +drop index if exists ix_order_referenced_parent_master_id; + +alter table if exists or_order_ship drop constraint if exists fk_or_order_ship_order_id; +drop index if exists ix_or_order_ship_order_id; + +alter table if exists order_toy drop constraint if exists fk_order_toy_child_id; +drop index if exists ix_order_toy_child_id; + +alter table if exists ordered_parent drop constraint if exists fk_ordered_parent_order_master_inheritance_id; +drop index if exists ix_ordered_parent_order_master_inheritance_id; + +alter table if exists organization_node drop constraint if exists fk_organization_node_parent_tree_node_id; + +alter table if exists orp_detail drop constraint if exists fk_orp_detail_master_id; +drop index if exists ix_orp_detail_master_id; + +alter table if exists orp_detail2 drop constraint if exists fk_orp_detail2_orp_master2_id; +drop index if exists ix_orp_detail2_orp_master2_id; + +alter table if exists oto_atwo drop constraint if exists fk_oto_atwo_aone_id; + +alter table if exists oto_bchild drop constraint if exists fk_oto_bchild_master_id; + +alter table if exists oto_child drop constraint if exists fk_oto_child_master_id; + +alter table if exists oto_cust_address drop constraint if exists fk_oto_cust_address_customer_cid; + +alter table if exists oto_level_a drop constraint if exists fk_oto_level_a_b_id; + +alter table if exists oto_level_b drop constraint if exists fk_oto_level_b_c_id; + +alter table if exists oto_prime_extra drop constraint if exists fk_oto_prime_extra_eid; + +alter table if exists oto_sd_child drop constraint if exists fk_oto_sd_child_master_id; + +alter table if exists oto_th_many drop constraint if exists fk_oto_th_many_oto_th_top_id; +drop index if exists ix_oto_th_many_oto_th_top_id; + +alter table if exists oto_th_one drop constraint if exists fk_oto_th_one_many_id; + +alter table if exists oto_ubprime_extra drop constraint if exists fk_oto_ubprime_extra_eid; + +alter table if exists oto_user_model drop constraint if exists fk_oto_user_model_user_optional_id; + +alter table if exists pfile drop constraint if exists fk_pfile_file_content_id; + +alter table if exists pfile drop constraint if exists fk_pfile_file_content2_id; + +alter table if exists paggview drop constraint if exists fk_paggview_pview_id; + +alter table if exists pallet_location drop constraint if exists fk_pallet_location_zone_sid; +drop index if exists ix_pallet_location_zone_sid; + +alter table if exists parcel_location drop constraint if exists fk_parcel_location_parcelid; + +alter table if exists rawinherit_parent_rawinherit_data drop constraint if exists fk_rawinherit_parent_rawinherit_data_rawinherit_parent; +drop index if exists ix_rawinherit_parent_rawinherit_data_rawinherit_parent; + +alter table if exists rawinherit_parent_rawinherit_data drop constraint if exists fk_rawinherit_parent_rawinherit_data_rawinherit_data; +drop index if exists ix_rawinherit_parent_rawinherit_data_rawinherit_data; + +alter table if exists parent_person drop constraint if exists fk_parent_person_some_bean_id; +drop index if exists ix_parent_person_some_bean_id; + +alter table if exists parent_person drop constraint if exists fk_parent_person_parent_identifier; +drop index if exists ix_parent_person_parent_identifier; + +alter table if exists c_participation drop constraint if exists fk_c_participation_conversation_id; +drop index if exists ix_c_participation_conversation_id; + +alter table if exists c_participation drop constraint if exists fk_c_participation_user_id; +drop index if exists ix_c_participation_user_id; + +alter table if exists pcf_calendar drop constraint if exists fk_pcf_calendar_pcf_person_id; +drop index if exists ix_pcf_calendar_pcf_person_id; + +alter table if exists pcf_city drop constraint if exists fk_pcf_city_pcf_country_id; +drop index if exists ix_pcf_city_pcf_country_id; + +alter table if exists pcf_city drop constraint if exists fk_pcf_city_mayor_id; + +alter table if exists pcf_city drop constraint if exists fk_pcf_city_vice_mayor_id; + +alter table if exists pcf_event drop constraint if exists fk_pcf_event_pcf_calendar_id; +drop index if exists ix_pcf_event_pcf_calendar_id; + +alter table if exists persistent_file_content drop constraint if exists fk_persistent_file_content_persistent_file_id; + +alter table if exists person drop constraint if exists fk_person_default_address_oid; +drop index if exists ix_person_default_address_oid; + +alter table if exists person_cache_email drop constraint if exists fk_person_cache_email_person_info_person_id; +drop index if exists ix_person_cache_email_person_info_person_id; + +alter table if exists phones drop constraint if exists fk_phones_person_id; +drop index if exists ix_phones_person_id; + +alter table if exists e_position drop constraint if exists fk_e_position_contract_id; +drop index if exists ix_e_position_contract_id; + +alter table if exists pp_to_ww drop constraint if exists fk_pp_to_ww_pp; +drop index if exists ix_pp_to_ww_pp; + +alter table if exists pp_to_ww drop constraint if exists fk_pp_to_ww_wview; +drop index if exists ix_pp_to_ww_wview; + +alter table if exists question drop constraint if exists fk_question_groupobjectid; +drop index if exists ix_question_groupobjectid; + +alter table if exists r_orders drop constraint if exists fk_r_orders_customer; +drop index if exists ix_r_orders_customer; + +alter table if exists referenced_defaults_model drop constraint if exists fk_referenced_defaults_model_id; + +alter table if exists referenced_defaults_model drop constraint if exists fk_referenced_defaults_model_defaults_model_id; +drop index if exists ix_referenced_defaults_model_defaults_model_id; + +alter table if exists referenced_defaults_model_draft drop constraint if exists fk_referenced_defaults_model_draft_defaults_model_id; +drop index if exists ix_referenced_defaults_model_draft_defaults_model_id; + +alter table if exists rel_master drop constraint if exists fk_rel_master_detail_id; +drop index if exists ix_rel_master_detail_id; + +alter table if exists resourcefile drop constraint if exists fk_resourcefile_parentresourcefileid; +drop index if exists ix_resourcefile_parentresourcefileid; + +alter table if exists mt_role drop constraint if exists fk_mt_role_tenant_id; +drop index if exists ix_mt_role_tenant_id; + +alter table if exists mt_role_permission drop constraint if exists fk_mt_role_permission_mt_role; +drop index if exists ix_mt_role_permission_mt_role; + +alter table if exists mt_role_permission drop constraint if exists fk_mt_role_permission_mt_permission; +drop index if exists ix_mt_role_permission_mt_permission; + +alter table if exists root_bean drop constraint if exists fk_root_bean_referencing_bean_id; +drop index if exists ix_root_bean_referencing_bean_id; + +alter table if exists f_second drop constraint if exists fk_f_second_first; + +alter table if exists section drop constraint if exists fk_section_article_id; +drop index if exists ix_section_article_id; + +alter table if exists self_parent drop constraint if exists fk_self_parent_parent_id; +drop index if exists ix_self_parent_parent_id; + +alter table if exists self_ref_customer drop constraint if exists fk_self_ref_customer_referred_by_id; +drop index if exists ix_self_ref_customer_referred_by_id; + +alter table if exists self_ref_example drop constraint if exists fk_self_ref_example_parent_id; +drop index if exists ix_self_ref_example_parent_id; + +alter table if exists e_save_test_b drop constraint if exists fk_e_save_test_b_sibling_a_id; + +alter table if exists site drop constraint if exists fk_site_parent_id; +drop index if exists ix_site_parent_id; + +alter table if exists site drop constraint if exists fk_site_data_container_id; + +alter table if exists site drop constraint if exists fk_site_site_address_id; + +alter table if exists source_base drop constraint if exists fk_source_base_target_id; +drop index if exists ix_source_base_target_id; + +alter table if exists stockforecast drop constraint if exists fk_stockforecast_inner_report_id; +drop index if exists ix_stockforecast_inner_report_id; + +alter table if exists sub_section drop constraint if exists fk_sub_section_section_id; +drop index if exists ix_sub_section_section_id; + +alter table if exists tevent_many drop constraint if exists fk_tevent_many_event_id; +drop index if exists ix_tevent_many_event_id; + +alter table if exists tevent_one drop constraint if exists fk_tevent_one_event_id; + +alter table if exists t_detail_with_other_namexxxyy drop constraint if exists fk_t_detail_with_other_namexxxyy_master_id; +drop index if exists ix_t_detail_with_other_namexxxyy_master_id; + +alter table if exists ttruck_holder drop constraint if exists fk_ttruck_holder_truck_plate_no; +drop index if exists ix_ttruck_holder_truck_plate_no; + +alter table if exists ttruck_holder drop constraint if exists fk_ttruck_holder_basic_id; +drop index if exists ix_ttruck_holder_basic_id; + +alter table if exists ttruck_holder_item drop constraint if exists fk_ttruck_holder_item_owner_id; +drop index if exists ix_ttruck_holder_item_owner_id; + +alter table if exists twheel drop constraint if exists fk_twheel_owner_plate_no; +drop index if exists ix_twheel_owner_plate_no; + +alter table if exists tire drop constraint if exists fk_tire_wheel; + +alter table if exists tree_entity drop constraint if exists fk_tree_entity_parent_id; +drop index if exists ix_tree_entity_parent_id; + +alter table if exists trip drop constraint if exists fk_trip_vehicle_driver_id; +drop index if exists ix_trip_vehicle_driver_id; + +alter table if exists trip drop constraint if exists fk_trip_address_id; +drop index if exists ix_trip_address_id; + +alter table if exists "type" drop constraint if exists fk_type_sub_type_id; +drop index if exists ix_type_sub_type_id; + +alter table if exists usib_child drop constraint if exists fk_usib_child_parent_id; +drop index if exists ix_usib_child_parent_id; + +alter table if exists usib_child_sibling drop constraint if exists fk_usib_child_sibling_child_id; + +alter table if exists ut_detail drop constraint if exists fk_ut_detail_utmaster_id; +drop index if exists ix_ut_detail_utmaster_id; + +alter table if exists uutwo drop constraint if exists fk_uutwo_master_id; +drop index if exists ix_uutwo_master_id; + +alter table if exists oto_user drop constraint if exists fk_oto_user_account_id; + +alter table if exists c_user drop constraint if exists fk_c_user_group_id; +drop index if exists ix_c_user_group_id; + +alter table if exists em_user_role drop constraint if exists fk_em_user_role_user_id; +drop index if exists ix_em_user_role_user_id; + +alter table if exists em_user_role drop constraint if exists fk_em_user_role_role_id; +drop index if exists ix_em_user_role_role_id; + +alter table if exists vehicle drop constraint if exists fk_vehicle_lease_id; +drop index if exists ix_vehicle_lease_id; + +alter table if exists vehicle drop constraint if exists fk_vehicle_car_ref_id; +drop index if exists ix_vehicle_car_ref_id; + +alter table if exists vehicle drop constraint if exists fk_vehicle_truck_ref_id; +drop index if exists ix_vehicle_truck_ref_id; + +alter table if exists vehicle_driver drop constraint if exists fk_vehicle_driver_vehicle_id; +drop index if exists ix_vehicle_driver_vehicle_id; + +alter table if exists vehicle_driver drop constraint if exists fk_vehicle_driver_address_id; +drop index if exists ix_vehicle_driver_address_id; + +alter table if exists version_child drop constraint if exists fk_version_child_parent_id; +drop index if exists ix_version_child_parent_id; + +alter table if exists version_toy drop constraint if exists fk_version_toy_child_id; +drop index if exists ix_version_toy_child_id; + +alter table if exists warehouses drop constraint if exists fk_warehouses_officezoneid; +drop index if exists ix_warehouses_officezoneid; + +alter table if exists warehousesshippingzones drop constraint if exists fk_warehousesshippingzones_warehouses; +drop index if exists ix_warehousesshippingzones_warehouses; + +alter table if exists warehousesshippingzones drop constraint if exists fk_warehousesshippingzones_zones; +drop index if exists ix_warehousesshippingzones_zones; + +alter table if exists sa_wheel drop constraint if exists fk_sa_wheel_tire; +drop index if exists ix_sa_wheel_tire; + +alter table if exists sa_wheel drop constraint if exists fk_sa_wheel_car; +drop index if exists ix_sa_wheel_car; + +alter table if exists g_who_props_otm drop constraint if exists fk_g_who_props_otm_who_created_id; +drop index if exists ix_g_who_props_otm_who_created_id; + +alter table if exists g_who_props_otm drop constraint if exists fk_g_who_props_otm_who_modified_id; +drop index if exists ix_g_who_props_otm_who_modified_id; + +alter table if exists with_zero drop constraint if exists fk_with_zero_parent_id; +drop index if exists ix_with_zero_parent_id; + +drop table if exists asimple_bean cascade; + +drop table if exists bar cascade; + +drop table if exists block cascade; + +drop table if exists oto_account cascade; + +drop table if exists acl cascade; + +drop table if exists acl_container_relation cascade; + +drop table if exists addr cascade; + +drop table if exists address cascade; + +drop table if exists o_address cascade; + +drop table if exists album cascade; + +drop table if exists animal cascade; + +drop table if exists animal_shelter cascade; + +drop table if exists article cascade; + +drop table if exists attribute cascade; + +drop table if exists attribute_holder cascade; + +drop table if exists audit_log cascade; + +drop table if exists bbookmark cascade; + +drop table if exists bbookmark_org cascade; + +drop table if exists bbookmark_user cascade; + +drop table if exists bsimple_with_gen cascade; + +drop table if exists bsite cascade; + +drop table if exists bsite_user_a cascade; + +drop table if exists bsite_user_b cascade; + +drop table if exists bsite_user_c cascade; + +drop table if exists bsite_user_d cascade; + +drop table if exists bsite_user_e cascade; + +drop table if exists buser cascade; + +drop table if exists bwith_qident cascade; + +drop table if exists basic_draftable_bean cascade; + +drop table if exists basic_draftable_bean_draft cascade; + +drop table if exists basic_joda_entity cascade; + +drop table if exists bean_with_time_zone cascade; + +drop table if exists drel_booking cascade; +drop sequence if exists drel_booking_seq; + +drop table if exists bw_bean cascade; + +drop table if exists cepcategory cascade; + +drop table if exists cepproduct cascade; + +drop table if exists cepproduct_category cascade; + +drop table if exists ciaddress cascade; + +drop table if exists cicustomer_parent cascade; + +drop table if exists cistreet_parent cascade; + +drop table if exists cinh_ref cascade; + +drop table if exists cinh_root cascade; + +drop table if exists ckey_assoc cascade; + +drop table if exists ckey_detail cascade; + +drop table if exists ckey_parent cascade; + +drop table if exists coone cascade; + +drop table if exists coone_many cascade; + +drop table if exists coroot cascade; + +drop table if exists calculation_result cascade; + +drop table if exists cao_bean cascade; + +drop table if exists sp_car_car cascade; +drop sequence if exists sp_car_car_seq; + +drop table if exists sp_car_car_wheels cascade; + +drop table if exists sp_car_car_doors cascade; + +drop table if exists sa_car cascade; +drop sequence if exists sa_car_seq; + +drop table if exists car_accessory cascade; + +drop table if exists car_fuse cascade; + +drop table if exists category cascade; + +drop table if exists e_save_test_d cascade; + +drop table if exists child_person cascade; + +drop table if exists cke_client cascade; + +drop table if exists cke_user cascade; + +drop table if exists class_super cascade; + +drop table if exists class_super_monkey cascade; + +drop table if exists configuration cascade; + +drop table if exists configurations cascade; + +drop table if exists contact cascade; + +drop table if exists contact_group cascade; + +drop table if exists contact_note cascade; + +drop table if exists contract cascade; + +drop table if exists contract_costs cascade; + +drop table if exists c_conversation cascade; + +drop table if exists o_country cascade; + +drop table if exists cover cascade; + +drop table if exists o_customer cascade; + +drop table if exists dcredit cascade; + +drop table if exists dcredit_drol cascade; + +drop table if exists dexh_entity cascade; + +drop table if exists dint_parent cascade; + +drop table if exists dmachine cascade; + +drop table if exists d_machine_aux_use cascade; + +drop table if exists d_machine_stats cascade; + +drop table if exists d_machine_use cascade; + +drop table if exists dorg cascade; + +drop table if exists dperson cascade; + +drop table if exists drol cascade; + +drop table if exists drot cascade; + +drop table if exists drot_drol cascade; + +drop table if exists rawinherit_data cascade; + +drop table if exists data_container cascade; + +drop table if exists dc_detail cascade; + +drop table if exists dc_master cascade; + +drop table if exists defaults_model cascade; + +drop table if exists defaults_model_draft cascade; + +drop table if exists dfk_cascade cascade; + +drop table if exists dfk_cascade_one cascade; + +drop table if exists dfk_none cascade; + +drop table if exists dfk_none_via_join cascade; + +drop table if exists dfk_none_via_mto_m cascade; + +drop table if exists dfk_none_via_mto_m_dfk_one cascade; + +drop table if exists dfk_one cascade; + +drop table if exists dfk_set_null cascade; + +drop table if exists doc cascade; + +drop table if exists doc_link cascade; + +drop table if exists doc_link_draft cascade; + +drop table if exists doc_draft cascade; + +drop table if exists document cascade; + +drop table if exists document_draft cascade; + +drop table if exists document_media cascade; + +drop table if exists document_media_draft cascade; + +drop table if exists sp_car_door cascade; +drop sequence if exists sp_car_door_seq; + +drop table if exists earray_bean cascade; + +drop table if exists earray_set_bean cascade; + +drop table if exists e_basic cascade; + +drop table if exists ebasic_change_log cascade; + +drop table if exists ebasic_clob cascade; + +drop table if exists ebasic_clob_fetch_eager cascade; + +drop table if exists ebasic_clob_no_ver cascade; + +drop table if exists e_basicenc cascade; + +drop table if exists e_basicenc_bin cascade; + +drop table if exists e_basicenc_client cascade; + +drop table if exists e_basicenc_relate cascade; + +drop table if exists e_basic_enum_id cascade; + +drop table if exists e_basic_eni cascade; + +drop table if exists ebasic_hstore cascade; + +drop table if exists ebasic_json_jackson cascade; + +drop table if exists ebasic_json_jackson2 cascade; + +drop table if exists ebasic_json_list cascade; + +drop table if exists ebasic_json_map cascade; + +drop table if exists ebasic_json_map_blob cascade; + +drop table if exists ebasic_json_map_clob cascade; + +drop table if exists ebasic_json_map_detail cascade; + +drop table if exists ebasic_json_map_json_b cascade; + +drop table if exists ebasic_json_map_varchar cascade; + +drop table if exists ebasic_json_node cascade; + +drop table if exists ebasic_json_node_blob cascade; + +drop table if exists ebasic_json_node_json_b cascade; + +drop table if exists ebasic_json_node_varchar cascade; + +drop table if exists ebasic_json_unmapped cascade; + +drop table if exists e_basic_ndc cascade; + +drop table if exists ebasic_no_sdchild cascade; + +drop table if exists ebasic_sdchild cascade; + +drop table if exists ebasic_soft_delete cascade; + +drop table if exists e_basicver cascade; + +drop table if exists e_basic_withlife cascade; + +drop table if exists e_basic_with_ex cascade; + +drop table if exists e_basicverucon cascade; + +drop table if exists ecache_child cascade; + +drop table if exists ecache_root cascade; + +drop table if exists e_col_ab cascade; + +drop table if exists ecustom_id cascade; + +drop table if exists edefault_prop cascade; + +drop table if exists eemb_inner cascade; + +drop table if exists eemb_outer cascade; + +drop table if exists efile2_no_fk cascade; + +drop table if exists efile_no_fk cascade; + +drop table if exists efile_no_fk_euser_no_fk cascade; + +drop table if exists efile_no_fk_euser_no_fk_soft_del cascade; + +drop table if exists egen_props cascade; + +drop table if exists eid_uid_bean cascade; + +drop table if exists einvoice cascade; + +drop table if exists e_main cascade; + +drop table if exists enull_collection cascade; + +drop table if exists enull_collection_detail cascade; + +drop table if exists eopt_one_a cascade; + +drop table if exists eopt_one_b cascade; + +drop table if exists eopt_one_c cascade; + +drop table if exists eper_addr cascade; + +drop table if exists eperson cascade; + +drop table if exists e_person_online cascade; + +drop table if exists esimple cascade; + +drop table if exists esoft_del_book cascade; + +drop table if exists esoft_del_book_esoft_del_user cascade; + +drop table if exists esoft_del_down cascade; + +drop table if exists esoft_del_mid cascade; + +drop table if exists esoft_del_one_a cascade; + +drop table if exists esoft_del_one_b cascade; + +drop table if exists esoft_del_role cascade; + +drop table if exists esoft_del_role_esoft_del_user cascade; + +drop table if exists esoft_del_top cascade; + +drop table if exists esoft_del_up cascade; + +drop table if exists esoft_del_user cascade; + +drop table if exists esoft_del_user_esoft_del_role cascade; + +drop table if exists esome_convert_type cascade; + +drop table if exists esome_type cascade; + +drop table if exists etrans_many cascade; + +drop table if exists rawinherit_uncle cascade; + +drop table if exists euser_no_fk cascade; + +drop table if exists euser_no_fk_soft_del cascade; + +drop table if exists evanilla_collection cascade; + +drop table if exists evanilla_collection_detail cascade; + +drop table if exists ewho_props cascade; + +drop table if exists e_withinet cascade; + +drop table if exists ec_enum_person cascade; + +drop table if exists ec_enum_person_tags cascade; + +drop table if exists ec_person cascade; + +drop table if exists ec_person_phone cascade; + +drop table if exists ec_top cascade; + +drop table if exists ec_top_ecs_person cascade; + +drop table if exists ecbl_person cascade; + +drop table if exists ecbl_person_phone_numbers cascade; + +drop table if exists ecbm_person cascade; + +drop table if exists ecbm_person_phone_numbers cascade; + +drop table if exists ecm_person cascade; + +drop table if exists ecm_person_phone_numbers cascade; + +drop table if exists ecmc_person cascade; + +drop table if exists ecmc_person_phone_numbers cascade; + +drop table if exists ecs_person cascade; + +drop table if exists ecs_person_phone cascade; + +drop table if exists ecsm_child cascade; + +drop table if exists ecsm_values cascade; + +drop table if exists ecsm_one cascade; + +drop table if exists ecsm_parent cascade; + +drop table if exists ecsm_two cascade; + +drop table if exists td_child cascade; + +drop table if exists td_parent cascade; + +drop table if exists element_bean cascade; + +drop table if exists empl cascade; + +drop table if exists esd_detail cascade; + +drop table if exists esd_master cascade; + +drop table if exists feature_desc cascade; + +drop table if exists f_first cascade; + +drop table if exists foo cascade; + +drop table if exists gen_key_identity cascade; + +drop table if exists gen_key_sequence cascade; +drop sequence if exists SEQ_NAME; + +drop table if exists grand_parent_person cascade; + +drop table if exists survey_group cascade; + +drop table if exists c_group cascade; + +drop table if exists he_doc cascade; + +drop trigger if exists hx_link_history_upd on hx_link cascade; +drop function if exists hx_link_history_version(); + +drop view hx_link_with_history; +alter table hx_link drop column sys_period; +drop table hx_link_history; + +drop table if exists hx_link cascade; + +drop table if exists hx_link_doc cascade; + +drop table if exists hi_doc cascade; + +drop trigger if exists hi_link_history_upd on hi_link cascade; +drop function if exists hi_link_history_version(); + +drop view hi_link_with_history; +alter table hi_link drop column sys_period; +drop table hi_link_history; + +drop table if exists hi_link cascade; + +drop trigger if exists hi_link_doc_history_upd on hi_link_doc cascade; +drop function if exists hi_link_doc_history_version(); + +drop view hi_link_doc_with_history; +alter table hi_link_doc drop column sys_period; +drop table hi_link_doc_history; + +drop table if exists hi_link_doc cascade; + +drop trigger if exists hi_tone_history_upd on hi_tone cascade; +drop function if exists hi_tone_history_version(); + +drop view hi_tone_with_history; +alter table hi_tone drop column sys_period; +drop table hi_tone_history; + +drop table if exists hi_tone cascade; + +drop trigger if exists hi_tthree_history_upd on hi_tthree cascade; +drop function if exists hi_tthree_history_version(); + +drop view hi_tthree_with_history; +alter table hi_tthree drop column sys_period; +drop table hi_tthree_history; + +drop table if exists hi_tthree cascade; + +drop trigger if exists hi_ttwo_history_upd on hi_ttwo cascade; +drop function if exists hi_ttwo_history_version(); + +drop view hi_ttwo_with_history; +alter table hi_ttwo drop column sys_period; +drop table hi_ttwo_history; + +drop table if exists hi_ttwo cascade; + +drop trigger if exists hsd_setting_history_upd on hsd_setting cascade; +drop function if exists hsd_setting_history_version(); + +drop view hsd_setting_with_history; +alter table hsd_setting drop column sys_period; +drop table hsd_setting_history; + +drop table if exists hsd_setting cascade; + +drop trigger if exists hsd_user_history_upd on hsd_user cascade; +drop function if exists hsd_user_history_version(); + +drop view hsd_user_with_history; +alter table hsd_user drop column sys_period; +drop table hsd_user_history; + +drop table if exists hsd_user cascade; + +drop table if exists iaf_segment cascade; + +drop table if exists iaf_segment_status cascade; + +drop table if exists imrelated cascade; + +drop table if exists imroot cascade; + +drop table if exists ixresource cascade; + +drop table if exists info_company cascade; + +drop table if exists info_contact cascade; + +drop table if exists info_customer cascade; + +drop table if exists inner_report cascade; + +drop table if exists drel_invoice cascade; +drop sequence if exists drel_invoice_seq; + +drop table if exists item cascade; + +drop table if exists monkey cascade; + +drop table if exists mkeygroup cascade; + +drop table if exists mkeygroup_monkey cascade; + +drop table if exists trainer cascade; + +drop table if exists trainer_monkey cascade; + +drop table if exists troop cascade; + +drop table if exists troop_monkey cascade; + +drop table if exists l2_cldf_reset_bean cascade; + +drop table if exists l2_cldf_reset_bean_child cascade; + +drop table if exists level1 cascade; + +drop table if exists level1_level4 cascade; + +drop table if exists level1_level2 cascade; + +drop table if exists level2 cascade; + +drop table if exists level2_level3 cascade; + +drop table if exists level3 cascade; + +drop table if exists level4 cascade; + +drop trigger if exists link_history_upd on link cascade; +drop function if exists link_history_version(); + +drop view link_with_history; +alter table link drop column sys_period; +drop table link_history; + +drop table if exists link cascade; + +drop table if exists link_draft cascade; + +drop table if exists la_attr_value cascade; + +drop table if exists la_attr_value_attribute cascade; + +drop table if exists looney cascade; + +drop table if exists maddress cascade; + +drop table if exists mcontact cascade; + +drop table if exists mcontact_message cascade; + +drop table if exists mcustomer cascade; + +drop table if exists mgroup cascade; + +drop table if exists mmachine cascade; + +drop table if exists mmachine_mgroup cascade; + +drop table if exists mmedia cascade; + +drop table if exists non_updateprop cascade; + +drop table if exists mprinter cascade; + +drop table if exists mprinter_state cascade; + +drop table if exists mprofile cascade; + +drop table if exists mprotected_construct_bean cascade; + +drop table if exists mrole cascade; + +drop table if exists mrole_muser cascade; + +drop table if exists msome_other cascade; + +drop table if exists muser cascade; + +drop table if exists muser_type cascade; + +drop table if exists mail_box cascade; + +drop table if exists mail_user cascade; + +drop table if exists mail_user_inbox cascade; + +drop table if exists mail_user_outbox cascade; + +drop table if exists main_entity cascade; + +drop table if exists main_entity_relation cascade; + +drop table if exists map_super_actual cascade; + +drop table if exists c_message cascade; + +drop table if exists meter_address_data cascade; + +drop table if exists meter_contract_data cascade; + +drop table if exists meter_special_needs_client cascade; + +drop table if exists meter_special_needs_contact cascade; + +drop table if exists meter_version cascade; + +drop table if exists mnoc_role cascade; + +drop table if exists mnoc_user cascade; + +drop table if exists mnoc_user_mnoc_role cascade; + +drop table if exists mny_a cascade; + +drop table if exists mny_b cascade; + +drop table if exists mny_b_mny_c cascade; + +drop table if exists mny_c cascade; + +drop table if exists mny_topic cascade; + +drop table if exists subtopics cascade; + +drop table if exists mp_role cascade; + +drop table if exists mp_user cascade; + +drop table if exists ms_many_a cascade; + +drop table if exists ms_many_a_many_b cascade; + +drop table if exists ms_many_b cascade; + +drop table if exists ms_many_b_many_a cascade; + +drop table if exists my_lob_size cascade; + +drop table if exists my_lob_size_join_many cascade; + +drop table if exists noidbean cascade; + +drop table if exists o_bean_child cascade; + +drop table if exists ocached_app cascade; + +drop table if exists ocached_app_detail cascade; + +drop table if exists o_cached_bean cascade; + +drop table if exists o_cached_bean_country cascade; + +drop table if exists o_cached_bean_child cascade; + +drop table if exists o_cached_inherit cascade; + +drop table if exists o_cached_natkey cascade; + +drop table if exists o_cached_natkey3 cascade; + +drop table if exists ocached_nkey_uid cascade; + +drop table if exists ocar cascade; + +drop table if exists ocompany cascade; + +drop table if exists oengine cascade; + +drop table if exists ogear_box cascade; + +drop table if exists omvertex cascade; + +drop table if exists omvertex_other cascade; + +drop table if exists oroad_show_msg cascade; + +drop table if exists om_account_child_dbo cascade; + +drop table if exists om_account_dbo cascade; + +drop table if exists om_basic_child cascade; + +drop table if exists om_basic_parent cascade; + +drop table if exists om_ordered_detail cascade; + +drop table if exists om_ordered_master cascade; + +drop table if exists oml_bar cascade; + +drop table if exists oml_baz cascade; + +drop table if exists oml_foo cascade; + +drop table if exists only_id_entity cascade; + +drop table if exists o_order cascade; + +drop table if exists o_order_detail cascade; + +drop table if exists s_orders cascade; + +drop table if exists s_order_items cascade; + +drop table if exists order_master cascade; + +drop table if exists order_master_inheritance cascade; + +drop table if exists order_referenced_parent cascade; + +drop table if exists or_order_ship cascade; + +drop table if exists order_toy cascade; + +drop table if exists ordered_parent cascade; + +drop table if exists organisation cascade; + +drop table if exists organization_node cascade; + +drop table if exists organization_tree_node cascade; + +drop table if exists orp_detail cascade; + +drop table if exists orp_detail2 cascade; + +drop table if exists orp_master cascade; + +drop table if exists orp_master2 cascade; + +drop table if exists oto_aone cascade; + +drop table if exists oto_atwo cascade; + +drop table if exists oto_bchild cascade; + +drop table if exists oto_bmaster cascade; + +drop table if exists oto_child cascade; + +drop table if exists oto_cust cascade; + +drop table if exists oto_cust_address cascade; + +drop table if exists oto_level_a cascade; + +drop table if exists oto_level_b cascade; + +drop table if exists oto_level_c cascade; + +drop table if exists oto_master cascade; + +drop table if exists oto_prime cascade; + +drop table if exists oto_prime_extra cascade; + +drop table if exists oto_sd_child cascade; + +drop table if exists oto_sd_master cascade; + +drop table if exists oto_th_many cascade; + +drop table if exists oto_th_one cascade; + +drop table if exists oto_th_top cascade; + +drop table if exists oto_ubprime cascade; + +drop table if exists oto_ubprime_extra cascade; + +drop table if exists oto_uprime cascade; + +drop table if exists oto_uprime_extra cascade; + +drop table if exists oto_user_model cascade; + +drop table if exists oto_user_model_optional cascade; + +drop table if exists pfile cascade; + +drop table if exists pfile_content cascade; + +drop table if exists paggview cascade; + +drop table if exists pallet_location cascade; + +drop table if exists parcel cascade; + +drop table if exists parcel_location cascade; + +drop table if exists rawinherit_parent cascade; + +drop table if exists rawinherit_parent_rawinherit_data cascade; + +drop table if exists e_save_test_c cascade; + +drop table if exists parent_person cascade; + +drop table if exists c_participation cascade; + +drop table if exists password_store_model cascade; + +drop table if exists pcf_calendar cascade; + +drop table if exists pcf_city cascade; + +drop table if exists pcf_country cascade; + +drop table if exists pcf_event cascade; + +drop table if exists pcf_person cascade; + +drop table if exists mt_permission cascade; + +drop table if exists persistent_file cascade; + +drop table if exists persistent_file_content cascade; + +drop table if exists person cascade; + +drop table if exists persons cascade; + +drop table if exists person_cache_email cascade; + +drop table if exists person_cache_info cascade; + +drop table if exists phones cascade; + +drop table if exists e_position cascade; + +drop table if exists primary_revision cascade; + +drop table if exists o_product cascade; + +drop table if exists pp cascade; + +drop table if exists pp_to_ww cascade; + +drop table if exists question cascade; + +drop table if exists rcustomer cascade; + +drop table if exists r_orders cascade; + +drop table if exists referenced_defaults_model cascade; + +drop table if exists referenced_defaults_model_draft cascade; + +drop table if exists referencing_bean cascade; + +drop table if exists region cascade; + +drop table if exists rel_detail cascade; + +drop table if exists rel_master cascade; + +drop table if exists resourcefile cascade; + +drop table if exists mt_role cascade; + +drop table if exists mt_role_permission cascade; + +drop table if exists em_role cascade; + +drop table if exists root_bean cascade; + +drop table if exists f_second cascade; + +drop table if exists section cascade; + +drop table if exists self_parent cascade; + +drop table if exists self_ref_customer cascade; + +drop table if exists self_ref_example cascade; + +drop table if exists e_save_test_a cascade; + +drop table if exists e_save_test_b cascade; + +drop table if exists site cascade; + +drop table if exists site_address cascade; + +drop table if exists some_enum_bean cascade; + +drop table if exists some_file_bean cascade; + +drop table if exists some_new_types_bean cascade; + +drop table if exists some_period_bean cascade; + +drop table if exists source_base cascade; + +drop table if exists stockforecast cascade; + +drop table if exists sub_section cascade; + +drop table if exists sub_type cascade; + +drop table if exists survey cascade; + +drop table if exists tbytes_only cascade; + +drop table if exists tcar cascade; + +drop table if exists tevent cascade; + +drop table if exists tevent_many cascade; + +drop table if exists tevent_one cascade; + +drop table if exists tint_root cascade; + +drop table if exists tjoda_entity cascade; + +drop table if exists t_mapsuper1 cascade; + +drop table if exists t_oneb cascade; + +drop table if exists t_detail_with_other_namexxxyy cascade; +drop sequence if exists t_atable_detail_seq; + +drop table if exists t_atable_thatisrelatively cascade; +drop sequence if exists t_atable_master_seq; + +drop table if exists ttruck_holder cascade; + +drop table if exists ttruck_holder_item cascade; + +drop table if exists tuuid_entity cascade; + +drop table if exists twheel cascade; + +drop table if exists twith_pre_insert cascade; + +drop table if exists target_base cascade; + +drop table if exists mt_tenant cascade; + +drop table if exists test_annotation_base_entity cascade; + +drop table if exists tire cascade; +drop sequence if exists tire_seq; + +drop table if exists sa_tire cascade; +drop sequence if exists sa_tire_seq; + +drop table if exists tree_entity cascade; + +drop table if exists trip cascade; + +drop table if exists truck_ref cascade; + +drop table if exists tune cascade; + +drop table if exists "type" cascade; + +drop table if exists tz_bean cascade; + +drop table if exists usib_child cascade; + +drop table if exists usib_child_sibling cascade; + +drop table if exists usib_parent cascade; + +drop table if exists ut_detail cascade; + +drop table if exists ut_master cascade; + +drop table if exists uuone cascade; + +drop table if exists uutwo cascade; + +drop table if exists oto_user cascade; + +drop trigger if exists c_user_history_upd on c_user cascade; +drop function if exists c_user_history_version(); + +drop view c_user_with_history; +alter table c_user drop column sys_period; +drop table c_user_history; + +drop table if exists c_user cascade; + +drop table if exists tx_user cascade; + +drop table if exists g_user cascade; + +drop table if exists em_user cascade; + +drop table if exists user_interest_live cascade; + +drop table if exists em_user_role cascade; + +drop table if exists vehicle cascade; + +drop table if exists vehicle_driver cascade; + +drop table if exists vehicle_lease cascade; + +drop table if exists version_child cascade; + +drop table if exists version_parent cascade; + +drop table if exists version_toy cascade; + +drop table if exists warehouses cascade; + +drop table if exists warehousesshippingzones cascade; + +drop table if exists wheel cascade; +drop sequence if exists wheel_seq; + +drop table if exists sa_wheel cascade; +drop sequence if exists sa_wheel_seq; + +drop table if exists sp_car_wheel cascade; +drop sequence if exists sp_car_wheel_seq; + +drop table if exists g_who_props_otm cascade; + +drop table if exists with_zero cascade; + +drop table if exists parent cascade; + +drop table if exists wview cascade; + +drop table if exists zones cascade; + +drop index if exists ix_contact_last_name_first_name; +drop index if exists ix_e_basic_name; +drop index if exists ix_efile2_no_fk_owner_id; +drop index if exists ix_ecsm_values_host_id; +drop index if exists ix_order_referenced_parent_type; +drop index if exists ix_organization_node_kind; +drop index concurrently if exists ix_t_detail_with_other_namexxxyy_lowername; +drop index if exists ix_t_detail_with_other_namexxxyy_defn; +drop index if exists ano_3; +drop index if exists ano_1; +drop index if exists ano_2; diff --git a/ebean-core/src/test/ddl-review/sqlserver-create-all.sql b/ebean-core/src/test/ddl-review/sqlserver-create-all.sql new file mode 100644 index 000000000..40e48e28e --- /dev/null +++ b/ebean-core/src/test/ddl-review/sqlserver-create-all.sql @@ -0,0 +1,5308 @@ +-- Generated by ebean unknown at 2020-03-04T08:21:26.827349Z +-- init script create procs +-- Initial script to create stored procedures etc for sqlserver platform + +-- create table-value-parameters +if not exists (select name from sys.types where name = 'ebean_bigint_tvp') create type ebean_bigint_tvp as table (c1 bigint) +GO +if not exists (select name from sys.types where name = 'ebean_float_tvp') create type ebean_float_tvp as table (c1 float) +GO +if not exists (select name from sys.types where name = 'ebean_bit_tvp') create type ebean_bit_tvp as table (c1 bit) +GO +if not exists (select name from sys.types where name = 'ebean_date_tvp') create type ebean_date_tvp as table (c1 date) +GO +if not exists (select name from sys.types where name = 'ebean_time_tvp') create type ebean_time_tvp as table (c1 time) +GO +if not exists (select name from sys.types where name = 'ebean_uniqueidentifier_tvp') create type ebean_uniqueidentifier_tvp as table (c1 uniqueidentifier) +GO +if not exists (select name from sys.types where name = 'ebean_nvarchar_tvp') create type ebean_nvarchar_tvp as table (c1 nvarchar(max)) +GO + +-- +-- PROCEDURE: usp_ebean_drop_indices TABLE, COLUMN +-- deletes all indices referring to TABLE.COLUMN +-- +CREATE OR ALTER PROCEDURE usp_ebean_drop_indices @tableName nvarchar(255), @columnName nvarchar(255) +AS SET NOCOUNT ON +declare @sql nvarchar(1000) +declare @indexName nvarchar(255) +BEGIN + DECLARE index_cursor CURSOR FOR SELECT i.name from sys.indexes i + join sys.index_columns ic on ic.object_id = i.object_id and ic.index_id = i.index_id + join sys.columns c on c.object_id = ic.object_id and c.column_id = ic.column_id + where i.object_id = OBJECT_ID(@tableName) AND c.name = @columnName; + OPEN index_cursor + FETCH NEXT FROM index_cursor INTO @indexName + WHILE @@FETCH_STATUS = 0 + BEGIN + set @sql = 'drop index ' + @indexName + ' on ' + @tableName; + EXECUTE(@sql); + + FETCH NEXT FROM index_cursor INTO @indexName + END; + CLOSE index_cursor; + DEALLOCATE index_cursor; +END +GO + +-- +-- PROCEDURE: usp_ebean_drop_default_constraint TABLE, COLUMN +-- deletes the default constraint, which has a random name +-- +CREATE OR ALTER PROCEDURE usp_ebean_drop_default_constraint @tableName nvarchar(255), @columnName nvarchar(255) +AS SET NOCOUNT ON +declare @tmp nvarchar(1000) +BEGIN + select @tmp = t1.name from sys.default_constraints t1 + join sys.columns t2 on t1.object_id = t2.default_object_id + where t1.parent_object_id = OBJECT_ID(@tableName) and t2.name = @columnName; + + if @tmp is not null EXEC('alter table ' + @tableName +' drop constraint ' + @tmp); +END +GO + +-- +-- PROCEDURE: usp_ebean_drop_constraints TABLE, COLUMN +-- deletes constraints and foreign keys refering to TABLE.COLUMN +-- +CREATE OR ALTER PROCEDURE usp_ebean_drop_constraints @tableName nvarchar(255), @columnName nvarchar(255) +AS SET NOCOUNT ON +declare @sql nvarchar(1000) +declare @constraintName nvarchar(255) +BEGIN + DECLARE name_cursor CURSOR FOR + SELECT cc.name from sys.check_constraints cc + join sys.columns c on c.object_id = cc.parent_object_id and c.column_id = cc.parent_column_id + where parent_object_id = OBJECT_ID(@tableName) AND c.name = @columnName + UNION SELECT fk.name from sys.foreign_keys fk + join sys.foreign_key_columns fkc on fkc.constraint_object_id = fk.object_id + and fkc.parent_object_id = fk.parent_object_id + join sys.columns c on c.object_id = fkc.parent_object_id and c.column_id = fkc.parent_column_id + where fkc.parent_object_id = OBJECT_ID(@tableName) AND c.name = @columnName; + + OPEN name_cursor + FETCH NEXT FROM name_cursor INTO @constraintName + WHILE @@FETCH_STATUS = 0 + BEGIN + set @sql = 'alter table ' + @tableName + ' drop constraint ' + @constraintName; + EXECUTE(@sql); + + FETCH NEXT FROM name_cursor INTO @constraintName + END; + CLOSE name_cursor; + DEALLOCATE name_cursor; +END +GO + +-- +-- PROCEDURE: usp_ebean_drop_column TABLE, COLUMN +-- deletes the column annd ensures that all indices and constraints are dropped first +-- +CREATE OR ALTER PROCEDURE usp_ebean_drop_column @tableName nvarchar(255), @columnName nvarchar(255) +AS SET NOCOUNT ON +declare @sql nvarchar(1000) +BEGIN + EXEC usp_ebean_drop_indices @tableName, @columnName; + EXEC usp_ebean_drop_default_constraint @tableName, @columnName; + EXEC usp_ebean_drop_constraints @tableName, @columnName; + + set @sql = 'alter table ' + @tableName + ' drop column ' + @columnName; + EXECUTE(@sql); +END +GO +create table asimple_bean ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_asimple_bean primary key (id) +); +create sequence asimple_bean_seq as bigint start with 1 increment by 50; + +create table bar ( + bar_type nvarchar(31) not null, + bar_id integer not null, + foo_id integer not null, + version integer not null, + constraint pk_bar primary key (bar_id) +); +create sequence bar_seq as bigint start with 1 increment by 50; + +create table block ( + case_type integer not null, + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + notes nvarchar(255), + constraint pk_block primary key (id) +); +create sequence block_seq as bigint start with 1 increment by 50; + +create table oto_account ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_oto_account primary key (id) +); +create sequence oto_account_seq as bigint start with 1 increment by 50; + +create table acl ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_acl primary key (id) +); +create sequence acl_seq as bigint start with 1 increment by 50; + +create table acl_container_relation ( + id numeric(19) not null, + container_id numeric(19) not null, + acl_entry_id numeric(19) not null, + constraint pk_acl_container_relation primary key (id) +); +create sequence acl_container_relation_seq as bigint start with 1 increment by 50; + +create table addr ( + id numeric(19) not null, + employee_id numeric(19), + name nvarchar(255), + address_line1 nvarchar(255), + address_line2 nvarchar(255), + city nvarchar(255), + version numeric(19) not null, + constraint pk_addr primary key (id) +); +create sequence addr_seq as bigint start with 1 increment by 50; + +create table address ( + oid numeric(19) not null, + street nvarchar(255), + version integer not null, + constraint pk_address primary key (oid) +); +create sequence address_seq as bigint start with 1 increment by 50; + +create table o_address ( + id integer not null, + line_1 nvarchar(100), + line_2 nvarchar(100), + city nvarchar(100), + cretime datetime2, + country_code nvarchar(2), + updtime datetime2 not null, + constraint pk_o_address primary key (id) +); +create sequence o_address_seq as bigint start with 1 increment by 50; + +create table album ( + id numeric(19) not null, + name nvarchar(255), + cover_id numeric(19), + deleted integer default 0 not null, + created_at datetime2 not null, + last_update datetime2 not null, + constraint pk_album primary key (id) +); +create unique nonclustered index uq_album_cover_id on album(cover_id) where cover_id is not null; +create sequence album_seq as bigint start with 1 increment by 50; + +create table animal ( + species nvarchar(255) not null, + id numeric(19) not null, + shelter_id numeric(19), + version numeric(19) not null, + name nvarchar(255), + registration_number nvarchar(255), + date_of_birth date, + dog_size nvarchar(255), + constraint pk_animal primary key (id) +); +create sequence animal_seq as bigint start with 1 increment by 50; + +create table animal_shelter ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_animal_shelter primary key (id) +); +create sequence animal_shelter_seq as bigint start with 1 increment by 50; + +create table article ( + id integer not null, + name nvarchar(255), + author nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_article primary key (id) +); +create sequence article_seq as bigint start with 1 increment by 50; + +create table attribute ( + option_type integer not null, + id integer not null, + attribute_holder_id integer, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_attribute primary key (id) +); +create sequence attribute_seq as bigint start with 1 increment by 50; + +create table attribute_holder ( + id integer not null, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_attribute_holder primary key (id) +); +create sequence attribute_holder_seq as bigint start with 1 increment by 50; + +create table audit_log ( + id numeric(19) not null, + description nvarchar(255), + modified_description nvarchar(255), + constraint pk_audit_log primary key (id) +); +create sequence audit_log_seq as bigint start with 1000 increment by 50 cache 50; + +create table bbookmark ( + id integer not null, + bookmark_reference nvarchar(255), + user_id integer, + constraint pk_bbookmark primary key (id) +); +create sequence bbookmark_seq as bigint start with 1 increment by 50; + +create table bbookmark_org ( + id integer not null, + name nvarchar(255), + constraint pk_bbookmark_org primary key (id) +); +create sequence bbookmark_org_seq as bigint start with 1 increment by 50; + +create table bbookmark_user ( + id integer not null, + name nvarchar(255), + password nvarchar(255), + email_address nvarchar(255), + country nvarchar(255), + org_id integer, + constraint pk_bbookmark_user primary key (id) +); +create sequence bbookmark_user_seq as bigint start with 1 increment by 50; + +create table bsimple_with_gen ( + id integer not null, + name nvarchar(255), + constraint pk_bsimple_with_gen primary key (id) +); +create sequence bsimple_with_gen_seq as bigint start with 1 increment by 50; + +create table bsite ( + id uniqueidentifier not null, + name nvarchar(255), + constraint pk_bsite primary key (id) +); + +create table bsite_user_a ( + site_id uniqueidentifier not null, + user_id uniqueidentifier not null, + access_level integer, + version numeric(19) 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 uniqueidentifier not null, + usr uniqueidentifier 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 uniqueidentifier not null, + user_uid uniqueidentifier 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 uniqueidentifier not null, + user_id uniqueidentifier not null, + access_level integer, + version numeric(19) not null, + constraint ck_bsite_user_d_access_level check ( access_level in (0,1,2)) +); + +create table bsite_user_e ( + site_id uniqueidentifier not null, + user_id uniqueidentifier not null, + access_level integer, + constraint ck_bsite_user_e_access_level check ( access_level in (0,1,2)) +); + +create table buser ( + id uniqueidentifier not null, + name nvarchar(255), + constraint pk_buser primary key (id) +); + +create table bwith_qident ( + id integer not null, + [Name] nvarchar(191), + [CODE] nvarchar(255), + last_updated datetime2 not null, + constraint pk_bwith_qident primary key (id) +); +create unique nonclustered index uq_bwith_qident_name on bwith_qident([Name]) where [Name] is not null; +create sequence bwith_qident_seq as bigint start with 1 increment by 50; + +create table basic_draftable_bean ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_basic_draftable_bean primary key (id) +); +create sequence basic_draftable_bean_seq as bigint start with 1 increment by 50; + +create table basic_draftable_bean_draft ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_basic_draftable_bean_draft primary key (id) +); +create sequence basic_draftable_bean_draft_seq as bigint start with 1 increment by 50; + +create table basic_joda_entity ( + id numeric(19) not null, + name nvarchar(255), + period nvarchar(50), + local_date date, + created datetime2 not null, + updated datetime2 not null, + version datetime2 not null, + constraint pk_basic_joda_entity primary key (id) +); +create sequence basic_joda_entity_seq as bigint start with 1 increment by 50; + +create table bean_with_time_zone ( + id numeric(19) not null, + name nvarchar(255), + timezone nvarchar(20), + constraint pk_bean_with_time_zone primary key (id) +); +create sequence bean_with_time_zone_seq as bigint start with 1 increment by 50; + +create table drel_booking ( + id numeric(19) not null, + booking_uid numeric(19), + agent_invoice numeric(19), + client_invoice numeric(19), + version integer not null, + constraint pk_drel_booking primary key (id) +); +create unique nonclustered index uq_drel_booking_booking_uid on drel_booking(booking_uid) where booking_uid is not null; +create unique nonclustered index uq_drel_booking_agent_invoice on drel_booking(agent_invoice) where agent_invoice is not null; +create unique nonclustered index uq_drel_booking_client_invoice on drel_booking(client_invoice) where client_invoice is not null; +create sequence drel_booking_seq as bigint start with 1 increment by 50; + +create table bw_bean ( + id numeric(19) not null, + name nvarchar(255), + flags integer not null, + version numeric(19) not null, + constraint pk_bw_bean primary key (id) +); +create sequence bw_bean_seq as bigint start with 1 increment by 50; + +create table cepcategory ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_cepcategory primary key (id) +); +create sequence cepcategory_seq as bigint start with 1 increment by 50; + +create table cepproduct ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_cepproduct primary key (id) +); +create sequence cepproduct_seq as bigint start with 1 increment by 50; + +create table cepproduct_category ( + customer_id numeric(19) not null, + address_id numeric(19) not null, + category_id numeric(19) not null, + product_id numeric(19) not null, + priority integer +); + +create table cinh_ref ( + id integer not null, + ref_id integer, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_cinh_ref primary key (id) +); +create sequence cinh_ref_seq as bigint start with 1 increment by 50; + +create table cinh_root ( + dtype nvarchar(3) not null, + id integer not null, + license_number nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + driver nvarchar(255), + notes nvarchar(255), + action nvarchar(255), + constraint pk_cinh_root primary key (id) +); +create sequence cinh_root_seq as bigint start with 1 increment by 50; + +create table ckey_assoc ( + id integer not null, + assoc_one nvarchar(255), + constraint pk_ckey_assoc primary key (id) +); +create sequence ckey_assoc_seq as bigint start with 1 increment by 50; + +create table ckey_detail ( + id integer not null, + something nvarchar(255), + one_key integer, + two_key nvarchar(127), + constraint pk_ckey_detail primary key (id) +); +create sequence ckey_detail_seq as bigint start with 1 increment by 50; + +create table ckey_parent ( + one_key integer not null, + two_key nvarchar(127) not null, + name nvarchar(255), + assoc_id integer, + version integer not null, + constraint pk_ckey_parent primary key (one_key,two_key) +); + +create table coone ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_coone primary key (id) +); +create sequence coone_seq as bigint start with 1 increment by 50; + +create table coone_many ( + id numeric(19) not null, + coone_id numeric(19) not null, + name nvarchar(255), + deleted integer default 0 not null, + constraint pk_coone_many primary key (id) +); +create sequence coone_many_seq as bigint start with 1 increment by 50; + +create table coroot ( + id numeric(19) not null, + name nvarchar(255), + one_id numeric(19), + constraint pk_coroot primary key (id) +); +create unique nonclustered index uq_coroot_one_id on coroot(one_id) where one_id is not null; +create sequence coroot_seq as bigint start with 1 increment by 50; + +create table calculation_result ( + id integer not null, + charge float(32) not null, + product_configuration_id integer, + group_configuration_id integer, + constraint pk_calculation_result primary key (id) +); +create sequence calculation_result_seq as bigint start with 1 increment by 50; + +create table cao_bean ( + x_cust_id integer not null, + x_type_id integer not null, + description nvarchar(255), + version numeric(19) not null, + constraint pk_cao_bean primary key (x_cust_id,x_type_id) +); + +create table sp_car_car ( + id numeric(19) not null, + name nvarchar(255), + version integer not null, + constraint pk_sp_car_car primary key (id) +); +create sequence sp_car_car_seq as bigint start with 1 increment by 50; + +create table sp_car_car_wheels ( + car numeric(19) not null, + wheel numeric(19) not null, + constraint pk_sp_car_car_wheels primary key (car,wheel) +); + +create table sp_car_car_doors ( + car numeric(19) not null, + door numeric(19) not null, + constraint pk_sp_car_car_doors primary key (car,door) +); + +create table sa_car ( + id numeric(19) not null, + brand nvarchar(255), + sold integer not null, + version integer not null, + constraint pk_sa_car primary key (id) +); +create sequence sa_car_seq as bigint start with 1 increment by 50; + +create table car_accessory ( + id integer not null, + name nvarchar(255), + fuse_id numeric(19) not null, + car_id integer, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_car_accessory primary key (id) +); +create sequence car_accessory_seq as bigint start with 1 increment by 50; + +create table car_fuse ( + id numeric(19) not null, + location_code nvarchar(255), + constraint pk_car_fuse primary key (id) +); +create sequence car_fuse_seq as bigint start with 1 increment by 50; + +create table category ( + id numeric(19) not null, + name nvarchar(255), + surveyobjectid numeric(19), + sequence_number integer not null, + constraint pk_category primary key (id) +); +create sequence category_seq as bigint start with 1 increment by 50; + +create table e_save_test_d ( + id numeric(19) not null, + parent_id numeric(19), + test_property integer default 0 not null, + version numeric(19) not null, + constraint pk_e_save_test_d primary key (id) +); +create unique nonclustered index uq_e_save_test_d_parent_id on e_save_test_d(parent_id) where parent_id is not null; +create sequence e_save_test_d_seq as bigint start with 1 increment by 50; + +create table child_person ( + identifier integer not null, + name nvarchar(255), + age integer, + some_bean_id integer, + parent_identifier integer, + family_name nvarchar(255), + address nvarchar(255), + constraint pk_child_person primary key (identifier) +); +create sequence child_person_seq as bigint start with 1 increment by 50; + +create table cke_client ( + cod_cpny integer not null, + cod_client nvarchar(100) not null, + username nvarchar(100) not null, + notes nvarchar(255), + constraint pk_cke_client primary key (cod_cpny,cod_client) +); + +create table cke_user ( + username nvarchar(100) not null, + cod_cpny integer not null, + name nvarchar(255), + constraint pk_cke_user primary key (username,cod_cpny) +); + +create table class_super ( + dtype nvarchar(31) not null, + sid numeric(19) not null, + constraint pk_class_super primary key (sid) +); +create sequence class_super_seq as bigint start with 1 increment by 50; + +create table class_super_monkey ( + class_super_sid numeric(19) not null, + monkey_mid numeric(19) 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 nvarchar(21) not null, + id integer not null, + name nvarchar(255), + configurations_id integer, + group_name nvarchar(255), + product_name nvarchar(255), + constraint pk_configuration primary key (id) +); +create sequence configuration_seq as bigint start with 1 increment by 50; + +create table configurations ( + id integer not null, + name nvarchar(255), + constraint pk_configurations primary key (id) +); +create sequence configurations_seq as bigint start with 1 increment by 50; + +create table contact ( + id integer not null, + first_name nvarchar(127), + last_name nvarchar(127), + phone nvarchar(255), + mobile nvarchar(255), + email nvarchar(255), + is_member integer default 0 not null, + customer_id integer not null, + group_id integer, + cretime datetime2 not null, + updtime datetime2 not null, + constraint pk_contact primary key (id) +); +create sequence contact_seq as bigint start with 1 increment by 50; + +create table contact_group ( + id integer not null, + name nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_contact_group primary key (id) +); +create sequence contact_group_seq as bigint start with 1 increment by 50; + +create table contact_note ( + id integer not null, + contact_id integer, + title nvarchar(255), + note nvarchar(max), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_contact_note primary key (id) +); +create sequence contact_note_seq as bigint start with 1 increment by 50; + +create table contract ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_contract primary key (id) +); +create sequence contract_seq as bigint start with 1 increment by 50; + +create table contract_costs ( + id numeric(19) not null, + status nvarchar(255), + position_id numeric(19) not null, + constraint pk_contract_costs primary key (id) +); +create sequence contract_costs_seq as bigint start with 1 increment by 50; + +create table c_conversation ( + id numeric(19) not null, + title nvarchar(255), + isopen integer default 0 not null, + group_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_c_conversation primary key (id) +); +create sequence c_conversation_seq as bigint start with 1 increment by 50; + +create table o_country ( + code nvarchar(2) not null, + name nvarchar(60), + constraint pk_o_country primary key (code) +); + +create table cover ( + id numeric(19) not null, + s3_url nvarchar(255), + deleted integer default 0 not null, + constraint pk_cover primary key (id) +); +create sequence cover_seq as bigint start with 1 increment by 50; + +create table o_customer ( + id integer not null, + status nvarchar(1), + name nvarchar(40) not null, + smallnote nvarchar(100), + anniversary date, + billing_address_id integer, + shipping_address_id integer, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint ck_o_customer_status check ( status in ('N','A','I')), + constraint pk_o_customer primary key (id) +); +create sequence o_customer_seq as bigint start with 1 increment by 50; + +create table dcredit ( + id numeric(19) not null, + credit nvarchar(255), + constraint pk_dcredit primary key (id) +); +create sequence dcredit_seq as bigint start with 1 increment by 50; + +create table dcredit_drol ( + dcredit_id numeric(19) not null, + drol_id numeric(19) not null, + constraint pk_dcredit_drol primary key (dcredit_id,drol_id) +); + +create table dexh_entity ( + oid numeric(19) not null, + exhange nvarchar(255), + an_enum_type nvarchar(255), + last_updated datetime2 not null, + constraint pk_dexh_entity primary key (oid) +); +create sequence dexh_entity_seq as bigint start with 1 increment by 50; + +create table dint_parent ( + type integer not null, + id numeric(19) not null, + val integer, + more nvarchar(255), + constraint pk_dint_parent primary key (id) +); +create sequence dint_parent_seq as bigint start with 1 increment by 50; + +create table dmachine ( + id numeric(19) not null, + name nvarchar(255), + organisation_id numeric(19), + version numeric(19) not null, + constraint pk_dmachine primary key (id) +); +create sequence dmachine_seq as bigint start with 1 increment by 50; + +create table d_machine_aux_use ( + id numeric(19) not null, + machine_id numeric(19) not null, + name nvarchar(255), + edate date, + use_secs numeric(19) not null, + fuel numeric(28), + version numeric(19) not null, + constraint pk_d_machine_aux_use primary key (id) +); +create sequence d_machine_aux_use_seq as bigint start with 1 increment by 50; + +create table d_machine_stats ( + id numeric(19) not null, + machine_id numeric(19) not null, + edate date, + total_kms numeric(19) not null, + hours numeric(19) not null, + rate numeric(28), + cost numeric(28), + version numeric(19) not null, + constraint pk_d_machine_stats primary key (id) +); +create sequence d_machine_stats_seq as bigint start with 1 increment by 50; + +create table d_machine_use ( + id numeric(19) not null, + machine_id numeric(19) not null, + edate date, + distance_kms numeric(19) not null, + time_secs numeric(19) not null, + fuel numeric(28), + version numeric(19) not null, + constraint pk_d_machine_use primary key (id) +); +create sequence d_machine_use_seq as bigint start with 1 increment by 50; + +create table dorg ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_dorg primary key (id) +); +create sequence dorg_seq as bigint start with 1 increment by 50; + +create table dperson ( + id numeric(19) not null, + first_name nvarchar(255), + last_name nvarchar(255), + salary numeric(28), + constraint pk_dperson primary key (id) +); +create sequence dperson_seq as bigint start with 1 increment by 50; + +create table drol ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_drol primary key (id) +); +create sequence drol_seq as bigint start with 1 increment by 50; + +create table drot ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_drot primary key (id) +); +create sequence drot_seq as bigint start with 1 increment by 50; + +create table drot_drol ( + drot_id numeric(19) not null, + drol_id numeric(19) not null, + constraint pk_drot_drol primary key (drot_id,drol_id) +); + +create table rawinherit_data ( + id numeric(19) not null, + val integer, + constraint pk_rawinherit_data primary key (id) +); +create sequence rawinherit_data_seq as bigint start with 1 increment by 50; + +create table data_container ( + id uniqueidentifier not null, + content nvarchar(255), + constraint pk_data_container primary key (id) +); + +create table dc_detail ( + id numeric(19) not null, + master_id numeric(19), + description nvarchar(255), + version numeric(19) not null, + constraint pk_dc_detail primary key (id) +); +create sequence dc_detail_seq as bigint start with 1 increment by 50; + +create table dc_master ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_dc_master primary key (id) +); +create sequence dc_master_seq as bigint start with 1 increment by 50; + +create table dfk_cascade ( + id numeric(19) not null, + name nvarchar(255), + one_id numeric(19), + constraint pk_dfk_cascade primary key (id) +); +create sequence dfk_cascade_seq as bigint start with 1 increment by 50; + +create table dfk_cascade_one ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_dfk_cascade_one primary key (id) +); +create sequence dfk_cascade_one_seq as bigint start with 1 increment by 50; + +create table dfk_none ( + id numeric(19) not null, + name nvarchar(255), + one_id numeric(19), + constraint pk_dfk_none primary key (id) +); +create sequence dfk_none_seq as bigint start with 1 increment by 50; + +create table dfk_none_via_join ( + id numeric(19) not null, + name nvarchar(255), + one_id numeric(19), + constraint pk_dfk_none_via_join primary key (id) +); +create sequence dfk_none_via_join_seq as bigint start with 1 increment by 50; + +create table dfk_none_via_mto_m ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_dfk_none_via_mto_m primary key (id) +); +create sequence dfk_none_via_mto_m_seq as bigint start with 1 increment by 50; + +create table dfk_none_via_mto_m_dfk_one ( + dfk_none_via_mto_m_id numeric(19) not null, + dfk_one_id numeric(19) 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 numeric(19) not null, + name nvarchar(255), + constraint pk_dfk_one primary key (id) +); +create sequence dfk_one_seq as bigint start with 1 increment by 50; + +create table dfk_set_null ( + id numeric(19) not null, + name nvarchar(255), + one_id numeric(19), + constraint pk_dfk_set_null primary key (id) +); +create sequence dfk_set_null_seq as bigint start with 1 increment by 50; + +create table doc ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_doc primary key (id) +); +create sequence doc_seq as bigint start with 1 increment by 50; + +create table doc_link ( + doc_id numeric(19) not null, + link_id numeric(19) not null, + constraint pk_doc_link primary key (doc_id,link_id) +); + +create table doc_link_draft ( + doc_id numeric(19) not null, + link_id numeric(19) not null, + constraint pk_doc_link_draft primary key (doc_id,link_id) +); + +create table doc_draft ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_doc_draft primary key (id) +); +create sequence doc_draft_seq as bigint start with 1 increment by 50; + +create table document ( + id numeric(19) not null, + title nvarchar(127), + body nvarchar(255), + organisation_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_document primary key (id) +); +create unique nonclustered index uq_document_title on document(title) where title is not null; +create sequence document_seq as bigint start with 1 increment by 50; + +create table document_draft ( + id numeric(19) not null, + title nvarchar(127), + body nvarchar(255), + when_publish datetime2, + organisation_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_document_draft primary key (id) +); +create unique nonclustered index uq_document_draft_title on document_draft(title) where title is not null; +create sequence document_draft_seq as bigint start with 1 increment by 50; + +create table document_media ( + id numeric(19) not null, + document_id numeric(19), + name nvarchar(255), + description nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_document_media primary key (id) +); +create sequence document_media_seq as bigint start with 1 increment by 50; + +create table document_media_draft ( + id numeric(19) not null, + document_id numeric(19), + name nvarchar(255), + description nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_document_media_draft primary key (id) +); +create sequence document_media_draft_seq as bigint start with 1 increment by 50; + +create table sp_car_door ( + id numeric(19) not null, + name nvarchar(255), + version integer not null, + constraint pk_sp_car_door primary key (id) +); +create sequence sp_car_door_seq as bigint start with 1 increment by 50; + +create table earray_bean ( + id numeric(19) not null, + foo integer, + name nvarchar(255), + phone_numbers varchar(300), + uids varchar(1000) not null, + other_ids varchar(1000), + doubs varchar(1000), + statuses varchar(1000), + vc_enums varchar(1000), + int_enums varchar(1000), + status2 varchar(1000), + version numeric(19) not null, + constraint ck_earray_bean_foo check ( foo in (100,101,102)), + constraint pk_earray_bean primary key (id) +); +create sequence earray_bean_seq as bigint start with 1 increment by 50; + +create table earray_set_bean ( + id numeric(19) not null, + name nvarchar(255), + phone_numbers varchar(300), + uids varchar(1000), + other_ids varchar(1000), + doubs varchar(1000), + version numeric(19) not null, + constraint pk_earray_set_bean primary key (id) +); +create sequence earray_set_bean_seq as bigint start with 1 increment by 50; + +create table e_basic ( + id integer not null, + status nvarchar(1), + name nvarchar(127), + description nvarchar(255), + some_date datetime2, + constraint ck_e_basic_status check ( status in ('N','A','I')), + constraint pk_e_basic primary key (id) +); +create sequence e_basic_seq as bigint start with 1 increment by 50; + +create table ebasic_change_log ( + id numeric(19) not null, + name nvarchar(20), + short_description nvarchar(50), + long_description nvarchar(100), + who_created nvarchar(255) not null, + who_modified nvarchar(255) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + version numeric(19) not null, + constraint pk_ebasic_change_log primary key (id) +); +create sequence ebasic_change_log_seq as bigint start with 1 increment by 50; + +create table ebasic_clob ( + id numeric(19) not null, + name nvarchar(255), + title nvarchar(255), + description nvarchar(max), + last_update datetime2 not null, + constraint pk_ebasic_clob primary key (id) +); +create sequence ebasic_clob_seq as bigint start with 1 increment by 50; + +create table ebasic_clob_fetch_eager ( + id numeric(19) not null, + name nvarchar(255), + title nvarchar(255), + description nvarchar(max), + last_update datetime2 not null, + constraint pk_ebasic_clob_fetch_eager primary key (id) +); +create sequence ebasic_clob_fetch_eager_seq as bigint start with 1 increment by 50; + +create table ebasic_clob_no_ver ( + id numeric(19) not null, + name nvarchar(255), + description nvarchar(max), + constraint pk_ebasic_clob_no_ver primary key (id) +); +create sequence ebasic_clob_no_ver_seq as bigint start with 1 increment by 50; + +create table e_basicenc ( + id integer not null, + name nvarchar(255), + description varbinary(80), + dob varbinary(20), + status varbinary(20), + last_update datetime2, + constraint pk_e_basicenc primary key (id) +); +create sequence e_basicenc_seq as bigint start with 1 increment by 50; + +create table e_basicenc_bin ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + data image, + some_time varbinary(255), + last_update datetime2 not null, + constraint pk_e_basicenc_bin primary key (id) +); +create sequence e_basicenc_bin_seq as bigint start with 1 increment by 50; + +create table e_basicenc_client ( + id numeric(19) not null, + name nvarchar(255), + description varbinary(80), + dob varbinary(20), + status varbinary(20), + version numeric(19) not null, + constraint pk_e_basicenc_client primary key (id) +); +create sequence e_basicenc_client_seq as bigint start with 1 increment by 50; + +create table e_basicenc_relate ( + id numeric(19) not null, + name nvarchar(255), + other_id integer, + constraint pk_e_basicenc_relate primary key (id) +); +create sequence e_basicenc_relate_seq as bigint start with 1 increment by 50; + +create table e_basic_enum_id ( + status nvarchar(1) not null, + name nvarchar(255), + description nvarchar(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 not null, + status integer, + name nvarchar(255), + description nvarchar(255), + some_date datetime2, + constraint ck_e_basic_eni_status check ( status in (1,2,3)), + constraint pk_e_basic_eni primary key (id) +); +create sequence e_basic_eni_seq as bigint start with 1 increment by 50; + +create table ebasic_hstore ( + id numeric(19) not null, + name nvarchar(255), + map nvarchar(800), + version numeric(19) not null, + constraint pk_ebasic_hstore primary key (id) +); +create sequence ebasic_hstore_seq as bigint start with 1 increment by 50; + +create table ebasic_json_jackson ( + id numeric(19) not null, + name nvarchar(255), + value_set nvarchar(700), + value_list nvarchar(max), + value_map nvarchar(700), + plain_value nvarchar(500), + version numeric(19) not null, + constraint pk_ebasic_json_jackson primary key (id) +); +create sequence ebasic_json_jackson_seq as bigint start with 1 increment by 50; + +create table ebasic_json_jackson2 ( + id numeric(19) not null, + name nvarchar(255), + value_set nvarchar(700), + value_list nvarchar(max), + value_map nvarchar(700), + plain_value nvarchar(500), + version numeric(19) not null, + constraint pk_ebasic_json_jackson2 primary key (id) +); +create sequence ebasic_json_jackson2_seq as bigint start with 1 increment by 50; + +create table ebasic_json_list ( + id numeric(19) not null, + name nvarchar(255), + bean_set nvarchar(700), + bean_list nvarchar(max), + bean_map nvarchar(700), + plain_bean nvarchar(500), + flags nvarchar(50), + tags nvarchar(100), + version numeric(19) not null, + constraint pk_ebasic_json_list primary key (id) +); +create sequence ebasic_json_list_seq as bigint start with 1 increment by 50; + +create table ebasic_json_map ( + id numeric(19) not null, + name nvarchar(255), + content nvarchar(max), + version numeric(19) not null, + constraint pk_ebasic_json_map primary key (id) +); +create sequence ebasic_json_map_seq as bigint start with 1 increment by 50; + +create table ebasic_json_map_blob ( + id numeric(19) not null, + name nvarchar(255), + content image, + version numeric(19) not null, + constraint pk_ebasic_json_map_blob primary key (id) +); +create sequence ebasic_json_map_blob_seq as bigint start with 1 increment by 50; + +create table ebasic_json_map_clob ( + id numeric(19) not null, + name nvarchar(255), + content nvarchar(max), + version numeric(19) not null, + constraint pk_ebasic_json_map_clob primary key (id) +); +create sequence ebasic_json_map_clob_seq as bigint start with 1 increment by 50; + +create table ebasic_json_map_detail ( + id numeric(19) not null, + owner_id numeric(19), + name nvarchar(255), + content nvarchar(max), + version numeric(19) not null, + constraint pk_ebasic_json_map_detail primary key (id) +); +create sequence ebasic_json_map_detail_seq as bigint start with 1 increment by 50; + +create table ebasic_json_map_json_b ( + id numeric(19) not null, + name nvarchar(255), + content nvarchar(max), + version numeric(19) not null, + constraint pk_ebasic_json_map_json_b primary key (id) +); +create sequence ebasic_json_map_json_b_seq as bigint start with 1 increment by 50; + +create table ebasic_json_map_varchar ( + id numeric(19) not null, + name nvarchar(255), + content nvarchar(3000), + version numeric(19) not null, + constraint pk_ebasic_json_map_varchar primary key (id) +); +create sequence ebasic_json_map_varchar_seq as bigint start with 1 increment by 50; + +create table ebasic_json_node ( + id numeric(19) not null, + name nvarchar(255), + content nvarchar(max), + version numeric(19) not null, + constraint pk_ebasic_json_node primary key (id) +); +create sequence ebasic_json_node_seq as bigint start with 1 increment by 50; + +create table ebasic_json_node_blob ( + id numeric(19) not null, + name nvarchar(255), + content image, + version numeric(19) not null, + constraint pk_ebasic_json_node_blob primary key (id) +); +create sequence ebasic_json_node_blob_seq as bigint start with 1 increment by 50; + +create table ebasic_json_node_json_b ( + id numeric(19) not null, + name nvarchar(255), + content nvarchar(max), + version numeric(19) not null, + constraint pk_ebasic_json_node_json_b primary key (id) +); +create sequence ebasic_json_node_json_b_seq as bigint start with 1 increment by 50; + +create table ebasic_json_node_varchar ( + id numeric(19) not null, + name nvarchar(255), + content nvarchar(1000), + version numeric(19) not null, + constraint pk_ebasic_json_node_varchar primary key (id) +); +create sequence ebasic_json_node_varchar_seq as bigint start with 1 increment by 50; + +create table ebasic_json_unmapped ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_ebasic_json_unmapped primary key (id) +); +create sequence ebasic_json_unmapped_seq as bigint start with 1 increment by 50; + +create table e_basic_ndc ( + id integer not null, + name nvarchar(255), + constraint pk_e_basic_ndc primary key (id) +); +create sequence e_basic_ndc_seq as bigint start with 1 increment by 50; + +create table ebasic_no_sdchild ( + id numeric(19) not null, + owner_id numeric(19) not null, + child_name nvarchar(255), + amount numeric(19) not null, + version numeric(19) not null, + constraint pk_ebasic_no_sdchild primary key (id) +); +create sequence ebasic_no_sdchild_seq as bigint start with 1 increment by 50; + +create table ebasic_sdchild ( + id numeric(19) not null, + owner_id numeric(19) not null, + child_name nvarchar(255), + amount numeric(19) not null, + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_ebasic_sdchild primary key (id) +); +create sequence ebasic_sdchild_seq as bigint start with 1 increment by 50; + +create table ebasic_soft_delete ( + id numeric(19) not null, + name nvarchar(255), + description nvarchar(255), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_ebasic_soft_delete primary key (id) +); +create sequence ebasic_soft_delete_seq as bigint start with 1 increment by 50; + +create table e_basicver ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + other nvarchar(255), + last_update datetime2 not null, + constraint pk_e_basicver primary key (id) +); +create sequence e_basicver_seq as bigint start with 1 increment by 50; + +create table e_basic_withlife ( + id numeric(19) not null, + name nvarchar(255), + other nvarchar(255), + deleted integer default 0 not null, + version numeric(19) not null, + constraint pk_e_basic_withlife primary key (id) +); +create sequence e_basic_withlife_seq as bigint start with 1 increment by 50; + +create table e_basic_with_ex ( + id numeric(19) not null, + deleted integer default 0 not null, + version numeric(19) not null, + constraint pk_e_basic_with_ex primary key (id) +); +create sequence e_basic_with_ex_seq as bigint start with 1 increment by 50; + +create table e_basicverucon ( + id integer not null, + name nvarchar(127), + other nvarchar(127), + other_one nvarchar(127), + description nvarchar(255), + last_update datetime2 not null, + constraint pk_e_basicverucon primary key (id) +); +create unique nonclustered index uq_e_basicverucon_name on e_basicverucon(name) where name is not null; +create unique nonclustered index uq_e_basicverucon_other_other_one on e_basicverucon(other,other_one) where other is not null and other_one is not null; +create sequence e_basicverucon_seq as bigint start with 1 increment by 50; + +create table ecache_child ( + id uniqueidentifier not null, + name nvarchar(100), + root_id uniqueidentifier not null, + constraint pk_ecache_child primary key (id) +); + +create table ecache_root ( + id uniqueidentifier not null, + name nvarchar(100), + constraint pk_ecache_root primary key (id) +); + +create table e_col_ab ( + id numeric(19) not null, + column_a nvarchar(255), + column_b nvarchar(255), + constraint pk_e_col_ab primary key (id) +); +create sequence e_col_ab_seq as bigint start with 1 increment by 50; + +create table ecustom_id ( + id nvarchar(127) not null, + name nvarchar(255), + constraint pk_ecustom_id primary key (id) +); + +create table edefault_prop ( + id integer not null, + e_simple_usertypeid integer, + name nvarchar(255), + constraint pk_edefault_prop primary key (id) +); +create unique nonclustered index uq_edefault_prop_e_simple_usertypeid on edefault_prop(e_simple_usertypeid) where e_simple_usertypeid is not null; +create sequence edefault_prop_seq as bigint start with 1 increment by 50; + +create table eemb_inner ( + id integer not null, + nome_inner nvarchar(255), + outer_id integer, + update_count integer not null, + constraint pk_eemb_inner primary key (id) +); +create sequence eemb_inner_seq as bigint start with 1 increment by 50; + +create table eemb_outer ( + id integer not null, + nome_outer nvarchar(255), + date1 datetime2, + date2 datetime2, + update_count integer not null, + constraint pk_eemb_outer primary key (id) +); +create sequence eemb_outer_seq as bigint start with 1 increment by 50; + +create table efile2_no_fk ( + file_name nvarchar(64) not null, + owner_id integer not null, + constraint pk_efile2_no_fk primary key (file_name) +); + +create table efile_no_fk ( + file_name nvarchar(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 nvarchar(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 nvarchar(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 numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + ts_created datetime2 not null, + ts_updated datetime2 not null, + ldt_created datetime2 not null, + ldt_updated datetime2 not null, + odt_created datetime2 not null, + odt_updated datetime2 not null, + zdt_created datetime2 not null, + zdt_updated datetime2 not null, + instant_created datetime2 not null, + instant_updated datetime2 not null, + long_created numeric(19) not null, + long_updated numeric(19) not null, + constraint pk_egen_props primary key (id) +); +create sequence egen_props_seq as bigint start with 1 increment by 50; + +create table eid_uid_bean ( + id numeric(19) not null, + uuid uniqueidentifier not null, + name nvarchar(255), + constraint uq_eid_uid_bean_uuid unique (uuid), + constraint pk_eid_uid_bean primary key (id) +); +create sequence eid_uid_bean_seq as bigint start with 1 increment by 50; + +create table einvoice ( + id numeric(19) not null, + invoice_date datetime2, + state integer, + person_id numeric(19), + ship_street nvarchar(255), + ship_suburb nvarchar(255), + ship_city nvarchar(255), + ship_status nvarchar(3), + bill_street nvarchar(255), + bill_suburb nvarchar(255), + bill_city nvarchar(255), + bill_status nvarchar(3), + version numeric(19) 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 sequence einvoice_seq as bigint start with 1 increment by 50; + +create table e_main ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + version numeric(19) not null, + constraint pk_e_main primary key (id) +); +create sequence e_main_seq as bigint start with 1 increment by 50; + +create table enull_collection ( + id integer not null, + name nvarchar(255), + constraint pk_enull_collection primary key (id) +); +create sequence enull_collection_seq as bigint start with 1 increment by 50; + +create table enull_collection_detail ( + id integer not null, + enull_collection_id integer not null, + something nvarchar(255), + constraint pk_enull_collection_detail primary key (id) +); +create sequence enull_collection_detail_seq as bigint start with 1 increment by 50; + +create table eopt_one_a ( + id integer not null, + name_for_a nvarchar(255), + b_id integer, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_eopt_one_a primary key (id) +); +create sequence eopt_one_a_seq as bigint start with 1 increment by 50; + +create table eopt_one_b ( + id integer not null, + name_for_b nvarchar(255), + c_id integer not null, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_eopt_one_b primary key (id) +); +create sequence eopt_one_b_seq as bigint start with 1 increment by 50; + +create table eopt_one_c ( + id integer not null, + name_for_c nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_eopt_one_c primary key (id) +); +create sequence eopt_one_c_seq as bigint start with 1 increment by 50; + +create table eper_addr ( + id numeric(19) not null, + name nvarchar(255), + ma_street nvarchar(255), + ma_suburb nvarchar(255), + ma_city nvarchar(255), + ma_country_code nvarchar(2), + version numeric(19) not null, + constraint pk_eper_addr primary key (id) +); +create sequence eper_addr_seq as bigint start with 1 increment by 50; + +create table eperson ( + id numeric(19) not null, + name nvarchar(255), + notes nvarchar(255), + street nvarchar(255), + suburb nvarchar(255), + addr_city nvarchar(255), + addr_status nvarchar(3), + version numeric(19) not null, + constraint ck_eperson_addr_status check ( addr_status in ('ONE','TWO')), + constraint pk_eperson primary key (id) +); +create sequence eperson_seq as bigint start with 1 increment by 50; + +create table e_person_online ( + id numeric(19) not null, + email nvarchar(127), + online_status integer default 0 not null, + when_updated datetime2 not null, + constraint pk_e_person_online primary key (id) +); +create unique nonclustered index uq_e_person_online_email on e_person_online(email) where email is not null; +create sequence e_person_online_seq as bigint start with 1 increment by 50; + +create table esimple ( + usertypeid integer identity(1,1) not null, + name nvarchar(255), + constraint pk_esimple primary key (usertypeid) +); + +create table esoft_del_book ( + id numeric(19) not null, + book_title nvarchar(255), + lend_by_id numeric(19), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esoft_del_book primary key (id) +); +create sequence esoft_del_book_seq as bigint start with 1 increment by 50; + +create table esoft_del_book_esoft_del_user ( + esoft_del_book_id numeric(19) not null, + esoft_del_user_id numeric(19) 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 numeric(19) not null, + esoft_del_mid_id numeric(19) not null, + down nvarchar(255), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esoft_del_down primary key (id) +); +create sequence esoft_del_down_seq as bigint start with 1 increment by 50; + +create table esoft_del_mid ( + id numeric(19) not null, + top_id numeric(19), + mid nvarchar(255), + up_id numeric(19), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esoft_del_mid primary key (id) +); +create sequence esoft_del_mid_seq as bigint start with 1 increment by 50; + +create table esoft_del_one_a ( + id numeric(19) not null, + name nvarchar(255), + oneb_id numeric(19), + deleted integer default 0 not null, + version numeric(19) not null, + constraint pk_esoft_del_one_a primary key (id) +); +create unique nonclustered index uq_esoft_del_one_a_oneb_id on esoft_del_one_a(oneb_id) where oneb_id is not null; +create sequence esoft_del_one_a_seq as bigint start with 1 increment by 50; + +create table esoft_del_one_b ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_esoft_del_one_b primary key (id) +); +create sequence esoft_del_one_b_seq as bigint start with 1 increment by 50; + +create table esoft_del_role ( + id numeric(19) not null, + role_name nvarchar(255), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esoft_del_role primary key (id) +); +create sequence esoft_del_role_seq as bigint start with 1 increment by 50; + +create table esoft_del_role_esoft_del_user ( + esoft_del_role_id numeric(19) not null, + esoft_del_user_id numeric(19) 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 numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esoft_del_top primary key (id) +); +create sequence esoft_del_top_seq as bigint start with 1 increment by 50; + +create table esoft_del_up ( + id numeric(19) not null, + up nvarchar(255), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esoft_del_up primary key (id) +); +create sequence esoft_del_up_seq as bigint start with 1 increment by 50; + +create table esoft_del_user ( + id numeric(19) not null, + user_name nvarchar(255), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esoft_del_user primary key (id) +); +create sequence esoft_del_user_seq as bigint start with 1 increment by 50; + +create table esoft_del_user_esoft_del_role ( + esoft_del_user_id numeric(19) not null, + esoft_del_role_id numeric(19) not null, + constraint pk_esoft_del_user_esoft_del_role primary key (esoft_del_user_id,esoft_del_role_id) +); + +create table esome_convert_type ( + id numeric(19) not null, + name nvarchar(255), + money numeric(28), + constraint pk_esome_convert_type primary key (id) +); +create sequence esome_convert_type_seq as bigint start with 1 increment by 50; + +create table esome_type ( + id integer not null, + currency nvarchar(3), + locale nvarchar(20), + time_zone nvarchar(20), + constraint pk_esome_type primary key (id) +); +create sequence esome_type_seq as bigint start with 1 increment by 50; + +create table etrans_many ( + id integer not null, + name nvarchar(255), + constraint pk_etrans_many primary key (id) +); +create sequence etrans_many_seq as bigint start with 1 increment by 50; + +create table rawinherit_uncle ( + id integer not null, + name nvarchar(255), + parent_id numeric(19) not null, + version numeric(19) not null, + constraint pk_rawinherit_uncle primary key (id) +); +create sequence rawinherit_uncle_seq as bigint start with 1 increment by 50; + +create table euser_no_fk ( + user_id integer not null, + user_name nvarchar(255), + constraint pk_euser_no_fk primary key (user_id) +); +create sequence euser_no_fk_seq as bigint start with 1 increment by 50; + +create table euser_no_fk_soft_del ( + user_id integer not null, + user_name nvarchar(255), + constraint pk_euser_no_fk_soft_del primary key (user_id) +); +create sequence euser_no_fk_soft_del_seq as bigint start with 1 increment by 50; + +create table evanilla_collection ( + id integer not null, + name nvarchar(255), + constraint pk_evanilla_collection primary key (id) +); +create sequence evanilla_collection_seq as bigint start with 1 increment by 50; + +create table evanilla_collection_detail ( + id integer not null, + evanilla_collection_id integer not null, + something nvarchar(255), + constraint pk_evanilla_collection_detail primary key (id) +); +create sequence evanilla_collection_detail_seq as bigint start with 1 increment by 50; + +create table ewho_props ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + who_created nvarchar(255) not null, + who_modified nvarchar(255) not null, + constraint pk_ewho_props primary key (id) +); +create sequence ewho_props_seq as bigint start with 1 increment by 50; + +create table e_withinet ( + id numeric(19) not null, + name nvarchar(255), + inet_address nvarchar(50), + inet2 nvarchar(255), + cidr varchar(50), + version numeric(19) not null, + constraint pk_e_withinet primary key (id) +); +create sequence e_withinet_seq as bigint start with 1 increment by 50; + +create table ec_enum_person ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_ec_enum_person primary key (id) +); +create sequence ec_enum_person_seq as bigint start with 1 increment by 50; + +create table ec_enum_person_tags ( + ec_enum_person_id numeric(19) not null, + value nvarchar(5) not null, + constraint ck_ec_enum_person_tags_value check ( value in ('RED','BLUE','GREEN')) +); + +create table ec_person ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_ec_person primary key (id) +); +create sequence ec_person_seq as bigint start with 1 increment by 50; + +create table ec_person_phone ( + owner_id numeric(19) not null, + phone nvarchar(255) not null +); + +create table ec_top ( + id numeric(19) not null, + name nvarchar(255), + person_id numeric(19), + version numeric(19) not null, + constraint pk_ec_top primary key (id) +); +create sequence ec_top_seq as bigint start with 1 increment by 50; + +create table ec_top_ecs_person ( + ec_top_id numeric(19) not null, + ecs_person_id numeric(19) not null, + constraint pk_ec_top_ecs_person primary key (ec_top_id,ecs_person_id) +); + +create table ecbl_person ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_ecbl_person primary key (id) +); +create sequence ecbl_person_seq as bigint start with 1 increment by 50; + +create table ecbl_person_phone_numbers ( + person_id numeric(19) not null, + country_code nvarchar(2), + area nvarchar(6), + phnum nvarchar(20) +); + +create table ecbm_person ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_ecbm_person primary key (id) +); +create sequence ecbm_person_seq as bigint start with 1 increment by 50; + +create table ecbm_person_phone_numbers ( + person_id numeric(19) not null, + mkey nvarchar(255) not null, + country_code nvarchar(2), + area nvarchar(6), + phnum nvarchar(20) +); + +create table ecm_person ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_ecm_person primary key (id) +); +create sequence ecm_person_seq as bigint start with 1 increment by 50; + +create table ecm_person_phone_numbers ( + ecm_person_id numeric(19) not null, + type nvarchar(4) not null, + phnum nvarchar(10) not null +); + +create table ecmc_person ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_ecmc_person primary key (id) +); +create sequence ecmc_person_seq as bigint start with 1 increment by 50; + +create table ecmc_person_phone_numbers ( + ecmc_person_id numeric(19) not null, + type nvarchar(4) not null, + value nvarchar(max) not null +); + +create table ecs_person ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_ecs_person primary key (id) +); +create sequence ecs_person_seq as bigint start with 1 increment by 50; + +create table ecs_person_phone ( + ecs_person_id numeric(19) not null, + phone nvarchar(255) not null +); + +create table ecsm_child ( + one_id uniqueidentifier not null, + ecsm_parent_id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_ecsm_child primary key (one_id) +); + +create table ecsm_values ( + host_id uniqueidentifier not null, + value nvarchar(255) not null +); + +create table ecsm_one ( + one_id uniqueidentifier not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_ecsm_one primary key (one_id) +); + +create table ecsm_parent ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_ecsm_parent primary key (id) +); +create sequence ecsm_parent_seq as bigint start with 1 increment by 50; + +create table ecsm_two ( + id uniqueidentifier not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_ecsm_two primary key (id) +); + +create table td_child ( + child_id integer not null, + child_name nvarchar(255), + parent_id integer not null, + constraint pk_td_child primary key (child_id) +); +create sequence td_child_seq as bigint start with 1 increment by 50; + +create table td_parent ( + parent_type nvarchar(31) not null, + parent_id integer not null, + parent_name nvarchar(255), + extended_name nvarchar(255), + constraint pk_td_parent primary key (parent_id) +); +create sequence td_parent_seq as bigint start with 1 increment by 50; + +create table element_bean ( + id numeric(19) not null, + complex_bean_id uniqueidentifier not null, + value nvarchar(255) not null, + constraint pk_element_bean primary key (id) +); +create sequence element_bean_seq as bigint start with 1 increment by 50; + +create table empl ( + id numeric(19) not null, + name nvarchar(255), + age integer, + default_address_id numeric(19), + constraint pk_empl primary key (id) +); +create sequence empl_seq as bigint start with 1 increment by 50; + +create table esd_detail ( + id numeric(19) not null, + name nvarchar(255), + master_id numeric(19) not null, + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esd_detail primary key (id) +); +create sequence esd_detail_seq as bigint start with 1 increment by 50; + +create table esd_master ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esd_master primary key (id) +); +create sequence esd_master_seq as bigint start with 1 increment by 50; + +create table feature_desc ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + constraint pk_feature_desc primary key (id) +); +create sequence feature_desc_seq as bigint start with 1 increment by 50; + +create table f_first ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_f_first primary key (id) +); +create sequence f_first_seq as bigint start with 1 increment by 50; + +create table foo ( + foo_id integer not null, + important_text nvarchar(255), + version integer not null, + constraint pk_foo primary key (foo_id) +); +create sequence foo_seq as bigint start with 1 increment by 50; + +create table gen_key_identity ( + id numeric(19) identity(1,1) not null, + description nvarchar(255), + constraint pk_gen_key_identity primary key (id) +); + +create table gen_key_sequence ( + id numeric(19) not null, + description nvarchar(255), + constraint pk_gen_key_sequence primary key (id) +); +create sequence gen_key_sequence_seq as bigint start with 1 increment by 50; + +create table gen_key_table ( + id numeric(19) not null, + description nvarchar(255), + constraint pk_gen_key_table primary key (id) +); +create sequence gen_key_table_seq as bigint start with 1 increment by 50; + +create table grand_parent_person ( + identifier integer not null, + name nvarchar(255), + age integer, + some_bean_id integer, + family_name nvarchar(255), + address nvarchar(255), + constraint pk_grand_parent_person primary key (identifier) +); +create sequence grand_parent_person_seq as bigint start with 1 increment by 50; + +create table survey_group ( + id numeric(19) not null, + name nvarchar(255), + categoryobjectid numeric(19), + sequence_number integer not null, + constraint pk_survey_group primary key (id) +); +create sequence survey_group_seq as bigint start with 1 increment by 50; + +create table c_group ( + id numeric(19) not null, + inactive integer default 0 not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_c_group primary key (id) +); +create sequence c_group_seq as bigint start with 1 increment by 50; + +create table he_doc ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_he_doc primary key (id) +); +create sequence he_doc_seq as bigint start with 1 increment by 50; + +create table hx_link ( + id numeric(19) not null, + name nvarchar(255), + location nvarchar(255), + comments nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + deleted integer default 0 not null, + constraint pk_hx_link primary key (id) +); +create sequence hx_link_seq as bigint start with 1 increment by 50; + +create table hx_link_doc ( + hx_link_id numeric(19) not null, + he_doc_id numeric(19) not null, + constraint pk_hx_link_doc primary key (hx_link_id,he_doc_id) +); + +create table hi_doc ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_hi_doc primary key (id) +); +create sequence hi_doc_seq as bigint start with 1 increment by 50; + +create table hi_link ( + id numeric(19) not null, + name nvarchar(255), + location nvarchar(255), + comments nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_hi_link primary key (id) +); +create sequence hi_link_seq as bigint start with 1 increment by 50; + +create table hi_link_doc ( + hi_link_id numeric(19) not null, + hi_doc_id numeric(19) not null, + constraint pk_hi_link_doc primary key (hi_link_id,hi_doc_id) +); + +create table hi_tone ( + id numeric(19) not null, + name nvarchar(255), + comments nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_hi_tone primary key (id) +); +create sequence hi_tone_seq as bigint start with 1 increment by 50; + +create table hi_tthree ( + id numeric(19) not null, + hi_ttwo_id numeric(19) not null, + three nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_hi_tthree primary key (id) +); +create sequence hi_tthree_seq as bigint start with 1 increment by 50; + +create table hi_ttwo ( + id numeric(19) not null, + hi_tone_id numeric(19) not null, + two nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_hi_ttwo primary key (id) +); +create sequence hi_ttwo_seq as bigint start with 1 increment by 50; + +create table hsd_setting ( + id numeric(19) not null, + code nvarchar(255), + content nvarchar(255), + user_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + deleted integer default 0 not null, + constraint pk_hsd_setting primary key (id) +); +create unique nonclustered index uq_hsd_setting_user_id on hsd_setting(user_id) where user_id is not null; +create sequence hsd_setting_seq as bigint start with 1 increment by 50; + +create table hsd_user ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + deleted integer default 0 not null, + constraint pk_hsd_user primary key (id) +); +create sequence hsd_user_seq as bigint start with 1 increment by 50; + +create table iaf_segment ( + ptype nvarchar(31) not null, + id numeric(19) not null, + segment_id_zat numeric(19) not null, + status_id numeric(19) not null, + constraint pk_iaf_segment primary key (id) +); +create sequence iaf_segment_seq as bigint start with 1 increment by 50; + +create table iaf_segment_status ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_iaf_segment_status primary key (id) +); +create sequence iaf_segment_status_seq as bigint start with 1 increment by 50; + +create table imrelated ( + id numeric(19) not null, + name nvarchar(255), + owner_id numeric(19) not null, + constraint pk_imrelated primary key (id) +); +create sequence imrelated_seq as bigint start with 1 increment by 50; + +create table imroot ( + dtype nvarchar(31) not null, + id numeric(19) not null, + name nvarchar(255), + title nvarchar(255), + when_title datetime2, + constraint pk_imroot primary key (id) +); +create sequence imroot_seq as bigint start with 1 increment by 50; + +create table ixresource ( + dtype nvarchar(255), + id uniqueidentifier not null, + name nvarchar(255), + constraint pk_ixresource primary key (id) +); + +create table info_company ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_info_company primary key (id) +); +create sequence info_company_seq as bigint start with 1 increment by 50; + +create table info_contact ( + id numeric(19) not null, + name nvarchar(255), + company_id numeric(19) not null, + version numeric(19) not null, + constraint pk_info_contact primary key (id) +); +create sequence info_contact_seq as bigint start with 1 increment by 50; + +create table info_customer ( + id numeric(19) not null, + name nvarchar(255), + company_id numeric(19), + version numeric(19) not null, + constraint pk_info_customer primary key (id) +); +create unique nonclustered index uq_info_customer_company_id on info_customer(company_id) where company_id is not null; +create sequence info_customer_seq as bigint start with 1 increment by 50; + +create table inner_report ( + id numeric(19) not null, + name nvarchar(255), + forecast_id numeric(19), + constraint pk_inner_report primary key (id) +); +create unique nonclustered index uq_inner_report_forecast_id on inner_report(forecast_id) where forecast_id is not null; +create sequence inner_report_seq as bigint start with 1 increment by 50; + +create table drel_invoice ( + id numeric(19) not null, + booking numeric(19), + version integer not null, + constraint pk_drel_invoice primary key (id) +); +create sequence drel_invoice_seq as bigint start with 1 increment by 50; + +create table item ( + customer integer not null, + itemnumber nvarchar(127) not null, + description nvarchar(255), + units nvarchar(255), + type integer not null, + region integer not null, + date_modified datetime2, + date_created datetime2, + modified_by nvarchar(255), + created_by nvarchar(255), + version numeric(19) not null, + constraint pk_item primary key (customer,itemnumber) +); + +create table monkey ( + mid numeric(19) not null, + name nvarchar(255), + food_preference nvarchar(255), + version numeric(19) not null, + constraint pk_monkey primary key (mid) +); +create sequence monkey_seq as bigint start with 1 increment by 50; + +create table mkeygroup ( + pid numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_mkeygroup primary key (pid) +); +create sequence mkeygroup_seq as bigint start with 1 increment by 50; + +create table mkeygroup_monkey ( + mkeygroup_pid numeric(19) not null, + monkey_mid numeric(19) not null, + constraint uq_mkeygroup_monkey_mid unique (monkey_mid), + constraint pk_mkeygroup_monkey primary key (mkeygroup_pid,monkey_mid) +); + +create table trainer ( + tid numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_trainer primary key (tid) +); +create sequence trainer_seq as bigint start with 1 increment by 50; + +create table trainer_monkey ( + trainer_tid numeric(19) not null, + monkey_mid numeric(19) not null, + constraint uq_trainer_monkey_mid unique (monkey_mid), + constraint pk_trainer_monkey primary key (trainer_tid,monkey_mid) +); + +create table troop ( + pid numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_troop primary key (pid) +); +create sequence troop_seq as bigint start with 1 increment by 50; + +create table troop_monkey ( + troop_pid numeric(19) not null, + monkey_mid numeric(19) 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 numeric(19) not null, + name nvarchar(255), + constraint pk_l2_cldf_reset_bean primary key (id) +); +create sequence l2_cldf_reset_bean_seq as bigint start with 1 increment by 50; + +create table l2_cldf_reset_bean_child ( + id numeric(19) not null, + parent_id numeric(19), + constraint pk_l2_cldf_reset_bean_child primary key (id) +); +create sequence l2_cldf_reset_bean_child_seq as bigint start with 1 increment by 50; + +create table level1 ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_level1 primary key (id) +); +create sequence level1_seq as bigint start with 1 increment by 50; + +create table level1_level4 ( + level1_id numeric(19) not null, + level4_id numeric(19) not null, + constraint pk_level1_level4 primary key (level1_id,level4_id) +); + +create table level1_level2 ( + level1_id numeric(19) not null, + level2_id numeric(19) not null, + constraint pk_level1_level2 primary key (level1_id,level2_id) +); + +create table level2 ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_level2 primary key (id) +); +create sequence level2_seq as bigint start with 1 increment by 50; + +create table level2_level3 ( + level2_id numeric(19) not null, + level3_id numeric(19) not null, + constraint pk_level2_level3 primary key (level2_id,level3_id) +); + +create table level3 ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_level3 primary key (id) +); +create sequence level3_seq as bigint start with 1 increment by 50; + +create table level4 ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_level4 primary key (id) +); +create sequence level4_seq as bigint start with 1 increment by 50; + +create table link ( + id numeric(19) not null, + name nvarchar(255), + location nvarchar(255), + when_publish datetime2, + link_comment nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + deleted integer default 0 not null, + constraint pk_link primary key (id) +); +create sequence link_seq as bigint start with 1 increment by 50; + +create table link_draft ( + id numeric(19) not null, + name nvarchar(255), + location nvarchar(255), + when_publish datetime2, + link_comment nvarchar(255), + dirty integer default 0 not null, + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + deleted integer default 0 not null, + constraint pk_link_draft primary key (id) +); +create sequence link_draft_seq as bigint start with 1 increment by 50; + +create table la_attr_value ( + id integer not null, + name nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_la_attr_value primary key (id) +); +create sequence la_attr_value_seq as bigint start with 1 increment by 50; + +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 numeric(19) not null, + tune_id numeric(19), + name nvarchar(255), + constraint pk_looney primary key (id) +); +create sequence looney_seq as bigint start with 1 increment by 50; + +create table maddress ( + id uniqueidentifier not null, + street nvarchar(255), + city nvarchar(255), + version numeric(19) not null, + constraint pk_maddress primary key (id) +); + +create table mcontact ( + id uniqueidentifier not null, + email nvarchar(255), + first_name nvarchar(255), + last_name nvarchar(255), + customer_id uniqueidentifier, + version numeric(19) not null, + constraint pk_mcontact primary key (id) +); + +create table mcontact_message ( + id uniqueidentifier not null, + title nvarchar(255), + subject nvarchar(255), + notes nvarchar(255), + contact_id uniqueidentifier not null, + version numeric(19) not null, + constraint pk_mcontact_message primary key (id) +); + +create table mcustomer ( + id uniqueidentifier not null, + name nvarchar(255), + notes nvarchar(255), + shipping_address_id uniqueidentifier, + billing_address_id uniqueidentifier, + version numeric(19) not null, + constraint pk_mcustomer primary key (id) +); + +create table mgroup ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_mgroup primary key (id) +); +create sequence mgroup_seq as bigint start with 1 increment by 50; + +create table mmachine ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_mmachine primary key (id) +); +create sequence mmachine_seq as bigint start with 1 increment by 50; + +create table mmachine_mgroup ( + mmachine_id numeric(19) not null, + mgroup_id numeric(19) not null, + constraint pk_mmachine_mgroup primary key (mmachine_id,mgroup_id) +); + +create table mmedia ( + type nvarchar(31) not null, + id numeric(19) not null, + url nvarchar(255), + note nvarchar(255), + constraint pk_mmedia primary key (id) +); +create sequence mmedia_seq as bigint start with 1 increment by 50; + +create table non_updateprop ( + id integer not null, + non_enum nvarchar(5), + name nvarchar(255), + note nvarchar(255), + constraint ck_non_updateprop_non_enum check ( non_enum in ('BEGIN','END')), + constraint pk_non_updateprop primary key (id) +); +create sequence non_updateprop_seq as bigint start with 1 increment by 50; + +create table mprinter ( + id numeric(19) not null, + name nvarchar(255), + flags numeric(19) not null, + current_state_id numeric(19), + last_swap_cyan_id numeric(19), + last_swap_magenta_id numeric(19), + last_swap_yellow_id numeric(19), + last_swap_black_id numeric(19), + version numeric(19) not null, + constraint pk_mprinter primary key (id) +); +create unique nonclustered index uq_mprinter_last_swap_cyan_id on mprinter(last_swap_cyan_id) where last_swap_cyan_id is not null; +create unique nonclustered index uq_mprinter_last_swap_magenta_id on mprinter(last_swap_magenta_id) where last_swap_magenta_id is not null; +create unique nonclustered index uq_mprinter_last_swap_yellow_id on mprinter(last_swap_yellow_id) where last_swap_yellow_id is not null; +create unique nonclustered index uq_mprinter_last_swap_black_id on mprinter(last_swap_black_id) where last_swap_black_id is not null; +create sequence mprinter_seq as bigint start with 1 increment by 50; + +create table mprinter_state ( + id numeric(19) not null, + flags numeric(19) not null, + printer_id numeric(19), + version numeric(19) not null, + constraint pk_mprinter_state primary key (id) +); +create sequence mprinter_state_seq as bigint start with 1 increment by 50; + +create table mprofile ( + id numeric(19) not null, + picture_id numeric(19), + name nvarchar(255), + constraint pk_mprofile primary key (id) +); +create sequence mprofile_seq as bigint start with 1 increment by 50; + +create table mprotected_construct_bean ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_mprotected_construct_bean primary key (id) +); +create sequence mprotected_construct_bean_seq as bigint start with 1 increment by 50; + +create table mrole ( + roleid integer not null, + role_name nvarchar(255), + constraint pk_mrole primary key (roleid) +); +create sequence mrole_seq as bigint start with 1 increment by 50; + +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 numeric(19) not null, + name nvarchar(255), + constraint pk_msome_other primary key (id) +); +create sequence msome_other_seq as bigint start with 1 increment by 50; + +create table muser ( + userid integer not null, + user_name nvarchar(255), + user_type_id integer, + constraint pk_muser primary key (userid) +); +create sequence muser_seq as bigint start with 1 increment by 50; + +create table muser_type ( + id integer not null, + name nvarchar(255), + constraint pk_muser_type primary key (id) +); +create sequence muser_type_seq as bigint start with 1 increment by 50; + +create table mail_box ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_mail_box primary key (id) +); +create sequence mail_box_seq as bigint start with 1 increment by 50; + +create table mail_user ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_mail_user primary key (id) +); +create sequence mail_user_seq as bigint start with 1 increment by 50; + +create table mail_user_inbox ( + mail_user_id numeric(19) not null, + mail_box_id numeric(19) not null, + constraint pk_mail_user_inbox primary key (mail_user_id,mail_box_id) +); + +create table mail_user_outbox ( + mail_user_id numeric(19) not null, + mail_box_id numeric(19) not null, + constraint pk_mail_user_outbox primary key (mail_user_id,mail_box_id) +); + +create table main_entity ( + id nvarchar(255) not null, + attr1 nvarchar(255), + attr2 nvarchar(255), + constraint pk_main_entity primary key (id) +); + +create table main_entity_relation ( + id uniqueidentifier not null, + id1 nvarchar(255), + id2 nvarchar(255), + attr1 nvarchar(255), + constraint pk_main_entity_relation primary key (id) +); + +create table map_super_actual ( + id numeric(19) not null, + name nvarchar(255), + when_created datetime2 not null, + when_updated datetime2 not null, + constraint pk_map_super_actual primary key (id) +); +create sequence map_super_actual_seq as bigint start with 1 increment by 50; + +create table c_message ( + id numeric(19) not null, + title nvarchar(255), + body nvarchar(255), + conversation_id numeric(19), + user_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_c_message primary key (id) +); +create sequence c_message_seq as bigint start with 1 increment by 50; + +create table meter_address_data ( + id uniqueidentifier not null, + street nvarchar(255) not null, + constraint pk_meter_address_data primary key (id) +); + +create table meter_contract_data ( + id uniqueidentifier not null, + special_needs_client_id uniqueidentifier 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 uniqueidentifier not null, + name nvarchar(255), + primary_id uniqueidentifier, + constraint pk_meter_special_needs_client primary key (id) +); +create unique nonclustered index uq_meter_special_needs_client_primary_id on meter_special_needs_client(primary_id) where primary_id is not null; + +create table meter_special_needs_contact ( + id uniqueidentifier not null, + name nvarchar(255), + constraint pk_meter_special_needs_contact primary key (id) +); + +create table meter_version ( + id uniqueidentifier not null, + address_data_id uniqueidentifier, + contract_data_id uniqueidentifier not null, + constraint uq_meter_version_contract_data_id unique (contract_data_id), + constraint pk_meter_version primary key (id) +); +create unique nonclustered index uq_meter_version_address_data_id on meter_version(address_data_id) where address_data_id is not null; + +create table mnoc_role ( + role_id integer not null, + role_name nvarchar(255), + version integer not null, + constraint pk_mnoc_role primary key (role_id) +); +create sequence mnoc_role_seq as bigint start with 1 increment by 50; + +create table mnoc_user ( + user_id integer not null, + user_name nvarchar(255), + version integer not null, + constraint pk_mnoc_user primary key (user_id) +); +create sequence mnoc_user_seq as bigint start with 1 increment by 50; + +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 numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_mny_a primary key (id) +); +create sequence mny_a_seq as bigint start with 1 increment by 50; + +create table mny_b ( + id numeric(19) not null, + name nvarchar(255), + a_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_mny_b primary key (id) +); +create sequence mny_b_seq as bigint start with 1 increment by 50; + +create table mny_b_mny_c ( + mny_b_id numeric(19) not null, + mny_c_id numeric(19) not null, + constraint pk_mny_b_mny_c primary key (mny_b_id,mny_c_id) +); + +create table mny_c ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_mny_c primary key (id) +); +create sequence mny_c_seq as bigint start with 1 increment by 50; + +create table mny_topic ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_mny_topic primary key (id) +); +create sequence mny_topic_seq as bigint start with 1 increment by 50; + +create table subtopics ( + topic numeric(19) not null, + subtopic numeric(19) not null, + constraint pk_subtopics primary key (topic,subtopic) +); + +create table mp_role ( + id numeric(19) not null, + mp_user_id numeric(19) not null, + code nvarchar(255), + organization_id numeric(19), + constraint pk_mp_role primary key (id) +); +create sequence mp_role_seq as bigint start with 1 increment by 50; + +create table mp_user ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_mp_user primary key (id) +); +create sequence mp_user_seq as bigint start with 1 increment by 50; + +create table ms_many_a ( + aid numeric(19) not null, + name nvarchar(255), + ms_many_a_many_b integer default 0 not null, + ms_many_b integer default 0 not null, + deleted integer default 0 not null, + constraint pk_ms_many_a primary key (aid) +); +create sequence ms_many_a_seq as bigint start with 1 increment by 50; + +create table ms_many_a_many_b ( + ms_many_a_aid numeric(19) not null, + ms_many_b_bid numeric(19) 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 numeric(19) not null, + name nvarchar(255), + deleted integer default 0 not null, + constraint pk_ms_many_b primary key (bid) +); +create sequence ms_many_b_seq as bigint start with 1 increment by 50; + +create table ms_many_b_many_a ( + ms_many_b_bid numeric(19) not null, + ms_many_a_aid numeric(19) 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 not null, + name nvarchar(255), + my_count integer not null, + my_lob nvarchar(max), + constraint pk_my_lob_size primary key (id) +); +create sequence my_lob_size_seq as bigint start with 1 increment by 50; + +create table my_lob_size_join_many ( + id integer not null, + something nvarchar(255), + other nvarchar(255), + parent_id integer, + constraint pk_my_lob_size_join_many primary key (id) +); +create sequence my_lob_size_join_many_seq as bigint start with 1 increment by 50; + +create table noidbean ( + name nvarchar(255), + subject nvarchar(255), + when_created datetime2 not null +); + +create table o_bean_child ( + id numeric(19) not null, + cached_bean_id numeric(19), + constraint pk_o_bean_child primary key (id) +); +create sequence o_bean_child_seq as bigint start with 1 increment by 50; + +create table ocached_app ( + id numeric(19) not null, + app_name nvarchar(255), + version numeric(19) not null, + constraint pk_ocached_app primary key (id) +); +create unique nonclustered index uq_ocached_app_app_name on ocached_app(app_name) where app_name is not null; +create sequence ocached_app_seq as bigint start with 1 increment by 50; + +create table ocached_app_detail ( + id numeric(19) not null, + app_id numeric(19) not null, + detail nvarchar(255), + version numeric(19) not null, + constraint pk_ocached_app_detail primary key (id) +); +create unique nonclustered index uq_ocached_app_detail_app_id_detail on ocached_app_detail(app_id,detail) where detail is not null; +create sequence ocached_app_detail_seq as bigint start with 1 increment by 50; + +create table o_cached_bean ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_o_cached_bean primary key (id) +); +create sequence o_cached_bean_seq as bigint start with 1 increment by 50; + +create table o_cached_bean_country ( + o_cached_bean_id numeric(19) not null, + o_country_code nvarchar(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 numeric(19) not null, + cached_bean_id numeric(19), + constraint pk_o_cached_bean_child primary key (id) +); +create sequence o_cached_bean_child_seq as bigint start with 1 increment by 50; + +create table o_cached_inherit ( + dtype nvarchar(31) not null, + id numeric(19) not null, + name nvarchar(255), + child_adata nvarchar(255), + child_bdata nvarchar(255), + constraint pk_o_cached_inherit primary key (id) +); +create sequence o_cached_inherit_seq as bigint start with 1 increment by 50; + +create table o_cached_natkey ( + id numeric(19) not null, + store nvarchar(255), + sku nvarchar(255), + description nvarchar(255), + constraint pk_o_cached_natkey primary key (id) +); +create sequence o_cached_natkey_seq as bigint start with 1 increment by 50; + +create table o_cached_natkey3 ( + id numeric(19) not null, + store nvarchar(255), + code integer not null, + sku nvarchar(255), + description nvarchar(255), + constraint pk_o_cached_natkey3 primary key (id) +); +create sequence o_cached_natkey3_seq as bigint start with 1 increment by 50; + +create table ocached_nkey_uid ( + id numeric(19) not null, + cid uniqueidentifier, + other nvarchar(255), + version numeric(19) not null, + constraint pk_ocached_nkey_uid primary key (id) +); +create sequence ocached_nkey_uid_seq as bigint start with 1 increment by 50; + +create table ocar ( + id integer not null, + vin nvarchar(255), + name nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_ocar primary key (id) +); +create sequence ocar_seq as bigint start with 1 increment by 50; + +create table ocompany ( + id integer not null, + corp_id nvarchar(50), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_ocompany primary key (id) +); +create unique nonclustered index uq_ocompany_corp_id on ocompany(corp_id) where corp_id is not null; +create sequence ocompany_seq as bigint start with 1 increment by 50; + +create table oengine ( + engine_id uniqueidentifier not null, + short_desc nvarchar(255), + car_id integer, + version integer not null, + constraint pk_oengine primary key (engine_id) +); +create unique nonclustered index uq_oengine_car_id on oengine(car_id) where car_id is not null; + +create table ogear_box ( + id uniqueidentifier not null, + box_desc nvarchar(255), + box_size integer, + car_id integer, + version integer not null, + constraint pk_ogear_box primary key (id) +); +create unique nonclustered index uq_ogear_box_car_id on ogear_box(car_id) where car_id is not null; + +create table omvertex ( + id uniqueidentifier not null, + constraint pk_omvertex primary key (id) +); + +create table omvertex_other ( + id uniqueidentifier not null, + omvertex_id uniqueidentifier not null, + name nvarchar(255), + constraint pk_omvertex_other primary key (id) +); + +create table oroad_show_msg ( + id integer not null, + company_id integer not null, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint uq_oroad_show_msg_company_id unique (company_id), + constraint pk_oroad_show_msg primary key (id) +); +create sequence oroad_show_msg_seq as bigint start with 1 increment by 50; + +create table om_account_child_dbo ( + id numeric(19) not null, + description nvarchar(255), + banana_rama_id numeric(19), + constraint pk_om_account_child_dbo primary key (id) +); +create sequence om_account_child_dbo_seq as bigint start with 1 increment by 50; + +create table om_account_dbo ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_om_account_dbo primary key (id) +); +create sequence om_account_dbo_seq as bigint start with 1 increment by 50; + +create table om_basic_child ( + id numeric(19) not null, + name nvarchar(255), + parent_id numeric(19), + version numeric(19) not null, + constraint pk_om_basic_child primary key (id) +); +create sequence om_basic_child_seq as bigint start with 1 increment by 50; + +create table om_basic_parent ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_om_basic_parent primary key (id) +); +create sequence om_basic_parent_seq as bigint start with 1 increment by 50; + +create table om_ordered_detail ( + id numeric(19) not null, + name nvarchar(255), + master_id numeric(19), + version numeric(19) not null, + sort_order integer, + constraint pk_om_ordered_detail primary key (id) +); +create sequence om_ordered_detail_seq as bigint start with 1 increment by 50; + +create table om_ordered_master ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_om_ordered_master primary key (id) +); +create sequence om_ordered_master_seq as bigint start with 1 increment by 50; + +create table only_id_entity ( + id numeric(19) not null, + constraint pk_only_id_entity primary key (id) +); +create sequence only_id_entity_seq as bigint start with 1 increment by 50; + +create table o_order ( + id integer not null, + status integer, + order_date date, + ship_date date, + kcustomer_id integer not null, + cretime datetime2 not null, + updtime datetime2 not null, + constraint ck_o_order_status check ( status in (0,1,2,3)), + constraint pk_o_order primary key (id) +); +create sequence o_order_seq as bigint start with 1 increment by 50; + +create table o_order_detail ( + id integer not null, + order_id integer not null, + order_qty integer, + ship_qty integer, + unit_price float(32), + product_id integer, + cretime datetime2, + updtime datetime2 not null, + constraint pk_o_order_detail primary key (id) +); +create sequence o_order_detail_seq as bigint start with 1 increment by 50; + +create table s_orders ( + uuid nvarchar(40) not null, + constraint pk_s_orders primary key (uuid) +); + +create table s_order_items ( + uuid nvarchar(40) not null, + product_variant_uuid nvarchar(255), + order_uuid nvarchar(40), + quantity integer not null, + amount numeric(28), + constraint pk_s_order_items primary key (uuid) +); + +create table or_order_ship ( + id integer not null, + order_id integer, + ship_time datetime2, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_or_order_ship primary key (id) +); +create sequence or_order_ship_seq as bigint start with 1 increment by 50; + +create table organisation ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_organisation primary key (id) +); +create sequence organisation_seq as bigint start with 1 increment by 50; + +create table organization_node ( + kind nvarchar(31) not null, + id numeric(19) not null, + parent_tree_node_id numeric(19) not null, + title nvarchar(255), + constraint uq_organization_node_parent_tree_node_id unique (parent_tree_node_id), + constraint pk_organization_node primary key (id) +); +create sequence organization_node_seq as bigint start with 1 increment by 50; + +create table organization_tree_node ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_organization_tree_node primary key (id) +); +create sequence organization_tree_node_seq as bigint start with 1 increment by 50; + +create table orp_detail ( + id nvarchar(100) not null, + detail nvarchar(255), + master_id nvarchar(100), + version numeric(19) not null, + constraint pk_orp_detail primary key (id) +); + +create table orp_detail2 ( + id nvarchar(100) not null, + orp_master2_id nvarchar(100) not null, + detail nvarchar(255), + master_id nvarchar(255), + version numeric(19) not null, + constraint pk_orp_detail2 primary key (id) +); + +create table orp_master ( + id nvarchar(100) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_orp_master primary key (id) +); + +create table orp_master2 ( + id nvarchar(100) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_orp_master2 primary key (id) +); + +create table oto_aone ( + id nvarchar(100) not null, + description nvarchar(255), + constraint pk_oto_aone primary key (id) +); + +create table oto_atwo ( + id nvarchar(100) not null, + description nvarchar(255), + aone_id nvarchar(100), + constraint pk_oto_atwo primary key (id) +); +create unique nonclustered index uq_oto_atwo_aone_id on oto_atwo(aone_id) where aone_id is not null; + +create table oto_bchild ( + master_id numeric(19) not null, + child nvarchar(255), + constraint pk_oto_bchild primary key (master_id) +); +create sequence oto_bchild_seq as bigint start with 1 increment by 50; + +create table oto_bmaster ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_oto_bmaster primary key (id) +); +create sequence oto_bmaster_seq as bigint start with 1 increment by 50; + +create table oto_child ( + id integer not null, + name nvarchar(255), + master_id numeric(19), + constraint pk_oto_child primary key (id) +); +create unique nonclustered index uq_oto_child_master_id on oto_child(master_id) where master_id is not null; +create sequence oto_child_seq as bigint start with 1 increment by 50; + +create table oto_cust ( + cid numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_oto_cust primary key (cid) +); +create sequence oto_cust_seq as bigint start with 1 increment by 50; + +create table oto_cust_address ( + aid numeric(19) not null, + line1 nvarchar(255), + line2 nvarchar(255), + line3 nvarchar(255), + customer_cid numeric(19), + version numeric(19) not null, + constraint pk_oto_cust_address primary key (aid) +); +create unique nonclustered index uq_oto_cust_address_customer_cid on oto_cust_address(customer_cid) where customer_cid is not null; +create sequence oto_cust_address_seq as bigint start with 1 increment by 50; + +create table oto_level_a ( + id numeric(19) not null, + name nvarchar(255), + b_id numeric(19), + constraint pk_oto_level_a primary key (id) +); +create unique nonclustered index uq_oto_level_a_b_id on oto_level_a(b_id) where b_id is not null; +create sequence oto_level_a_seq as bigint start with 1 increment by 50; + +create table oto_level_b ( + id numeric(19) not null, + name nvarchar(255), + c_id numeric(19), + constraint pk_oto_level_b primary key (id) +); +create unique nonclustered index uq_oto_level_b_c_id on oto_level_b(c_id) where c_id is not null; +create sequence oto_level_b_seq as bigint start with 1 increment by 50; + +create table oto_level_c ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_oto_level_c primary key (id) +); +create sequence oto_level_c_seq as bigint start with 1 increment by 50; + +create table oto_master ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_oto_master primary key (id) +); +create sequence oto_master_seq as bigint start with 1 increment by 50; + +create table oto_prime ( + pid numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_oto_prime primary key (pid) +); +create sequence oto_prime_seq as bigint start with 1 increment by 50; + +create table oto_prime_extra ( + eid numeric(19) not null, + extra nvarchar(255), + version numeric(19) not null, + constraint pk_oto_prime_extra primary key (eid) +); +create sequence oto_prime_extra_seq as bigint start with 1 increment by 50; + +create table oto_sd_child ( + id numeric(19) not null, + child nvarchar(255), + master_id numeric(19), + deleted integer default 0 not null, + version numeric(19) not null, + constraint pk_oto_sd_child primary key (id) +); +create unique nonclustered index uq_oto_sd_child_master_id on oto_sd_child(master_id) where master_id is not null; +create sequence oto_sd_child_seq as bigint start with 1 increment by 50; + +create table oto_sd_master ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_oto_sd_master primary key (id) +); +create sequence oto_sd_master_seq as bigint start with 1 increment by 50; + +create table oto_th_many ( + id numeric(19) not null, + oto_th_top_id numeric(19) not null, + many nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_oto_th_many primary key (id) +); +create sequence oto_th_many_seq as bigint start with 1 increment by 50; + +create table oto_th_one ( + id numeric(19) not null, + one integer default 0 not null, + many_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_oto_th_one primary key (id) +); +create unique nonclustered index uq_oto_th_one_many_id on oto_th_one(many_id) where many_id is not null; +create sequence oto_th_one_seq as bigint start with 1 increment by 50; + +create table oto_th_top ( + id numeric(19) not null, + topp nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_oto_th_top primary key (id) +); +create sequence oto_th_top_seq as bigint start with 1 increment by 50; + +create table oto_ubprime ( + pid uniqueidentifier not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_oto_ubprime primary key (pid) +); + +create table oto_ubprime_extra ( + eid uniqueidentifier not null, + extra nvarchar(255), + version numeric(19) not null, + constraint pk_oto_ubprime_extra primary key (eid) +); + +create table oto_uprime ( + pid uniqueidentifier not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_oto_uprime primary key (pid) +); + +create table oto_uprime_extra ( + eid uniqueidentifier not null, + extra nvarchar(255), + version numeric(19) not null, + constraint pk_oto_uprime_extra primary key (eid) +); + +create table oto_user_model ( + id numeric(19) not null, + name nvarchar(255), + user_optional_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_oto_user_model primary key (id) +); +create unique nonclustered index uq_oto_user_model_user_optional_id on oto_user_model(user_optional_id) where user_optional_id is not null; +create sequence oto_user_model_seq as bigint start with 1 increment by 50; + +create table oto_user_model_optional ( + id numeric(19) not null, + optional nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_oto_user_model_optional primary key (id) +); +create sequence oto_user_model_optional_seq as bigint start with 1 increment by 50; + +create table pfile ( + id integer not null, + name nvarchar(255), + file_content_id integer, + file_content2_id integer, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_pfile primary key (id) +); +create unique nonclustered index uq_pfile_file_content_id on pfile(file_content_id) where file_content_id is not null; +create unique nonclustered index uq_pfile_file_content2_id on pfile(file_content2_id) where file_content2_id is not null; +create sequence pfile_seq as bigint start with 1 increment by 50; + +create table pfile_content ( + id integer not null, + content image, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_pfile_content primary key (id) +); +create sequence pfile_content_seq as bigint start with 1 increment by 50; + +create table paggview ( + pview_id uniqueidentifier, + amount integer not null +); +create unique nonclustered index uq_paggview_pview_id on paggview(pview_id) where pview_id is not null; + +create table pallet_location ( + type nvarchar(31) not null, + id integer not null, + zone_sid integer not null, + attribute nvarchar(255), + constraint pk_pallet_location primary key (id) +); +create sequence pallet_location_seq as bigint start with 1 increment by 50; + +create table parcel ( + parcelid numeric(19) not null, + description nvarchar(255), + constraint pk_parcel primary key (parcelid) +); +create sequence parcel_seq as bigint start with 1 increment by 50; + +create table parcel_location ( + parcellocid numeric(19) not null, + location nvarchar(255), + parcelid numeric(19), + constraint pk_parcel_location primary key (parcellocid) +); +create unique nonclustered index uq_parcel_location_parcelid on parcel_location(parcelid) where parcelid is not null; +create sequence parcel_location_seq as bigint start with 1 increment by 50; + +create table rawinherit_parent ( + type nvarchar(31) not null, + id numeric(19) not null, + val integer, + more nvarchar(255), + constraint pk_rawinherit_parent primary key (id) +); +create sequence rawinherit_parent_seq as bigint start with 1 increment by 50; + +create table rawinherit_parent_rawinherit_data ( + rawinherit_parent_id numeric(19) not null, + rawinherit_data_id numeric(19) not null, + constraint pk_rawinherit_parent_rawinherit_data primary key (rawinherit_parent_id,rawinherit_data_id) +); + +create table e_save_test_c ( + id numeric(19) not null, + version numeric(19) not null, + constraint pk_e_save_test_c primary key (id) +); +create sequence e_save_test_c_seq as bigint start with 1 increment by 50; + +create table parent_person ( + identifier integer not null, + name nvarchar(255), + age integer, + some_bean_id integer, + parent_identifier integer, + family_name nvarchar(255), + address nvarchar(255), + constraint pk_parent_person primary key (identifier) +); +create sequence parent_person_seq as bigint start with 1 increment by 50; + +create table c_participation ( + id numeric(19) not null, + rating integer, + type integer, + conversation_id numeric(19) not null, + user_id numeric(19) not null, + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint ck_c_participation_type check ( type in (0,1)), + constraint pk_c_participation primary key (id) +); +create sequence c_participation_seq as bigint start with 1 increment by 50; + +create table password_store_model ( + id numeric(19) not null, + enc1 nvarchar(30), + enc2 nvarchar(40), + enc3 nvarchar(max), + enc4 varbinary(30), + enc5 varbinary(40), + enc6 image, + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_password_store_model primary key (id) +); +create sequence password_store_model_seq as bigint start with 1 increment by 50; + +create table pcf_calendar ( + id numeric(19) not null, + pcf_person_id numeric(19) not null, + version numeric(19) not null, + constraint pk_pcf_calendar primary key (id) +); +create sequence pcf_calendar_seq as bigint start with 1 increment by 50; + +create table pcf_city ( + id numeric(19) not null, + pcf_country_id numeric(19) not null, + name nvarchar(255), + mayor_id numeric(19) not null, + vice_mayor_id numeric(19) not null, + version numeric(19) 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 sequence pcf_city_seq as bigint start with 1 increment by 50; + +create table pcf_country ( + id numeric(19) not null, + version numeric(19) not null, + constraint pk_pcf_country primary key (id) +); +create sequence pcf_country_seq as bigint start with 1 increment by 50; + +create table pcf_event ( + id numeric(19) not null, + pcf_calendar_id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_pcf_event primary key (id) +); +create sequence pcf_event_seq as bigint start with 1 increment by 50; + +create table pcf_person ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_pcf_person primary key (id) +); +create sequence pcf_person_seq as bigint start with 1 increment by 50; + +create table mt_permission ( + id uniqueidentifier not null, + name nvarchar(255), + constraint pk_mt_permission primary key (id) +); + +create table persistent_file ( + id integer not null, + name nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_persistent_file primary key (id) +); +create sequence persistent_file_seq as bigint start with 1 increment by 50; + +create table persistent_file_content ( + id integer not null, + persistent_file_id integer, + content image, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_persistent_file_content primary key (id) +); +create unique nonclustered index uq_persistent_file_content_persistent_file_id on persistent_file_content(persistent_file_id) where persistent_file_id is not null; +create sequence persistent_file_content_seq as bigint start with 1 increment by 50; + +create table person ( + oid numeric(19) not null, + default_address_oid numeric(19), + version integer not null, + constraint pk_person primary key (oid) +); +create sequence person_seq as bigint start with 1 increment by 50; + +create table persons ( + id numeric(19) not null, + surname nvarchar(64) not null, + name nvarchar(64) not null, + constraint pk_persons primary key (id) +); +create sequence PERSONS_seq as bigint start with 1000 increment by 40; + +create table person_cache_email ( + id nvarchar(128) not null, + person_info_person_id nvarchar(128), + email nvarchar(255), + constraint pk_person_cache_email primary key (id) +); + +create table person_cache_info ( + person_id nvarchar(128) not null, + name nvarchar(255), + constraint pk_person_cache_info primary key (person_id) +); + +create table phones ( + id numeric(19) not null, + phone_number nvarchar(7) not null, + person_id numeric(19) not null, + constraint uq_phones_phone_number unique (phone_number), + constraint pk_phones primary key (id) +); +create sequence PHONES_seq as bigint start with 1 increment by 50; + +create table e_position ( + id numeric(19) not null, + name nvarchar(255), + contract_id numeric(19) not null, + constraint pk_e_position primary key (id) +); +create sequence e_position_seq as bigint start with 1 increment by 50; + +create table primary_revision ( + id numeric(19) not null, + revision integer not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_primary_revision primary key (id,revision) +); + +create table o_product ( + id integer not null, + sku nvarchar(20), + name nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + constraint pk_o_product primary key (id) +); +create sequence o_product_seq as bigint start with 1 increment by 50; + +create table pp ( + id uniqueidentifier not null, + name nvarchar(255), + value nvarchar(100) not null, + constraint pk_pp primary key (id) +); + +create table pp_to_ww ( + pp_id uniqueidentifier not null, + ww_id uniqueidentifier not null, + constraint pk_pp_to_ww primary key (pp_id,ww_id) +); + +create table question ( + id numeric(19) not null, + name nvarchar(255), + groupobjectid numeric(19), + sequence_number integer not null, + constraint pk_question primary key (id) +); +create sequence question_seq as bigint start with 1 increment by 50; + +create table rcustomer ( + company nvarchar(127) not null, + name nvarchar(127) not null, + description nvarchar(255), + constraint pk_rcustomer primary key (company,name) +); + +create table r_orders ( + company nvarchar(127) not null, + order_number integer not null, + customername nvarchar(127), + item nvarchar(255), + constraint pk_r_orders primary key (company,order_number) +); + +create table referencing_bean ( + id uniqueidentifier not null, + constraint pk_referencing_bean primary key (id) +); + +create table region ( + customer integer not null, + type integer not null, + description nvarchar(255), + version numeric(19) not null, + constraint pk_region primary key (customer,type) +); + +create table rel_detail ( + id numeric(19) not null, + name nvarchar(255), + version integer not null, + constraint pk_rel_detail primary key (id) +); +create sequence rel_detail_seq as bigint start with 1 increment by 50; + +create table rel_master ( + id numeric(19) not null, + name nvarchar(255), + detail_id numeric(19), + version integer not null, + constraint pk_rel_master primary key (id) +); +create sequence rel_master_seq as bigint start with 1 increment by 50; + +create table resourcefile ( + id nvarchar(64) not null, + parentresourcefileid nvarchar(64), + name nvarchar(128) not null, + constraint pk_resourcefile primary key (id) +); + +create table mt_role ( + id uniqueidentifier not null, + name nvarchar(50), + tenant_id uniqueidentifier, + version numeric(19) not null, + constraint pk_mt_role primary key (id) +); + +create table mt_role_permission ( + mt_role_id uniqueidentifier not null, + mt_permission_id uniqueidentifier not null, + constraint pk_mt_role_permission primary key (mt_role_id,mt_permission_id) +); + +create table em_role ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_em_role primary key (id) +); +create sequence em_role_seq as bigint start with 1 increment by 50; + +create table root_bean ( + dtype nvarchar(31) not null, + id uniqueidentifier not null, + referencing_bean_id uniqueidentifier not null, + value nvarchar(255), + constraint pk_root_bean primary key (id) +); + +create table f_second ( + id numeric(19) not null, + mod_name nvarchar(255), + first numeric(19), + title nvarchar(255), + constraint pk_f_second primary key (id) +); +create unique nonclustered index uq_f_second_first on f_second(first) where first is not null; +create sequence f_second_seq as bigint start with 1 increment by 50; + +create table section ( + id integer not null, + article_id integer, + type integer, + content nvarchar(max), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint ck_section_type check ( type in (0,1)), + constraint pk_section primary key (id) +); +create sequence section_seq as bigint start with 1 increment by 50; + +create table self_parent ( + id numeric(19) not null, + name nvarchar(255), + parent_id numeric(19), + version numeric(19) not null, + constraint pk_self_parent primary key (id) +); +create sequence self_parent_seq as bigint start with 1 increment by 50; + +create table self_ref_customer ( + id numeric(19) not null, + name nvarchar(255), + referred_by_id numeric(19), + constraint pk_self_ref_customer primary key (id) +); +create sequence self_ref_customer_seq as bigint start with 1 increment by 50; + +create table self_ref_example ( + id numeric(19) not null, + name nvarchar(255) not null, + parent_id numeric(19), + constraint pk_self_ref_example primary key (id) +); +create sequence self_ref_example_seq as bigint start with 1 increment by 50; + +create table e_save_test_a ( + id numeric(19) not null, + version numeric(19) not null, + constraint pk_e_save_test_a primary key (id) +); +create sequence e_save_test_a_seq as bigint start with 1 increment by 50; + +create table e_save_test_b ( + id numeric(19) not null, + sibling_a_id numeric(19), + test_property integer default 0 not null, + version numeric(19) not null, + constraint pk_e_save_test_b primary key (id) +); +create unique nonclustered index uq_e_save_test_b_sibling_a_id on e_save_test_b(sibling_a_id) where sibling_a_id is not null; +create sequence e_save_test_b_seq as bigint start with 1 increment by 50; + +create table site ( + id uniqueidentifier not null, + name nvarchar(255), + parent_id uniqueidentifier, + data_container_id uniqueidentifier, + site_address_id uniqueidentifier, + constraint pk_site primary key (id) +); +create unique nonclustered index uq_site_data_container_id on site(data_container_id) where data_container_id is not null; +create unique nonclustered index uq_site_site_address_id on site(site_address_id) where site_address_id is not null; + +create table site_address ( + id uniqueidentifier not null, + street nvarchar(255), + city nvarchar(255), + zip_code nvarchar(255), + constraint pk_site_address primary key (id) +); + +create table some_enum_bean ( + id numeric(19) not null, + some_enum integer, + name nvarchar(255), + constraint ck_some_enum_bean_some_enum check ( some_enum in (0,1)), + constraint pk_some_enum_bean primary key (id) +); +create sequence some_enum_bean_seq as bigint start with 1 increment by 50; + +create table some_file_bean ( + id numeric(19) not null, + name nvarchar(255), + content image, + version numeric(19) not null, + constraint pk_some_file_bean primary key (id) +); +create sequence some_file_bean_seq as bigint start with 1 increment by 50; + +create table some_new_types_bean ( + id numeric(19) not null, + dow integer, + mth integer, + yr integer, + yr_mth date, + month_day date, + sql_date date, + sql_time time, + local_date date, + local_date_time datetime2, + offset_date_time datetime2, + zoned_date_time datetime2, + local_time time, + instant datetime2, + zone_id nvarchar(60), + zone_offset nvarchar(60), + path nvarchar(255), + period nvarchar(20), + duration numeric(19), + version numeric(19) 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 sequence some_new_types_bean_seq as bigint start with 1 increment by 50; + +create table some_period_bean ( + id numeric(19) not null, + anniversary date, + version numeric(19) not null, + constraint pk_some_period_bean primary key (id) +); +create sequence some_period_bean_seq as bigint start with 1 increment by 50; + +create table source_base ( + dtype nvarchar(31) not null, + id uniqueidentifier not null, + name nvarchar(255), + pos integer not null, + target_id uniqueidentifier, + constraint pk_source_base primary key (id) +); + +create table stockforecast ( + type nvarchar(31) not null, + id numeric(19) not null, + inner_report_id numeric(19), + constraint pk_stockforecast primary key (id) +); +create sequence stockforecast_seq as bigint start with 1 increment by 50; + +create table sub_section ( + id integer not null, + section_id integer, + title nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_sub_section primary key (id) +); +create sequence sub_section_seq as bigint start with 1 increment by 50; + +create table sub_type ( + sub_type_id integer not null, + description nvarchar(255), + version numeric(19) not null, + constraint pk_sub_type primary key (sub_type_id) +); +create sequence sub_type_seq as bigint start with 1 increment by 50; + +create table survey ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_survey primary key (id) +); +create sequence survey_seq as bigint start with 1 increment by 50; + +create table tbytes_only ( + id integer not null, + content image, + constraint pk_tbytes_only primary key (id) +); +create sequence tbytes_only_seq as bigint start with 1 increment by 50; + +create table tcar ( + type nvarchar(31) not null, + plate_no nvarchar(32) not null, + truckload numeric(19), + constraint pk_tcar primary key (plate_no) +); + +create table tevent ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_tevent primary key (id) +); +create sequence tevent_seq as bigint start with 1 increment by 50; + +create table tevent_many ( + id numeric(19) not null, + description nvarchar(255), + event_id numeric(19), + units integer not null, + amount float(32) not null, + version numeric(19) not null, + constraint pk_tevent_many primary key (id) +); +create sequence tevent_many_seq as bigint start with 1 increment by 50; + +create table tevent_one ( + id numeric(19) not null, + name nvarchar(255), + status integer, + event_id numeric(19), + version numeric(19) not null, + constraint ck_tevent_one_status check ( status in (0,1)), + constraint pk_tevent_one primary key (id) +); +create unique nonclustered index uq_tevent_one_event_id on tevent_one(event_id) where event_id is not null; +create sequence tevent_one_seq as bigint start with 1 increment by 50; + +create table tint_root ( + my_type integer not null, + id integer not null, + name nvarchar(255), + child_property nvarchar(255), + constraint pk_tint_root primary key (id) +); +create sequence tint_root_seq as bigint start with 1 increment by 50; + +create table tjoda_entity ( + id integer not null, + local_time time, + constraint pk_tjoda_entity primary key (id) +); +create sequence tjoda_entity_seq as bigint start with 1 increment by 50; + +create table t_mapsuper1 ( + id integer not null, + something nvarchar(255), + name nvarchar(255), + version integer not null, + constraint pk_t_mapsuper1 primary key (id) +); +create sequence t_mapsuper1_seq as bigint start with 1 increment by 50; + +create table t_oneb ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + active integer default 0 not null, + constraint pk_t_oneb primary key (id) +); +create sequence t_oneb_seq as bigint start with 1 increment by 50; + +create table t_detail_with_other_namexxxyy ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + some_unique_value nvarchar(127), + active integer default 0 not null, + master_id integer, + constraint pk_t_detail_with_other_namexxxyy primary key (id) +); +create unique nonclustered index uq_t_detail_with_other_namexxxyy_some_unique_value on t_detail_with_other_namexxxyy(some_unique_value) where some_unique_value is not null; +create sequence t_detail_with_other_namexxxyy_seq as bigint start with 1 increment by 50; + +create table t_atable_thatisrelatively ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + active integer default 0 not null, + constraint pk_t_atable_thatisrelatively primary key (id) +); +create sequence t_atable_thatisrelatively_seq as bigint start with 1 increment by 50; + +create table ttruck_holder ( + id numeric(19) not null, + name nvarchar(255), + truck_plate_no nvarchar(32) not null, + basic_id integer, + version numeric(19) not null, + constraint pk_ttruck_holder primary key (id) +); +create sequence ttruck_holder_seq as bigint start with 1 increment by 50; + +create table ttruck_holder_item ( + id numeric(19) not null, + some_uid uniqueidentifier, + foo nvarchar(255), + owner_id numeric(19) not null, + constraint pk_ttruck_holder_item primary key (id) +); +create sequence ttruck_holder_item_seq as bigint start with 1 increment by 50; + +create table tuuid_entity ( + id uniqueidentifier not null, + name nvarchar(255), + constraint pk_tuuid_entity primary key (id) +); + +create table twheel ( + id numeric(19) not null, + owner_plate_no nvarchar(32) not null, + constraint pk_twheel primary key (id) +); +create sequence twheel_seq as bigint start with 1 increment by 50; + +create table twith_pre_insert ( + id integer not null, + name nvarchar(255) not null, + title nvarchar(255), + constraint pk_twith_pre_insert primary key (id) +); +create sequence twith_pre_insert_seq as bigint start with 1 increment by 50; + +create table target_base ( + dtype nvarchar(31) not null, + id uniqueidentifier not null, + name nvarchar(255), + constraint pk_target_base primary key (id) +); + +create table mt_tenant ( + id uniqueidentifier not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_mt_tenant primary key (id) +); + +create table test_annotation_base_entity ( + direct nvarchar(255), + meta nvarchar(255), + mixed nvarchar(255), + constraint_annotation nvarchar(40), + null1 nvarchar(255) not null, + null2 nvarchar(255), + null3 nvarchar(255) +); + +create table tire ( + id numeric(19) not null, + wheel numeric(19), + version integer not null, + constraint pk_tire primary key (id) +); +create unique nonclustered index uq_tire_wheel on tire(wheel) where wheel is not null; +create sequence tire_seq as bigint start with 1 increment by 50; + +create table sa_tire ( + id numeric(19) not null, + version integer not null, + constraint pk_sa_tire primary key (id) +); +create sequence sa_tire_seq as bigint start with 1 increment by 50; + +create table tree_entity ( + id integer not null, + text nvarchar(255), + parent_id integer, + constraint pk_tree_entity primary key (id) +); +create sequence tree_entity_seq as bigint start with 1 increment by 50; + +create table trip ( + id integer not null, + vehicle_driver_id integer, + destination nvarchar(255), + address_id integer, + star_date datetime2, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_trip primary key (id) +); +create sequence trip_seq as bigint start with 1 increment by 50; + +create table truck_ref ( + id integer not null, + something nvarchar(255), + constraint pk_truck_ref primary key (id) +); +create sequence truck_ref_seq as bigint start with 1 increment by 50; + +create table tune ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_tune primary key (id) +); +create sequence tune_seq as bigint start with 1 increment by 50; + +create table [type] ( + customer integer not null, + type integer not null, + description nvarchar(255), + sub_type_id integer, + version numeric(19) not null, + constraint pk_type primary key (customer,type) +); + +create table tz_bean ( + id numeric(19) not null, + moda nvarchar(255), + ts datetime2, + tstz datetime2, + constraint pk_tz_bean primary key (id) +); +create sequence tz_bean_seq as bigint start with 1 increment by 50; + +create table usib_child ( + id uniqueidentifier not null, + parent_id numeric(19), + deleted integer default 0 not null, + constraint pk_usib_child primary key (id) +); + +create table usib_child_sibling ( + id numeric(19) not null, + child_id uniqueidentifier, + deleted integer default 0 not null, + constraint pk_usib_child_sibling primary key (id) +); +create unique nonclustered index uq_usib_child_sibling_child_id on usib_child_sibling(child_id) where child_id is not null; +create sequence usib_child_sibling_seq as bigint start with 1 increment by 50; + +create table usib_parent ( + id numeric(19) not null, + deleted integer default 0 not null, + constraint pk_usib_parent primary key (id) +); +create sequence usib_parent_seq as bigint start with 1 increment by 50; + +create table ut_detail ( + id integer not null, + utmaster_id integer not null, + name nvarchar(255), + qty integer, + amount float(32), + version integer not null, + constraint pk_ut_detail primary key (id) +); +create sequence ut_detail_seq as bigint start with 1 increment by 50; + +create table ut_master ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + event_date date, + version integer not null, + constraint pk_ut_master primary key (id) +); +create sequence ut_master_seq as bigint start with 1 increment by 50; + +create table uuone ( + id uniqueidentifier not null, + name nvarchar(255), + description nvarchar(255), + version numeric(19) not null, + constraint pk_uuone primary key (id) +); + +create table uutwo ( + id uniqueidentifier not null, + name nvarchar(255), + notes nvarchar(255), + master_id uniqueidentifier, + version numeric(19) not null, + constraint pk_uutwo primary key (id) +); + +create table oto_user ( + id numeric(19) not null, + name nvarchar(255), + account_id numeric(19) not null, + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint uq_oto_user_account_id unique (account_id), + constraint pk_oto_user primary key (id) +); +create sequence oto_user_seq as bigint start with 1 increment by 50; + +create table c_user ( + id numeric(19) not null, + inactive integer default 0 not null, + name nvarchar(255), + email nvarchar(255), + password_hash nvarchar(255), + group_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_c_user primary key (id) +); +create sequence c_user_seq as bigint start with 1 increment by 50; + +create table tx_user ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_tx_user primary key (id) +); +create sequence tx_user_seq as bigint start with 1 increment by 50; + +create table g_user ( + id numeric(19) not null, + username nvarchar(255), + version numeric(19) not null, + constraint pk_g_user primary key (id) +); +create sequence g_user_seq as bigint start with 1 increment by 50; + +create table em_user ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_em_user primary key (id) +); +create sequence em_user_seq as bigint start with 1 increment by 50; + +create table user_interest_live ( + user_id numeric(19) not null, + live_id numeric(19) not null, + created_at datetime2 not null, + constraint pk_user_interest_live primary key (user_id,live_id) +); + +create table em_user_role ( + user_id numeric(19) not null, + role_id numeric(19) not null, + constraint pk_em_user_role primary key (user_id,role_id) +); + +create table vehicle ( + dtype nvarchar(3) not null, + id integer not null, + license_number nvarchar(255), + registration_date datetime2, + lease_id numeric(19), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + siz nvarchar(3), + driver nvarchar(255), + car_ref_id integer, + notes nvarchar(255), + truck_ref_id integer, + capacity float(32), + constraint ck_vehicle_siz check ( siz in ('S','M','L','H')), + constraint pk_vehicle primary key (id) +); +create sequence vehicle_seq as bigint start with 1 increment by 50; + +create table vehicle_driver ( + id integer not null, + name nvarchar(255), + vehicle_id integer, + address_id integer, + license_issued_on datetime2, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_vehicle_driver primary key (id) +); +create sequence vehicle_driver_seq as bigint start with 1 increment by 50; + +create table vehicle_lease ( + dtype nvarchar(31) not null, + id numeric(19) not null, + name nvarchar(255), + active_start date, + active_end date, + version numeric(19) not null, + bond numeric(28), + min_duration integer not null, + day_rate numeric(28), + max_days integer, + constraint pk_vehicle_lease primary key (id) +); +create sequence vehicle_lease_seq as bigint start with 1 increment by 50; + +create table warehouses ( + id integer not null, + officezoneid integer, + constraint pk_warehouses primary key (id) +); +create sequence warehouses_seq as bigint start with 1 increment by 50; + +create table warehousesshippingzones ( + warehouseid integer not null, + shippingzoneid integer not null, + constraint pk_warehousesshippingzones primary key (warehouseid,shippingzoneid) +); + +create table wheel ( + id numeric(19) not null, + version integer not null, + constraint pk_wheel primary key (id) +); +create sequence wheel_seq as bigint start with 1 increment by 50; + +create table sa_wheel ( + id numeric(19) not null, + tire numeric(19), + car numeric(19), + version integer not null, + constraint pk_sa_wheel primary key (id) +); +create sequence sa_wheel_seq as bigint start with 1 increment by 50; + +create table sp_car_wheel ( + id numeric(19) not null, + name nvarchar(255), + version integer not null, + constraint pk_sp_car_wheel primary key (id) +); +create sequence sp_car_wheel_seq as bigint start with 1 increment by 50; + +create table g_who_props_otm ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + who_created_id numeric(19), + who_modified_id numeric(19), + constraint pk_g_who_props_otm primary key (id) +); +create sequence g_who_props_otm_seq as bigint start with 1 increment by 50; + +create table with_zero ( + id numeric(19) not null, + name nvarchar(255), + parent_id integer, + lang nvarchar(2) default 'en' not null, + version numeric(19) not null, + constraint pk_with_zero primary key (id) +); +create sequence with_zero_seq as bigint start with 1 increment by 50; + +create table parent ( + id integer not null, + name nvarchar(255), + constraint pk_parent primary key (id) +); +create sequence parent_seq as bigint start with 1 increment by 50; + +create table wview ( + id uniqueidentifier not null, + name nvarchar(127) not null, + constraint uq_wview_name unique (name), + constraint pk_wview primary key (id) +); + +create table zones ( + type nvarchar(31) not null, + id integer not null, + attribute nvarchar(255), + constraint pk_zones primary key (id) +); +create sequence zones_seq as bigint start with 1 increment by 50; + +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_organization_node_kind on organization_node (kind); +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); + +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); + +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); + +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); + +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); + +alter table album add constraint fk_album_cover_id foreign key (cover_id) references cover (id); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +alter table basic_draftable_bean add constraint fk_basic_draftable_bean_id foreign key (id) references basic_draftable_bean_draft (id); + +alter table drel_booking add constraint fk_drel_booking_agent_invoice foreign key (agent_invoice) references drel_invoice (id); + +alter table drel_booking add constraint fk_drel_booking_client_invoice foreign key (client_invoice) references drel_invoice (id); + +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); + +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); + +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); + +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); + +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); + +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); + +alter table coroot add constraint fk_coroot_one_id foreign key (one_id) references coone (id); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +create index ix_category_surveyobjectid on category (surveyobjectid); +alter table category add constraint fk_category_surveyobjectid foreign key (surveyobjectid) references survey (id); + +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); + +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); + +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); + +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); + +alter table class_super_monkey add constraint fk_class_super_monkey_class_super foreign key (class_super_sid) references class_super (sid); + +alter table class_super_monkey add constraint fk_class_super_monkey_monkey foreign key (monkey_mid) references monkey (mid); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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 cascade; + +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 set null; + +alter table doc add constraint fk_doc_id foreign key (id) references doc_draft (id); + +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); + +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); + +alter table document add constraint fk_document_id foreign key (id) references document_draft (id); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +alter table edefault_prop add constraint fk_edefault_prop_e_simple_usertypeid foreign key (e_simple_usertypeid) references esimple (usertypeid); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +alter table hsd_setting add constraint fk_hsd_setting_user_id foreign key (user_id) references hsd_user (id); + +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); + +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); + +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); + +alter table info_customer add constraint fk_info_customer_company_id foreign key (company_id) references info_company (id); + +alter table inner_report add constraint fk_inner_report_forecast_id foreign key (forecast_id) references stockforecast (id); + +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); + +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); + +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); + +alter table mkeygroup_monkey add constraint fk_mkeygroup_monkey_mkeygroup foreign key (mkeygroup_pid) references mkeygroup (pid); + +alter table mkeygroup_monkey add constraint fk_mkeygroup_monkey_monkey foreign key (monkey_mid) references monkey (mid); + +alter table trainer_monkey add constraint fk_trainer_monkey_trainer foreign key (trainer_tid) references trainer (tid); + +alter table trainer_monkey add constraint fk_trainer_monkey_monkey foreign key (monkey_mid) references monkey (mid); + +alter table troop_monkey add constraint fk_troop_monkey_troop foreign key (troop_pid) references troop (pid); + +alter table troop_monkey add constraint fk_troop_monkey_monkey foreign key (monkey_mid) references monkey (mid); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +alter table link add constraint fk_link_id foreign key (id) references link_draft (id); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +alter table mprinter add constraint fk_mprinter_last_swap_cyan_id foreign key (last_swap_cyan_id) references mprinter_state (id); + +alter table mprinter add constraint fk_mprinter_last_swap_magenta_id foreign key (last_swap_magenta_id) references mprinter_state (id); + +alter table mprinter add constraint fk_mprinter_last_swap_yellow_id foreign key (last_swap_yellow_id) references mprinter_state (id); + +alter table mprinter add constraint fk_mprinter_last_swap_black_id foreign key (last_swap_black_id) references mprinter_state (id); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +alter table meter_version add constraint fk_meter_version_address_data_id foreign key (address_data_id) references meter_address_data (id); + +alter table meter_version add constraint fk_meter_version_contract_data_id foreign key (contract_data_id) references meter_contract_data (id); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +alter table oengine add constraint fk_oengine_car_id foreign key (car_id) references ocar (id); + +alter table ogear_box add constraint fk_ogear_box_car_id foreign key (car_id) references ocar (id); + +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); + +alter table oroad_show_msg add constraint fk_oroad_show_msg_company_id foreign key (company_id) references ocompany (id); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +alter table organization_node add constraint fk_organization_node_parent_tree_node_id foreign key (parent_tree_node_id) references organization_tree_node (id); + +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); + +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); + +alter table oto_atwo add constraint fk_oto_atwo_aone_id foreign key (aone_id) references oto_aone (id); + +alter table oto_bchild add constraint fk_oto_bchild_master_id foreign key (master_id) references oto_bmaster (id); + +alter table oto_child add constraint fk_oto_child_master_id foreign key (master_id) references oto_master (id); + +alter table oto_cust_address add constraint fk_oto_cust_address_customer_cid foreign key (customer_cid) references oto_cust (cid); + +alter table oto_level_a add constraint fk_oto_level_a_b_id foreign key (b_id) references oto_level_b (id); + +alter table oto_level_b add constraint fk_oto_level_b_c_id foreign key (c_id) references oto_level_c (id); + +alter table oto_prime_extra add constraint fk_oto_prime_extra_eid foreign key (eid) references oto_prime (pid); + +alter table oto_sd_child add constraint fk_oto_sd_child_master_id foreign key (master_id) references oto_sd_master (id); + +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); + +alter table oto_th_one add constraint fk_oto_th_one_many_id foreign key (many_id) references oto_th_many (id); + +alter table oto_ubprime_extra add constraint fk_oto_ubprime_extra_eid foreign key (eid) references oto_ubprime (pid); + +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); + +alter table pfile add constraint fk_pfile_file_content_id foreign key (file_content_id) references pfile_content (id); + +alter table pfile add constraint fk_pfile_file_content2_id foreign key (file_content2_id) references pfile_content (id); + +alter table paggview add constraint fk_paggview_pview_id foreign key (pview_id) references pp (id); + +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); + +alter table parcel_location add constraint fk_parcel_location_parcelid foreign key (parcelid) references parcel (parcelid); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +alter table pcf_city add constraint fk_pcf_city_mayor_id foreign key (mayor_id) references pcf_person (id); + +alter table pcf_city add constraint fk_pcf_city_vice_mayor_id foreign key (vice_mayor_id) references pcf_person (id); + +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); + +alter table persistent_file_content add constraint fk_persistent_file_content_persistent_file_id foreign key (persistent_file_id) references persistent_file (id); + +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); + +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); + +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); + +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); + +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); + +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); + +create index ix_question_groupobjectid on question (groupobjectid); +alter table question add constraint fk_question_groupobjectid foreign key (groupobjectid) references survey_group (id); + +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); + +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); + +create index ix_resourcefile_parentresourcefileid on resourcefile (parentresourcefileid); +alter table resourcefile add constraint fk_resourcefile_parentresourcefileid foreign key (parentresourcefileid) references resourcefile (id); + +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); + +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); + +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); + +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); + +alter table f_second add constraint fk_f_second_first foreign key (first) references f_first (id); + +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); + +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); + +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); + +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); + +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); + +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); + +alter table site add constraint fk_site_data_container_id foreign key (data_container_id) references data_container (id); + +alter table site add constraint fk_site_site_address_id foreign key (site_address_id) references site_address (id); + +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); + +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); + +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); + +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); + +alter table tevent_one add constraint fk_tevent_one_event_id foreign key (event_id) references tevent (id); + +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); + +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); + +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); + +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); + +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); + +alter table tire add constraint fk_tire_wheel foreign key (wheel) references wheel (id); + +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); + +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); + +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); + +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); + +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); + +alter table usib_child_sibling add constraint fk_usib_child_sibling_child_id foreign key (child_id) references usib_child (id); + +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); + +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); + +alter table oto_user add constraint fk_oto_user_account_id foreign key (account_id) references oto_account (id); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +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); + +create index ix_warehouses_officezoneid on warehouses (officezoneid); +alter table warehouses add constraint fk_warehouses_officezoneid foreign key (officezoneid) references zones (id); + +create index ix_warehousesshippingzones_warehouses on warehousesshippingzones (warehouseid); +alter table warehousesshippingzones add constraint fk_warehousesshippingzones_warehouses foreign key (warehouseid) references warehouses (id); + +create index ix_warehousesshippingzones_zones on warehousesshippingzones (shippingzoneid); +alter table warehousesshippingzones add constraint fk_warehousesshippingzones_zones foreign key (shippingzoneid) references zones (id); + +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); + +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); + +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); + +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); + +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); + +alter table hx_link + add sys_periodFrom datetime2 GENERATED ALWAYS AS ROW START NOT NULL DEFAULT SYSUTCDATETIME(), + sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999', +period for system_time (sys_periodFrom, sys_periodTo); +alter table hx_link set (system_versioning = on (history_table=dbo.hx_link_history)); +alter table hi_link + add sys_periodFrom datetime2 GENERATED ALWAYS AS ROW START NOT NULL DEFAULT SYSUTCDATETIME(), + sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999', +period for system_time (sys_periodFrom, sys_periodTo); +alter table hi_link set (system_versioning = on (history_table=dbo.hi_link_history)); +alter table hi_link_doc + add sys_periodFrom datetime2 GENERATED ALWAYS AS ROW START NOT NULL DEFAULT SYSUTCDATETIME(), + sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999', +period for system_time (sys_periodFrom, sys_periodTo); +alter table hi_link_doc set (system_versioning = on (history_table=dbo.hi_link_doc_history)); +alter table hi_tone + add sys_periodFrom datetime2 GENERATED ALWAYS AS ROW START NOT NULL DEFAULT SYSUTCDATETIME(), + sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999', +period for system_time (sys_periodFrom, sys_periodTo); +alter table hi_tone set (system_versioning = on (history_table=dbo.hi_tone_history)); +alter table hi_tthree + add sys_periodFrom datetime2 GENERATED ALWAYS AS ROW START NOT NULL DEFAULT SYSUTCDATETIME(), + sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999', +period for system_time (sys_periodFrom, sys_periodTo); +alter table hi_tthree set (system_versioning = on (history_table=dbo.hi_tthree_history)); +alter table hi_ttwo + add sys_periodFrom datetime2 GENERATED ALWAYS AS ROW START NOT NULL DEFAULT SYSUTCDATETIME(), + sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999', +period for system_time (sys_periodFrom, sys_periodTo); +alter table hi_ttwo set (system_versioning = on (history_table=dbo.hi_ttwo_history)); +alter table hsd_setting + add sys_periodFrom datetime2 GENERATED ALWAYS AS ROW START NOT NULL DEFAULT SYSUTCDATETIME(), + sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999', +period for system_time (sys_periodFrom, sys_periodTo); +alter table hsd_setting set (system_versioning = on (history_table=dbo.hsd_setting_history)); +alter table hsd_user + add sys_periodFrom datetime2 GENERATED ALWAYS AS ROW START NOT NULL DEFAULT SYSUTCDATETIME(), + sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999', +period for system_time (sys_periodFrom, sys_periodTo); +alter table hsd_user set (system_versioning = on (history_table=dbo.hsd_user_history)); +alter table link + add sys_periodFrom datetime2 GENERATED ALWAYS AS ROW START NOT NULL DEFAULT SYSUTCDATETIME(), + sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999', +period for system_time (sys_periodFrom, sys_periodTo); +alter table link set (system_versioning = on (history_table=dbo.link_history)); +alter table c_user + add sys_periodFrom datetime2 GENERATED ALWAYS AS ROW START NOT NULL DEFAULT SYSUTCDATETIME(), + sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999', +period for system_time (sys_periodFrom, sys_periodTo); +alter table c_user set (system_versioning = on (history_table=dbo.c_user_history)); diff --git a/ebean-core/src/test/ddl-review/sqlserver-drop-all.sql b/ebean-core/src/test/ddl-review/sqlserver-drop-all.sql new file mode 100644 index 000000000..867ef2963 --- /dev/null +++ b/ebean-core/src/test/ddl-review/sqlserver-drop-all.sql @@ -0,0 +1,2234 @@ +-- Generated by ebean unknown at 2020-03-04T08:21:26.827349Z +IF OBJECT_ID('fk_bar_foo_id', 'F') IS NOT NULL alter table bar drop constraint fk_bar_foo_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bar','U') AND name = 'ix_bar_foo_id') drop index ix_bar_foo_id ON bar; + +IF OBJECT_ID('fk_acl_container_relation_container_id', 'F') IS NOT NULL alter table acl_container_relation drop constraint fk_acl_container_relation_container_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('acl_container_relation','U') AND name = 'ix_acl_container_relation_container_id') drop index ix_acl_container_relation_container_id ON acl_container_relation; + +IF OBJECT_ID('fk_acl_container_relation_acl_entry_id', 'F') IS NOT NULL alter table acl_container_relation drop constraint fk_acl_container_relation_acl_entry_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('acl_container_relation','U') AND name = 'ix_acl_container_relation_acl_entry_id') drop index ix_acl_container_relation_acl_entry_id ON acl_container_relation; + +IF OBJECT_ID('fk_addr_employee_id', 'F') IS NOT NULL alter table addr drop constraint fk_addr_employee_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('addr','U') AND name = 'ix_addr_employee_id') drop index ix_addr_employee_id ON addr; + +IF OBJECT_ID('fk_o_address_country_code', 'F') IS NOT NULL alter table o_address drop constraint fk_o_address_country_code; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_address','U') AND name = 'ix_o_address_country_code') drop index ix_o_address_country_code ON o_address; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('album','U') AND name = 'uq_album_cover_id') drop index uq_album_cover_id ON album; +IF OBJECT_ID('fk_album_cover_id', 'F') IS NOT NULL alter table album drop constraint fk_album_cover_id; + +IF OBJECT_ID('fk_animal_shelter_id', 'F') IS NOT NULL alter table animal drop constraint fk_animal_shelter_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('animal','U') AND name = 'ix_animal_shelter_id') drop index ix_animal_shelter_id ON animal; + +IF OBJECT_ID('fk_attribute_attribute_holder_id', 'F') IS NOT NULL alter table attribute drop constraint fk_attribute_attribute_holder_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('attribute','U') AND name = 'ix_attribute_attribute_holder_id') drop index ix_attribute_attribute_holder_id ON attribute; + +IF OBJECT_ID('fk_bbookmark_user_id', 'F') IS NOT NULL alter table bbookmark drop constraint fk_bbookmark_user_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bbookmark','U') AND name = 'ix_bbookmark_user_id') drop index ix_bbookmark_user_id ON bbookmark; + +IF OBJECT_ID('fk_bbookmark_user_org_id', 'F') IS NOT NULL alter table bbookmark_user drop constraint fk_bbookmark_user_org_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bbookmark_user','U') AND name = 'ix_bbookmark_user_org_id') drop index ix_bbookmark_user_org_id ON bbookmark_user; + +IF OBJECT_ID('fk_bsite_user_a_site_id', 'F') IS NOT NULL alter table bsite_user_a drop constraint fk_bsite_user_a_site_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_a','U') AND name = 'ix_bsite_user_a_site_id') drop index ix_bsite_user_a_site_id ON bsite_user_a; + +IF OBJECT_ID('fk_bsite_user_a_user_id', 'F') IS NOT NULL alter table bsite_user_a drop constraint fk_bsite_user_a_user_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_a','U') AND name = 'ix_bsite_user_a_user_id') drop index ix_bsite_user_a_user_id ON bsite_user_a; + +IF OBJECT_ID('fk_bsite_user_b_site', 'F') IS NOT NULL alter table bsite_user_b drop constraint fk_bsite_user_b_site; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_b','U') AND name = 'ix_bsite_user_b_site') drop index ix_bsite_user_b_site ON bsite_user_b; + +IF OBJECT_ID('fk_bsite_user_b_usr', 'F') IS NOT NULL alter table bsite_user_b drop constraint fk_bsite_user_b_usr; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_b','U') AND name = 'ix_bsite_user_b_usr') drop index ix_bsite_user_b_usr ON bsite_user_b; + +IF OBJECT_ID('fk_bsite_user_c_site_uid', 'F') IS NOT NULL alter table bsite_user_c drop constraint fk_bsite_user_c_site_uid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_c','U') AND name = 'ix_bsite_user_c_site_uid') drop index ix_bsite_user_c_site_uid ON bsite_user_c; + +IF OBJECT_ID('fk_bsite_user_c_user_uid', 'F') IS NOT NULL alter table bsite_user_c drop constraint fk_bsite_user_c_user_uid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_c','U') AND name = 'ix_bsite_user_c_user_uid') drop index ix_bsite_user_c_user_uid ON bsite_user_c; + +IF OBJECT_ID('fk_bsite_user_e_site_id', 'F') IS NOT NULL alter table bsite_user_e drop constraint fk_bsite_user_e_site_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_e','U') AND name = 'ix_bsite_user_e_site_id') drop index ix_bsite_user_e_site_id ON bsite_user_e; + +IF OBJECT_ID('fk_bsite_user_e_user_id', 'F') IS NOT NULL alter table bsite_user_e drop constraint fk_bsite_user_e_user_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_e','U') AND name = 'ix_bsite_user_e_user_id') drop index ix_bsite_user_e_user_id ON bsite_user_e; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bwith_qident','U') AND name = 'uq_bwith_qident_name') drop index uq_bwith_qident_name ON bwith_qident; +IF OBJECT_ID('fk_basic_draftable_bean_id', 'F') IS NOT NULL alter table basic_draftable_bean drop constraint fk_basic_draftable_bean_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('drel_booking','U') AND name = 'uq_drel_booking_booking_uid') drop index uq_drel_booking_booking_uid ON drel_booking; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('drel_booking','U') AND name = 'uq_drel_booking_agent_invoice') drop index uq_drel_booking_agent_invoice ON drel_booking; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('drel_booking','U') AND name = 'uq_drel_booking_client_invoice') drop index uq_drel_booking_client_invoice ON drel_booking; +IF OBJECT_ID('fk_drel_booking_agent_invoice', 'F') IS NOT NULL alter table drel_booking drop constraint fk_drel_booking_agent_invoice; + +IF OBJECT_ID('fk_drel_booking_client_invoice', 'F') IS NOT NULL alter table drel_booking drop constraint fk_drel_booking_client_invoice; + +IF OBJECT_ID('fk_cepproduct_category_category_id', 'F') IS NOT NULL alter table cepproduct_category drop constraint fk_cepproduct_category_category_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('cepproduct_category','U') AND name = 'ix_cepproduct_category_category_id') drop index ix_cepproduct_category_category_id ON cepproduct_category; + +IF OBJECT_ID('fk_cepproduct_category_product_id', 'F') IS NOT NULL alter table cepproduct_category drop constraint fk_cepproduct_category_product_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('cepproduct_category','U') AND name = 'ix_cepproduct_category_product_id') drop index ix_cepproduct_category_product_id ON cepproduct_category; + +IF OBJECT_ID('fk_cinh_ref_ref_id', 'F') IS NOT NULL alter table cinh_ref drop constraint fk_cinh_ref_ref_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('cinh_ref','U') AND name = 'ix_cinh_ref_ref_id') drop index ix_cinh_ref_ref_id ON cinh_ref; + +IF OBJECT_ID('fk_ckey_detail_parent', 'F') IS NOT NULL alter table ckey_detail drop constraint fk_ckey_detail_parent; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ckey_detail','U') AND name = 'ix_ckey_detail_parent') drop index ix_ckey_detail_parent ON ckey_detail; + +IF OBJECT_ID('fk_ckey_parent_assoc_id', 'F') IS NOT NULL alter table ckey_parent drop constraint fk_ckey_parent_assoc_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ckey_parent','U') AND name = 'ix_ckey_parent_assoc_id') drop index ix_ckey_parent_assoc_id ON ckey_parent; + +IF OBJECT_ID('fk_coone_many_coone_id', 'F') IS NOT NULL alter table coone_many drop constraint fk_coone_many_coone_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('coone_many','U') AND name = 'ix_coone_many_coone_id') drop index ix_coone_many_coone_id ON coone_many; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('coroot','U') AND name = 'uq_coroot_one_id') drop index uq_coroot_one_id ON coroot; +IF OBJECT_ID('fk_coroot_one_id', 'F') IS NOT NULL alter table coroot drop constraint fk_coroot_one_id; + +IF OBJECT_ID('fk_calculation_result_product_configuration_id', 'F') IS NOT NULL alter table calculation_result drop constraint fk_calculation_result_product_configuration_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('calculation_result','U') AND name = 'ix_calculation_result_product_configuration_id') drop index ix_calculation_result_product_configuration_id ON calculation_result; + +IF OBJECT_ID('fk_calculation_result_group_configuration_id', 'F') IS NOT NULL alter table calculation_result drop constraint fk_calculation_result_group_configuration_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('calculation_result','U') AND name = 'ix_calculation_result_group_configuration_id') drop index ix_calculation_result_group_configuration_id ON calculation_result; + +IF OBJECT_ID('fk_sp_car_car_wheels_sp_car_car', 'F') IS NOT NULL alter table sp_car_car_wheels drop constraint fk_sp_car_car_wheels_sp_car_car; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('sp_car_car_wheels','U') AND name = 'ix_sp_car_car_wheels_sp_car_car') drop index ix_sp_car_car_wheels_sp_car_car ON sp_car_car_wheels; + +IF OBJECT_ID('fk_sp_car_car_wheels_sp_car_wheel', 'F') IS NOT NULL alter table sp_car_car_wheels drop constraint fk_sp_car_car_wheels_sp_car_wheel; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('sp_car_car_wheels','U') AND name = 'ix_sp_car_car_wheels_sp_car_wheel') drop index ix_sp_car_car_wheels_sp_car_wheel ON sp_car_car_wheels; + +IF OBJECT_ID('fk_sp_car_car_doors_sp_car_car', 'F') IS NOT NULL alter table sp_car_car_doors drop constraint fk_sp_car_car_doors_sp_car_car; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('sp_car_car_doors','U') AND name = 'ix_sp_car_car_doors_sp_car_car') drop index ix_sp_car_car_doors_sp_car_car ON sp_car_car_doors; + +IF OBJECT_ID('fk_sp_car_car_doors_sp_car_door', 'F') IS NOT NULL alter table sp_car_car_doors drop constraint fk_sp_car_car_doors_sp_car_door; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('sp_car_car_doors','U') AND name = 'ix_sp_car_car_doors_sp_car_door') drop index ix_sp_car_car_doors_sp_car_door ON sp_car_car_doors; + +IF OBJECT_ID('fk_car_accessory_fuse_id', 'F') IS NOT NULL alter table car_accessory drop constraint fk_car_accessory_fuse_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('car_accessory','U') AND name = 'ix_car_accessory_fuse_id') drop index ix_car_accessory_fuse_id ON car_accessory; + +IF OBJECT_ID('fk_car_accessory_car_id', 'F') IS NOT NULL alter table car_accessory drop constraint fk_car_accessory_car_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('car_accessory','U') AND name = 'ix_car_accessory_car_id') drop index ix_car_accessory_car_id ON car_accessory; + +IF OBJECT_ID('fk_category_surveyobjectid', 'F') IS NOT NULL alter table category drop constraint fk_category_surveyobjectid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('category','U') AND name = 'ix_category_surveyobjectid') drop index ix_category_surveyobjectid ON category; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('e_save_test_d','U') AND name = 'uq_e_save_test_d_parent_id') drop index uq_e_save_test_d_parent_id ON e_save_test_d; +IF OBJECT_ID('fk_e_save_test_d_parent_id', 'F') IS NOT NULL alter table e_save_test_d drop constraint fk_e_save_test_d_parent_id; + +IF OBJECT_ID('fk_child_person_some_bean_id', 'F') IS NOT NULL alter table child_person drop constraint fk_child_person_some_bean_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('child_person','U') AND name = 'ix_child_person_some_bean_id') drop index ix_child_person_some_bean_id ON child_person; + +IF OBJECT_ID('fk_child_person_parent_identifier', 'F') IS NOT NULL alter table child_person drop constraint fk_child_person_parent_identifier; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('child_person','U') AND name = 'ix_child_person_parent_identifier') drop index ix_child_person_parent_identifier ON child_person; + +IF OBJECT_ID('fk_cke_client_user', 'F') IS NOT NULL alter table cke_client drop constraint fk_cke_client_user; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('cke_client','U') AND name = 'ix_cke_client_user') drop index ix_cke_client_user ON cke_client; + +IF OBJECT_ID('fk_class_super_monkey_class_super', 'F') IS NOT NULL alter table class_super_monkey drop constraint fk_class_super_monkey_class_super; + +IF OBJECT_ID('fk_class_super_monkey_monkey', 'F') IS NOT NULL alter table class_super_monkey drop constraint fk_class_super_monkey_monkey; + +IF OBJECT_ID('fk_configuration_configurations_id', 'F') IS NOT NULL alter table configuration drop constraint fk_configuration_configurations_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('configuration','U') AND name = 'ix_configuration_configurations_id') drop index ix_configuration_configurations_id ON configuration; + +IF OBJECT_ID('fk_contact_customer_id', 'F') IS NOT NULL alter table contact drop constraint fk_contact_customer_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('contact','U') AND name = 'ix_contact_customer_id') drop index ix_contact_customer_id ON contact; + +IF OBJECT_ID('fk_contact_group_id', 'F') IS NOT NULL alter table contact drop constraint fk_contact_group_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('contact','U') AND name = 'ix_contact_group_id') drop index ix_contact_group_id ON contact; + +IF OBJECT_ID('fk_contact_note_contact_id', 'F') IS NOT NULL alter table contact_note drop constraint fk_contact_note_contact_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('contact_note','U') AND name = 'ix_contact_note_contact_id') drop index ix_contact_note_contact_id ON contact_note; + +IF OBJECT_ID('fk_contract_costs_position_id', 'F') IS NOT NULL alter table contract_costs drop constraint fk_contract_costs_position_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('contract_costs','U') AND name = 'ix_contract_costs_position_id') drop index ix_contract_costs_position_id ON contract_costs; + +IF OBJECT_ID('fk_c_conversation_group_id', 'F') IS NOT NULL alter table c_conversation drop constraint fk_c_conversation_group_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('c_conversation','U') AND name = 'ix_c_conversation_group_id') drop index ix_c_conversation_group_id ON c_conversation; + +IF OBJECT_ID('fk_o_customer_billing_address_id', 'F') IS NOT NULL alter table o_customer drop constraint fk_o_customer_billing_address_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_customer','U') AND name = 'ix_o_customer_billing_address_id') drop index ix_o_customer_billing_address_id ON o_customer; + +IF OBJECT_ID('fk_o_customer_shipping_address_id', 'F') IS NOT NULL alter table o_customer drop constraint fk_o_customer_shipping_address_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_customer','U') AND name = 'ix_o_customer_shipping_address_id') drop index ix_o_customer_shipping_address_id ON o_customer; + +IF OBJECT_ID('fk_dcredit_drol_dcredit', 'F') IS NOT NULL alter table dcredit_drol drop constraint fk_dcredit_drol_dcredit; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('dcredit_drol','U') AND name = 'ix_dcredit_drol_dcredit') drop index ix_dcredit_drol_dcredit ON dcredit_drol; + +IF OBJECT_ID('fk_dcredit_drol_drol', 'F') IS NOT NULL alter table dcredit_drol drop constraint fk_dcredit_drol_drol; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('dcredit_drol','U') AND name = 'ix_dcredit_drol_drol') drop index ix_dcredit_drol_drol ON dcredit_drol; + +IF OBJECT_ID('fk_dmachine_organisation_id', 'F') IS NOT NULL alter table dmachine drop constraint fk_dmachine_organisation_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('dmachine','U') AND name = 'ix_dmachine_organisation_id') drop index ix_dmachine_organisation_id ON dmachine; + +IF OBJECT_ID('fk_d_machine_aux_use_machine_id', 'F') IS NOT NULL alter table d_machine_aux_use drop constraint fk_d_machine_aux_use_machine_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('d_machine_aux_use','U') AND name = 'ix_d_machine_aux_use_machine_id') drop index ix_d_machine_aux_use_machine_id ON d_machine_aux_use; + +IF OBJECT_ID('fk_d_machine_stats_machine_id', 'F') IS NOT NULL alter table d_machine_stats drop constraint fk_d_machine_stats_machine_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('d_machine_stats','U') AND name = 'ix_d_machine_stats_machine_id') drop index ix_d_machine_stats_machine_id ON d_machine_stats; + +IF OBJECT_ID('fk_d_machine_use_machine_id', 'F') IS NOT NULL alter table d_machine_use drop constraint fk_d_machine_use_machine_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('d_machine_use','U') AND name = 'ix_d_machine_use_machine_id') drop index ix_d_machine_use_machine_id ON d_machine_use; + +IF OBJECT_ID('fk_drot_drol_drot', 'F') IS NOT NULL alter table drot_drol drop constraint fk_drot_drol_drot; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('drot_drol','U') AND name = 'ix_drot_drol_drot') drop index ix_drot_drol_drot ON drot_drol; + +IF OBJECT_ID('fk_drot_drol_drol', 'F') IS NOT NULL alter table drot_drol drop constraint fk_drot_drol_drol; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('drot_drol','U') AND name = 'ix_drot_drol_drol') drop index ix_drot_drol_drol ON drot_drol; + +IF OBJECT_ID('fk_dc_detail_master_id', 'F') IS NOT NULL alter table dc_detail drop constraint fk_dc_detail_master_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('dc_detail','U') AND name = 'ix_dc_detail_master_id') drop index ix_dc_detail_master_id ON dc_detail; + +IF OBJECT_ID('fk_dfk_cascade_one_id', 'F') IS NOT NULL alter table dfk_cascade drop constraint fk_dfk_cascade_one_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('dfk_cascade','U') AND name = 'ix_dfk_cascade_one_id') drop index ix_dfk_cascade_one_id ON dfk_cascade; + +IF OBJECT_ID('fk_dfk_set_null_one_id', 'F') IS NOT NULL alter table dfk_set_null drop constraint fk_dfk_set_null_one_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('dfk_set_null','U') AND name = 'ix_dfk_set_null_one_id') drop index ix_dfk_set_null_one_id ON dfk_set_null; + +IF OBJECT_ID('fk_doc_id', 'F') IS NOT NULL alter table doc drop constraint fk_doc_id; + +IF OBJECT_ID('fk_doc_link_doc', 'F') IS NOT NULL alter table doc_link drop constraint fk_doc_link_doc; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('doc_link','U') AND name = 'ix_doc_link_doc') drop index ix_doc_link_doc ON doc_link; + +IF OBJECT_ID('fk_doc_link_link', 'F') IS NOT NULL alter table doc_link drop constraint fk_doc_link_link; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('doc_link','U') AND name = 'ix_doc_link_link') drop index ix_doc_link_link ON doc_link; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('document','U') AND name = 'uq_document_title') drop index uq_document_title ON document; +IF OBJECT_ID('fk_document_id', 'F') IS NOT NULL alter table document drop constraint fk_document_id; + +IF OBJECT_ID('fk_document_organisation_id', 'F') IS NOT NULL alter table document drop constraint fk_document_organisation_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('document','U') AND name = 'ix_document_organisation_id') drop index ix_document_organisation_id ON document; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('document_draft','U') AND name = 'uq_document_draft_title') drop index uq_document_draft_title ON document_draft; +IF OBJECT_ID('fk_document_draft_organisation_id', 'F') IS NOT NULL alter table document_draft drop constraint fk_document_draft_organisation_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('document_draft','U') AND name = 'ix_document_draft_organisation_id') drop index ix_document_draft_organisation_id ON document_draft; + +IF OBJECT_ID('fk_document_media_document_id', 'F') IS NOT NULL alter table document_media drop constraint fk_document_media_document_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('document_media','U') AND name = 'ix_document_media_document_id') drop index ix_document_media_document_id ON document_media; + +IF OBJECT_ID('fk_document_media_draft_document_id', 'F') IS NOT NULL alter table document_media_draft drop constraint fk_document_media_draft_document_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('document_media_draft','U') AND name = 'ix_document_media_draft_document_id') drop index ix_document_media_draft_document_id ON document_media_draft; + +IF OBJECT_ID('fk_e_basicenc_relate_other_id', 'F') IS NOT NULL alter table e_basicenc_relate drop constraint fk_e_basicenc_relate_other_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('e_basicenc_relate','U') AND name = 'ix_e_basicenc_relate_other_id') drop index ix_e_basicenc_relate_other_id ON e_basicenc_relate; + +IF OBJECT_ID('fk_ebasic_json_map_detail_owner_id', 'F') IS NOT NULL alter table ebasic_json_map_detail drop constraint fk_ebasic_json_map_detail_owner_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ebasic_json_map_detail','U') AND name = 'ix_ebasic_json_map_detail_owner_id') drop index ix_ebasic_json_map_detail_owner_id ON ebasic_json_map_detail; + +IF OBJECT_ID('fk_ebasic_no_sdchild_owner_id', 'F') IS NOT NULL alter table ebasic_no_sdchild drop constraint fk_ebasic_no_sdchild_owner_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ebasic_no_sdchild','U') AND name = 'ix_ebasic_no_sdchild_owner_id') drop index ix_ebasic_no_sdchild_owner_id ON ebasic_no_sdchild; + +IF OBJECT_ID('fk_ebasic_sdchild_owner_id', 'F') IS NOT NULL alter table ebasic_sdchild drop constraint fk_ebasic_sdchild_owner_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ebasic_sdchild','U') AND name = 'ix_ebasic_sdchild_owner_id') drop index ix_ebasic_sdchild_owner_id ON ebasic_sdchild; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('e_basicverucon','U') AND name = 'uq_e_basicverucon_name') drop index uq_e_basicverucon_name ON e_basicverucon; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('e_basicverucon','U') AND name = 'uq_e_basicverucon_other_other_one') drop index uq_e_basicverucon_other_other_one ON e_basicverucon; +IF OBJECT_ID('fk_ecache_child_root_id', 'F') IS NOT NULL alter table ecache_child drop constraint fk_ecache_child_root_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ecache_child','U') AND name = 'ix_ecache_child_root_id') drop index ix_ecache_child_root_id ON ecache_child; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('edefault_prop','U') AND name = 'uq_edefault_prop_e_simple_usertypeid') drop index uq_edefault_prop_e_simple_usertypeid ON edefault_prop; +IF OBJECT_ID('fk_edefault_prop_e_simple_usertypeid', 'F') IS NOT NULL alter table edefault_prop drop constraint fk_edefault_prop_e_simple_usertypeid; + +IF OBJECT_ID('fk_eemb_inner_outer_id', 'F') IS NOT NULL alter table eemb_inner drop constraint fk_eemb_inner_outer_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('eemb_inner','U') AND name = 'ix_eemb_inner_outer_id') drop index ix_eemb_inner_outer_id ON eemb_inner; + +IF OBJECT_ID('fk_einvoice_person_id', 'F') IS NOT NULL alter table einvoice drop constraint fk_einvoice_person_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('einvoice','U') AND name = 'ix_einvoice_person_id') drop index ix_einvoice_person_id ON einvoice; + +IF OBJECT_ID('fk_enull_collection_detail_enull_collection_id', 'F') IS NOT NULL alter table enull_collection_detail drop constraint fk_enull_collection_detail_enull_collection_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('enull_collection_detail','U') AND name = 'ix_enull_collection_detail_enull_collection_id') drop index ix_enull_collection_detail_enull_collection_id ON enull_collection_detail; + +IF OBJECT_ID('fk_eopt_one_a_b_id', 'F') IS NOT NULL alter table eopt_one_a drop constraint fk_eopt_one_a_b_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('eopt_one_a','U') AND name = 'ix_eopt_one_a_b_id') drop index ix_eopt_one_a_b_id ON eopt_one_a; + +IF OBJECT_ID('fk_eopt_one_b_c_id', 'F') IS NOT NULL alter table eopt_one_b drop constraint fk_eopt_one_b_c_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('eopt_one_b','U') AND name = 'ix_eopt_one_b_c_id') drop index ix_eopt_one_b_c_id ON eopt_one_b; + +IF OBJECT_ID('fk_eper_addr_ma_country_code', 'F') IS NOT NULL alter table eper_addr drop constraint fk_eper_addr_ma_country_code; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('eper_addr','U') AND name = 'ix_eper_addr_ma_country_code') drop index ix_eper_addr_ma_country_code ON eper_addr; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('e_person_online','U') AND name = 'uq_e_person_online_email') drop index uq_e_person_online_email ON e_person_online; +IF OBJECT_ID('fk_esoft_del_book_lend_by_id', 'F') IS NOT NULL alter table esoft_del_book drop constraint fk_esoft_del_book_lend_by_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_book','U') AND name = 'ix_esoft_del_book_lend_by_id') drop index ix_esoft_del_book_lend_by_id ON esoft_del_book; + +IF OBJECT_ID('fk_esoft_del_book_esoft_del_user_esoft_del_book', 'F') IS NOT NULL alter table esoft_del_book_esoft_del_user drop constraint fk_esoft_del_book_esoft_del_user_esoft_del_book; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_book_esoft_del_user','U') AND name = 'ix_esoft_del_book_esoft_del_user_esoft_del_book') drop index ix_esoft_del_book_esoft_del_user_esoft_del_book ON esoft_del_book_esoft_del_user; + +IF OBJECT_ID('fk_esoft_del_book_esoft_del_user_esoft_del_user', 'F') IS NOT NULL alter table esoft_del_book_esoft_del_user drop constraint fk_esoft_del_book_esoft_del_user_esoft_del_user; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_book_esoft_del_user','U') AND name = 'ix_esoft_del_book_esoft_del_user_esoft_del_user') drop index ix_esoft_del_book_esoft_del_user_esoft_del_user ON esoft_del_book_esoft_del_user; + +IF OBJECT_ID('fk_esoft_del_down_esoft_del_mid_id', 'F') IS NOT NULL alter table esoft_del_down drop constraint fk_esoft_del_down_esoft_del_mid_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_down','U') AND name = 'ix_esoft_del_down_esoft_del_mid_id') drop index ix_esoft_del_down_esoft_del_mid_id ON esoft_del_down; + +IF OBJECT_ID('fk_esoft_del_mid_top_id', 'F') IS NOT NULL alter table esoft_del_mid drop constraint fk_esoft_del_mid_top_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_mid','U') AND name = 'ix_esoft_del_mid_top_id') drop index ix_esoft_del_mid_top_id ON esoft_del_mid; + +IF OBJECT_ID('fk_esoft_del_mid_up_id', 'F') IS NOT NULL alter table esoft_del_mid drop constraint fk_esoft_del_mid_up_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_mid','U') AND name = 'ix_esoft_del_mid_up_id') drop index ix_esoft_del_mid_up_id ON esoft_del_mid; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_one_a','U') AND name = 'uq_esoft_del_one_a_oneb_id') drop index uq_esoft_del_one_a_oneb_id ON esoft_del_one_a; +IF OBJECT_ID('fk_esoft_del_one_a_oneb_id', 'F') IS NOT NULL alter table esoft_del_one_a drop constraint fk_esoft_del_one_a_oneb_id; + +IF OBJECT_ID('fk_esoft_del_role_esoft_del_user_esoft_del_role', 'F') IS NOT NULL alter table esoft_del_role_esoft_del_user drop constraint fk_esoft_del_role_esoft_del_user_esoft_del_role; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_role_esoft_del_user','U') AND name = 'ix_esoft_del_role_esoft_del_user_esoft_del_role') drop index ix_esoft_del_role_esoft_del_user_esoft_del_role ON esoft_del_role_esoft_del_user; + +IF OBJECT_ID('fk_esoft_del_role_esoft_del_user_esoft_del_user', 'F') IS NOT NULL alter table esoft_del_role_esoft_del_user drop constraint fk_esoft_del_role_esoft_del_user_esoft_del_user; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_role_esoft_del_user','U') AND name = 'ix_esoft_del_role_esoft_del_user_esoft_del_user') drop index ix_esoft_del_role_esoft_del_user_esoft_del_user ON esoft_del_role_esoft_del_user; + +IF OBJECT_ID('fk_esoft_del_user_esoft_del_role_esoft_del_user', 'F') IS NOT NULL alter table esoft_del_user_esoft_del_role drop constraint fk_esoft_del_user_esoft_del_role_esoft_del_user; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_user_esoft_del_role','U') AND name = 'ix_esoft_del_user_esoft_del_role_esoft_del_user') drop index ix_esoft_del_user_esoft_del_role_esoft_del_user ON esoft_del_user_esoft_del_role; + +IF OBJECT_ID('fk_esoft_del_user_esoft_del_role_esoft_del_role', 'F') IS NOT NULL alter table esoft_del_user_esoft_del_role drop constraint fk_esoft_del_user_esoft_del_role_esoft_del_role; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_user_esoft_del_role','U') AND name = 'ix_esoft_del_user_esoft_del_role_esoft_del_role') drop index ix_esoft_del_user_esoft_del_role_esoft_del_role ON esoft_del_user_esoft_del_role; + +IF OBJECT_ID('fk_rawinherit_uncle_parent_id', 'F') IS NOT NULL alter table rawinherit_uncle drop constraint fk_rawinherit_uncle_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('rawinherit_uncle','U') AND name = 'ix_rawinherit_uncle_parent_id') drop index ix_rawinherit_uncle_parent_id ON rawinherit_uncle; + +IF OBJECT_ID('fk_evanilla_collection_detail_evanilla_collection_id', 'F') IS NOT NULL alter table evanilla_collection_detail drop constraint fk_evanilla_collection_detail_evanilla_collection_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('evanilla_collection_detail','U') AND name = 'ix_evanilla_collection_detail_evanilla_collection_id') drop index ix_evanilla_collection_detail_evanilla_collection_id ON evanilla_collection_detail; + +IF OBJECT_ID('fk_ec_enum_person_tags_ec_enum_person_id', 'F') IS NOT NULL alter table ec_enum_person_tags drop constraint fk_ec_enum_person_tags_ec_enum_person_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ec_enum_person_tags','U') AND name = 'ix_ec_enum_person_tags_ec_enum_person_id') drop index ix_ec_enum_person_tags_ec_enum_person_id ON ec_enum_person_tags; + +IF OBJECT_ID('fk_ec_person_phone_owner_id', 'F') IS NOT NULL alter table ec_person_phone drop constraint fk_ec_person_phone_owner_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ec_person_phone','U') AND name = 'ix_ec_person_phone_owner_id') drop index ix_ec_person_phone_owner_id ON ec_person_phone; + +IF OBJECT_ID('fk_ec_top_person_id', 'F') IS NOT NULL alter table ec_top drop constraint fk_ec_top_person_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ec_top','U') AND name = 'ix_ec_top_person_id') drop index ix_ec_top_person_id ON ec_top; + +IF OBJECT_ID('fk_ec_top_ecs_person_ec_top', 'F') IS NOT NULL alter table ec_top_ecs_person drop constraint fk_ec_top_ecs_person_ec_top; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ec_top_ecs_person','U') AND name = 'ix_ec_top_ecs_person_ec_top') drop index ix_ec_top_ecs_person_ec_top ON ec_top_ecs_person; + +IF OBJECT_ID('fk_ec_top_ecs_person_ecs_person', 'F') IS NOT NULL alter table ec_top_ecs_person drop constraint fk_ec_top_ecs_person_ecs_person; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ec_top_ecs_person','U') AND name = 'ix_ec_top_ecs_person_ecs_person') drop index ix_ec_top_ecs_person_ecs_person ON ec_top_ecs_person; + +IF OBJECT_ID('fk_ecbl_person_phone_numbers_person_id', 'F') IS NOT NULL alter table ecbl_person_phone_numbers drop constraint fk_ecbl_person_phone_numbers_person_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ecbl_person_phone_numbers','U') AND name = 'ix_ecbl_person_phone_numbers_person_id') drop index ix_ecbl_person_phone_numbers_person_id ON ecbl_person_phone_numbers; + +IF OBJECT_ID('fk_ecbm_person_phone_numbers_person_id', 'F') IS NOT NULL alter table ecbm_person_phone_numbers drop constraint fk_ecbm_person_phone_numbers_person_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ecbm_person_phone_numbers','U') AND name = 'ix_ecbm_person_phone_numbers_person_id') drop index ix_ecbm_person_phone_numbers_person_id ON ecbm_person_phone_numbers; + +IF OBJECT_ID('fk_ecm_person_phone_numbers_ecm_person_id', 'F') IS NOT NULL alter table ecm_person_phone_numbers drop constraint fk_ecm_person_phone_numbers_ecm_person_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ecm_person_phone_numbers','U') AND name = 'ix_ecm_person_phone_numbers_ecm_person_id') drop index ix_ecm_person_phone_numbers_ecm_person_id ON ecm_person_phone_numbers; + +IF OBJECT_ID('fk_ecmc_person_phone_numbers_ecmc_person_id', 'F') IS NOT NULL alter table ecmc_person_phone_numbers drop constraint fk_ecmc_person_phone_numbers_ecmc_person_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ecmc_person_phone_numbers','U') AND name = 'ix_ecmc_person_phone_numbers_ecmc_person_id') drop index ix_ecmc_person_phone_numbers_ecmc_person_id ON ecmc_person_phone_numbers; + +IF OBJECT_ID('fk_ecs_person_phone_ecs_person_id', 'F') IS NOT NULL alter table ecs_person_phone drop constraint fk_ecs_person_phone_ecs_person_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ecs_person_phone','U') AND name = 'ix_ecs_person_phone_ecs_person_id') drop index ix_ecs_person_phone_ecs_person_id ON ecs_person_phone; + +IF OBJECT_ID('fk_ecsm_child_ecsm_parent_id', 'F') IS NOT NULL alter table ecsm_child drop constraint fk_ecsm_child_ecsm_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ecsm_child','U') AND name = 'ix_ecsm_child_ecsm_parent_id') drop index ix_ecsm_child_ecsm_parent_id ON ecsm_child; + +IF OBJECT_ID('fk_td_child_parent_id', 'F') IS NOT NULL alter table td_child drop constraint fk_td_child_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('td_child','U') AND name = 'ix_td_child_parent_id') drop index ix_td_child_parent_id ON td_child; + +IF OBJECT_ID('fk_element_bean_complex_bean_id', 'F') IS NOT NULL alter table element_bean drop constraint fk_element_bean_complex_bean_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('element_bean','U') AND name = 'ix_element_bean_complex_bean_id') drop index ix_element_bean_complex_bean_id ON element_bean; + +IF OBJECT_ID('fk_empl_default_address_id', 'F') IS NOT NULL alter table empl drop constraint fk_empl_default_address_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('empl','U') AND name = 'ix_empl_default_address_id') drop index ix_empl_default_address_id ON empl; + +IF OBJECT_ID('fk_esd_detail_master_id', 'F') IS NOT NULL alter table esd_detail drop constraint fk_esd_detail_master_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esd_detail','U') AND name = 'ix_esd_detail_master_id') drop index ix_esd_detail_master_id ON esd_detail; + +IF OBJECT_ID('fk_grand_parent_person_some_bean_id', 'F') IS NOT NULL alter table grand_parent_person drop constraint fk_grand_parent_person_some_bean_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('grand_parent_person','U') AND name = 'ix_grand_parent_person_some_bean_id') drop index ix_grand_parent_person_some_bean_id ON grand_parent_person; + +IF OBJECT_ID('fk_survey_group_categoryobjectid', 'F') IS NOT NULL alter table survey_group drop constraint fk_survey_group_categoryobjectid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('survey_group','U') AND name = 'ix_survey_group_categoryobjectid') drop index ix_survey_group_categoryobjectid ON survey_group; + +IF OBJECT_ID('fk_hx_link_doc_hx_link', 'F') IS NOT NULL alter table hx_link_doc drop constraint fk_hx_link_doc_hx_link; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('hx_link_doc','U') AND name = 'ix_hx_link_doc_hx_link') drop index ix_hx_link_doc_hx_link ON hx_link_doc; + +IF OBJECT_ID('fk_hx_link_doc_he_doc', 'F') IS NOT NULL alter table hx_link_doc drop constraint fk_hx_link_doc_he_doc; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('hx_link_doc','U') AND name = 'ix_hx_link_doc_he_doc') drop index ix_hx_link_doc_he_doc ON hx_link_doc; + +IF OBJECT_ID('fk_hi_link_doc_hi_link', 'F') IS NOT NULL alter table hi_link_doc drop constraint fk_hi_link_doc_hi_link; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('hi_link_doc','U') AND name = 'ix_hi_link_doc_hi_link') drop index ix_hi_link_doc_hi_link ON hi_link_doc; + +IF OBJECT_ID('fk_hi_link_doc_hi_doc', 'F') IS NOT NULL alter table hi_link_doc drop constraint fk_hi_link_doc_hi_doc; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('hi_link_doc','U') AND name = 'ix_hi_link_doc_hi_doc') drop index ix_hi_link_doc_hi_doc ON hi_link_doc; + +IF OBJECT_ID('fk_hi_tthree_hi_ttwo_id', 'F') IS NOT NULL alter table hi_tthree drop constraint fk_hi_tthree_hi_ttwo_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('hi_tthree','U') AND name = 'ix_hi_tthree_hi_ttwo_id') drop index ix_hi_tthree_hi_ttwo_id ON hi_tthree; + +IF OBJECT_ID('fk_hi_ttwo_hi_tone_id', 'F') IS NOT NULL alter table hi_ttwo drop constraint fk_hi_ttwo_hi_tone_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('hi_ttwo','U') AND name = 'ix_hi_ttwo_hi_tone_id') drop index ix_hi_ttwo_hi_tone_id ON hi_ttwo; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('hsd_setting','U') AND name = 'uq_hsd_setting_user_id') drop index uq_hsd_setting_user_id ON hsd_setting; +IF OBJECT_ID('fk_hsd_setting_user_id', 'F') IS NOT NULL alter table hsd_setting drop constraint fk_hsd_setting_user_id; + +IF OBJECT_ID('fk_iaf_segment_status_id', 'F') IS NOT NULL alter table iaf_segment drop constraint fk_iaf_segment_status_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('iaf_segment','U') AND name = 'ix_iaf_segment_status_id') drop index ix_iaf_segment_status_id ON iaf_segment; + +IF OBJECT_ID('fk_imrelated_owner_id', 'F') IS NOT NULL alter table imrelated drop constraint fk_imrelated_owner_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('imrelated','U') AND name = 'ix_imrelated_owner_id') drop index ix_imrelated_owner_id ON imrelated; + +IF OBJECT_ID('fk_info_contact_company_id', 'F') IS NOT NULL alter table info_contact drop constraint fk_info_contact_company_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('info_contact','U') AND name = 'ix_info_contact_company_id') drop index ix_info_contact_company_id ON info_contact; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('info_customer','U') AND name = 'uq_info_customer_company_id') drop index uq_info_customer_company_id ON info_customer; +IF OBJECT_ID('fk_info_customer_company_id', 'F') IS NOT NULL alter table info_customer drop constraint fk_info_customer_company_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('inner_report','U') AND name = 'uq_inner_report_forecast_id') drop index uq_inner_report_forecast_id ON inner_report; +IF OBJECT_ID('fk_inner_report_forecast_id', 'F') IS NOT NULL alter table inner_report drop constraint fk_inner_report_forecast_id; + +IF OBJECT_ID('fk_drel_invoice_booking', 'F') IS NOT NULL alter table drel_invoice drop constraint fk_drel_invoice_booking; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('drel_invoice','U') AND name = 'ix_drel_invoice_booking') drop index ix_drel_invoice_booking ON drel_invoice; + +IF OBJECT_ID('fk_item_etype', 'F') IS NOT NULL alter table item drop constraint fk_item_etype; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('item','U') AND name = 'ix_item_etype') drop index ix_item_etype ON item; + +IF OBJECT_ID('fk_item_eregion', 'F') IS NOT NULL alter table item drop constraint fk_item_eregion; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('item','U') AND name = 'ix_item_eregion') drop index ix_item_eregion ON item; + +IF OBJECT_ID('fk_mkeygroup_monkey_mkeygroup', 'F') IS NOT NULL alter table mkeygroup_monkey drop constraint fk_mkeygroup_monkey_mkeygroup; + +IF OBJECT_ID('fk_mkeygroup_monkey_monkey', 'F') IS NOT NULL alter table mkeygroup_monkey drop constraint fk_mkeygroup_monkey_monkey; + +IF OBJECT_ID('fk_trainer_monkey_trainer', 'F') IS NOT NULL alter table trainer_monkey drop constraint fk_trainer_monkey_trainer; + +IF OBJECT_ID('fk_trainer_monkey_monkey', 'F') IS NOT NULL alter table trainer_monkey drop constraint fk_trainer_monkey_monkey; + +IF OBJECT_ID('fk_troop_monkey_troop', 'F') IS NOT NULL alter table troop_monkey drop constraint fk_troop_monkey_troop; + +IF OBJECT_ID('fk_troop_monkey_monkey', 'F') IS NOT NULL alter table troop_monkey drop constraint fk_troop_monkey_monkey; + +IF OBJECT_ID('fk_l2_cldf_reset_bean_child_parent_id', 'F') IS NOT NULL alter table l2_cldf_reset_bean_child drop constraint fk_l2_cldf_reset_bean_child_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('l2_cldf_reset_bean_child','U') AND name = 'ix_l2_cldf_reset_bean_child_parent_id') drop index ix_l2_cldf_reset_bean_child_parent_id ON l2_cldf_reset_bean_child; + +IF OBJECT_ID('fk_level1_level4_level1', 'F') IS NOT NULL alter table level1_level4 drop constraint fk_level1_level4_level1; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('level1_level4','U') AND name = 'ix_level1_level4_level1') drop index ix_level1_level4_level1 ON level1_level4; + +IF OBJECT_ID('fk_level1_level4_level4', 'F') IS NOT NULL alter table level1_level4 drop constraint fk_level1_level4_level4; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('level1_level4','U') AND name = 'ix_level1_level4_level4') drop index ix_level1_level4_level4 ON level1_level4; + +IF OBJECT_ID('fk_level1_level2_level1', 'F') IS NOT NULL alter table level1_level2 drop constraint fk_level1_level2_level1; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('level1_level2','U') AND name = 'ix_level1_level2_level1') drop index ix_level1_level2_level1 ON level1_level2; + +IF OBJECT_ID('fk_level1_level2_level2', 'F') IS NOT NULL alter table level1_level2 drop constraint fk_level1_level2_level2; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('level1_level2','U') AND name = 'ix_level1_level2_level2') drop index ix_level1_level2_level2 ON level1_level2; + +IF OBJECT_ID('fk_level2_level3_level2', 'F') IS NOT NULL alter table level2_level3 drop constraint fk_level2_level3_level2; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('level2_level3','U') AND name = 'ix_level2_level3_level2') drop index ix_level2_level3_level2 ON level2_level3; + +IF OBJECT_ID('fk_level2_level3_level3', 'F') IS NOT NULL alter table level2_level3 drop constraint fk_level2_level3_level3; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('level2_level3','U') AND name = 'ix_level2_level3_level3') drop index ix_level2_level3_level3 ON level2_level3; + +IF OBJECT_ID('fk_link_id', 'F') IS NOT NULL alter table link drop constraint fk_link_id; + +IF OBJECT_ID('fk_la_attr_value_attribute_la_attr_value', 'F') IS NOT NULL alter table la_attr_value_attribute drop constraint fk_la_attr_value_attribute_la_attr_value; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('la_attr_value_attribute','U') AND name = 'ix_la_attr_value_attribute_la_attr_value') drop index ix_la_attr_value_attribute_la_attr_value ON la_attr_value_attribute; + +IF OBJECT_ID('fk_la_attr_value_attribute_attribute', 'F') IS NOT NULL alter table la_attr_value_attribute drop constraint fk_la_attr_value_attribute_attribute; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('la_attr_value_attribute','U') AND name = 'ix_la_attr_value_attribute_attribute') drop index ix_la_attr_value_attribute_attribute ON la_attr_value_attribute; + +IF OBJECT_ID('fk_looney_tune_id', 'F') IS NOT NULL alter table looney drop constraint fk_looney_tune_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('looney','U') AND name = 'ix_looney_tune_id') drop index ix_looney_tune_id ON looney; + +IF OBJECT_ID('fk_mcontact_customer_id', 'F') IS NOT NULL alter table mcontact drop constraint fk_mcontact_customer_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mcontact','U') AND name = 'ix_mcontact_customer_id') drop index ix_mcontact_customer_id ON mcontact; + +IF OBJECT_ID('fk_mcontact_message_contact_id', 'F') IS NOT NULL alter table mcontact_message drop constraint fk_mcontact_message_contact_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mcontact_message','U') AND name = 'ix_mcontact_message_contact_id') drop index ix_mcontact_message_contact_id ON mcontact_message; + +IF OBJECT_ID('fk_mcustomer_shipping_address_id', 'F') IS NOT NULL alter table mcustomer drop constraint fk_mcustomer_shipping_address_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mcustomer','U') AND name = 'ix_mcustomer_shipping_address_id') drop index ix_mcustomer_shipping_address_id ON mcustomer; + +IF OBJECT_ID('fk_mcustomer_billing_address_id', 'F') IS NOT NULL alter table mcustomer drop constraint fk_mcustomer_billing_address_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mcustomer','U') AND name = 'ix_mcustomer_billing_address_id') drop index ix_mcustomer_billing_address_id ON mcustomer; + +IF OBJECT_ID('fk_mmachine_mgroup_mmachine', 'F') IS NOT NULL alter table mmachine_mgroup drop constraint fk_mmachine_mgroup_mmachine; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mmachine_mgroup','U') AND name = 'ix_mmachine_mgroup_mmachine') drop index ix_mmachine_mgroup_mmachine ON mmachine_mgroup; + +IF OBJECT_ID('fk_mmachine_mgroup_mgroup', 'F') IS NOT NULL alter table mmachine_mgroup drop constraint fk_mmachine_mgroup_mgroup; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mmachine_mgroup','U') AND name = 'ix_mmachine_mgroup_mgroup') drop index ix_mmachine_mgroup_mgroup ON mmachine_mgroup; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mprinter','U') AND name = 'uq_mprinter_last_swap_cyan_id') drop index uq_mprinter_last_swap_cyan_id ON mprinter; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mprinter','U') AND name = 'uq_mprinter_last_swap_magenta_id') drop index uq_mprinter_last_swap_magenta_id ON mprinter; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mprinter','U') AND name = 'uq_mprinter_last_swap_yellow_id') drop index uq_mprinter_last_swap_yellow_id ON mprinter; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mprinter','U') AND name = 'uq_mprinter_last_swap_black_id') drop index uq_mprinter_last_swap_black_id ON mprinter; +IF OBJECT_ID('fk_mprinter_current_state_id', 'F') IS NOT NULL alter table mprinter drop constraint fk_mprinter_current_state_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mprinter','U') AND name = 'ix_mprinter_current_state_id') drop index ix_mprinter_current_state_id ON mprinter; + +IF OBJECT_ID('fk_mprinter_last_swap_cyan_id', 'F') IS NOT NULL alter table mprinter drop constraint fk_mprinter_last_swap_cyan_id; + +IF OBJECT_ID('fk_mprinter_last_swap_magenta_id', 'F') IS NOT NULL alter table mprinter drop constraint fk_mprinter_last_swap_magenta_id; + +IF OBJECT_ID('fk_mprinter_last_swap_yellow_id', 'F') IS NOT NULL alter table mprinter drop constraint fk_mprinter_last_swap_yellow_id; + +IF OBJECT_ID('fk_mprinter_last_swap_black_id', 'F') IS NOT NULL alter table mprinter drop constraint fk_mprinter_last_swap_black_id; + +IF OBJECT_ID('fk_mprinter_state_printer_id', 'F') IS NOT NULL alter table mprinter_state drop constraint fk_mprinter_state_printer_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mprinter_state','U') AND name = 'ix_mprinter_state_printer_id') drop index ix_mprinter_state_printer_id ON mprinter_state; + +IF OBJECT_ID('fk_mprofile_picture_id', 'F') IS NOT NULL alter table mprofile drop constraint fk_mprofile_picture_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mprofile','U') AND name = 'ix_mprofile_picture_id') drop index ix_mprofile_picture_id ON mprofile; + +IF OBJECT_ID('fk_mrole_muser_mrole', 'F') IS NOT NULL alter table mrole_muser drop constraint fk_mrole_muser_mrole; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mrole_muser','U') AND name = 'ix_mrole_muser_mrole') drop index ix_mrole_muser_mrole ON mrole_muser; + +IF OBJECT_ID('fk_mrole_muser_muser', 'F') IS NOT NULL alter table mrole_muser drop constraint fk_mrole_muser_muser; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mrole_muser','U') AND name = 'ix_mrole_muser_muser') drop index ix_mrole_muser_muser ON mrole_muser; + +IF OBJECT_ID('fk_muser_user_type_id', 'F') IS NOT NULL alter table muser drop constraint fk_muser_user_type_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('muser','U') AND name = 'ix_muser_user_type_id') drop index ix_muser_user_type_id ON muser; + +IF OBJECT_ID('fk_mail_user_inbox_mail_user', 'F') IS NOT NULL alter table mail_user_inbox drop constraint fk_mail_user_inbox_mail_user; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mail_user_inbox','U') AND name = 'ix_mail_user_inbox_mail_user') drop index ix_mail_user_inbox_mail_user ON mail_user_inbox; + +IF OBJECT_ID('fk_mail_user_inbox_mail_box', 'F') IS NOT NULL alter table mail_user_inbox drop constraint fk_mail_user_inbox_mail_box; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mail_user_inbox','U') AND name = 'ix_mail_user_inbox_mail_box') drop index ix_mail_user_inbox_mail_box ON mail_user_inbox; + +IF OBJECT_ID('fk_mail_user_outbox_mail_user', 'F') IS NOT NULL alter table mail_user_outbox drop constraint fk_mail_user_outbox_mail_user; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mail_user_outbox','U') AND name = 'ix_mail_user_outbox_mail_user') drop index ix_mail_user_outbox_mail_user ON mail_user_outbox; + +IF OBJECT_ID('fk_mail_user_outbox_mail_box', 'F') IS NOT NULL alter table mail_user_outbox drop constraint fk_mail_user_outbox_mail_box; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mail_user_outbox','U') AND name = 'ix_mail_user_outbox_mail_box') drop index ix_mail_user_outbox_mail_box ON mail_user_outbox; + +IF OBJECT_ID('fk_c_message_conversation_id', 'F') IS NOT NULL alter table c_message drop constraint fk_c_message_conversation_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('c_message','U') AND name = 'ix_c_message_conversation_id') drop index ix_c_message_conversation_id ON c_message; + +IF OBJECT_ID('fk_c_message_user_id', 'F') IS NOT NULL alter table c_message drop constraint fk_c_message_user_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('c_message','U') AND name = 'ix_c_message_user_id') drop index ix_c_message_user_id ON c_message; + +IF OBJECT_ID('fk_meter_contract_data_special_needs_client_id', 'F') IS NOT NULL alter table meter_contract_data drop constraint fk_meter_contract_data_special_needs_client_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('meter_special_needs_client','U') AND name = 'uq_meter_special_needs_client_primary_id') drop index uq_meter_special_needs_client_primary_id ON meter_special_needs_client; +IF OBJECT_ID('fk_meter_special_needs_client_primary_id', 'F') IS NOT NULL alter table meter_special_needs_client drop constraint fk_meter_special_needs_client_primary_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('meter_version','U') AND name = 'uq_meter_version_address_data_id') drop index uq_meter_version_address_data_id ON meter_version; +IF OBJECT_ID('fk_meter_version_address_data_id', 'F') IS NOT NULL alter table meter_version drop constraint fk_meter_version_address_data_id; + +IF OBJECT_ID('fk_meter_version_contract_data_id', 'F') IS NOT NULL alter table meter_version drop constraint fk_meter_version_contract_data_id; + +IF OBJECT_ID('fk_mnoc_user_mnoc_role_mnoc_user', 'F') IS NOT NULL alter table mnoc_user_mnoc_role drop constraint fk_mnoc_user_mnoc_role_mnoc_user; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mnoc_user_mnoc_role','U') AND name = 'ix_mnoc_user_mnoc_role_mnoc_user') drop index ix_mnoc_user_mnoc_role_mnoc_user ON mnoc_user_mnoc_role; + +IF OBJECT_ID('fk_mnoc_user_mnoc_role_mnoc_role', 'F') IS NOT NULL alter table mnoc_user_mnoc_role drop constraint fk_mnoc_user_mnoc_role_mnoc_role; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mnoc_user_mnoc_role','U') AND name = 'ix_mnoc_user_mnoc_role_mnoc_role') drop index ix_mnoc_user_mnoc_role_mnoc_role ON mnoc_user_mnoc_role; + +IF OBJECT_ID('fk_mny_b_a_id', 'F') IS NOT NULL alter table mny_b drop constraint fk_mny_b_a_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mny_b','U') AND name = 'ix_mny_b_a_id') drop index ix_mny_b_a_id ON mny_b; + +IF OBJECT_ID('fk_mny_b_mny_c_mny_b', 'F') IS NOT NULL alter table mny_b_mny_c drop constraint fk_mny_b_mny_c_mny_b; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mny_b_mny_c','U') AND name = 'ix_mny_b_mny_c_mny_b') drop index ix_mny_b_mny_c_mny_b ON mny_b_mny_c; + +IF OBJECT_ID('fk_mny_b_mny_c_mny_c', 'F') IS NOT NULL alter table mny_b_mny_c drop constraint fk_mny_b_mny_c_mny_c; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mny_b_mny_c','U') AND name = 'ix_mny_b_mny_c_mny_c') drop index ix_mny_b_mny_c_mny_c ON mny_b_mny_c; + +IF OBJECT_ID('fk_subtopics_mny_topic_1', 'F') IS NOT NULL alter table subtopics drop constraint fk_subtopics_mny_topic_1; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('subtopics','U') AND name = 'ix_subtopics_mny_topic_1') drop index ix_subtopics_mny_topic_1 ON subtopics; + +IF OBJECT_ID('fk_subtopics_mny_topic_2', 'F') IS NOT NULL alter table subtopics drop constraint fk_subtopics_mny_topic_2; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('subtopics','U') AND name = 'ix_subtopics_mny_topic_2') drop index ix_subtopics_mny_topic_2 ON subtopics; + +IF OBJECT_ID('fk_mp_role_mp_user_id', 'F') IS NOT NULL alter table mp_role drop constraint fk_mp_role_mp_user_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mp_role','U') AND name = 'ix_mp_role_mp_user_id') drop index ix_mp_role_mp_user_id ON mp_role; + +IF OBJECT_ID('fk_ms_many_a_many_b_ms_many_a', 'F') IS NOT NULL alter table ms_many_a_many_b drop constraint fk_ms_many_a_many_b_ms_many_a; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ms_many_a_many_b','U') AND name = 'ix_ms_many_a_many_b_ms_many_a') drop index ix_ms_many_a_many_b_ms_many_a ON ms_many_a_many_b; + +IF OBJECT_ID('fk_ms_many_a_many_b_ms_many_b', 'F') IS NOT NULL alter table ms_many_a_many_b drop constraint fk_ms_many_a_many_b_ms_many_b; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ms_many_a_many_b','U') AND name = 'ix_ms_many_a_many_b_ms_many_b') drop index ix_ms_many_a_many_b_ms_many_b ON ms_many_a_many_b; + +IF OBJECT_ID('fk_ms_many_b_many_a_ms_many_b', 'F') IS NOT NULL alter table ms_many_b_many_a drop constraint fk_ms_many_b_many_a_ms_many_b; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ms_many_b_many_a','U') AND name = 'ix_ms_many_b_many_a_ms_many_b') drop index ix_ms_many_b_many_a_ms_many_b ON ms_many_b_many_a; + +IF OBJECT_ID('fk_ms_many_b_many_a_ms_many_a', 'F') IS NOT NULL alter table ms_many_b_many_a drop constraint fk_ms_many_b_many_a_ms_many_a; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ms_many_b_many_a','U') AND name = 'ix_ms_many_b_many_a_ms_many_a') drop index ix_ms_many_b_many_a_ms_many_a ON ms_many_b_many_a; + +IF OBJECT_ID('fk_my_lob_size_join_many_parent_id', 'F') IS NOT NULL alter table my_lob_size_join_many drop constraint fk_my_lob_size_join_many_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('my_lob_size_join_many','U') AND name = 'ix_my_lob_size_join_many_parent_id') drop index ix_my_lob_size_join_many_parent_id ON my_lob_size_join_many; + +IF OBJECT_ID('fk_o_bean_child_cached_bean_id', 'F') IS NOT NULL alter table o_bean_child drop constraint fk_o_bean_child_cached_bean_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_bean_child','U') AND name = 'ix_o_bean_child_cached_bean_id') drop index ix_o_bean_child_cached_bean_id ON o_bean_child; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ocached_app','U') AND name = 'uq_ocached_app_app_name') drop index uq_ocached_app_app_name ON ocached_app; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ocached_app_detail','U') AND name = 'uq_ocached_app_detail_app_id_detail') drop index uq_ocached_app_detail_app_id_detail ON ocached_app_detail; +IF OBJECT_ID('fk_ocached_app_detail_app_id', 'F') IS NOT NULL alter table ocached_app_detail drop constraint fk_ocached_app_detail_app_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ocached_app_detail','U') AND name = 'ix_ocached_app_detail_app_id') drop index ix_ocached_app_detail_app_id ON ocached_app_detail; + +IF OBJECT_ID('fk_o_cached_bean_country_o_cached_bean', 'F') IS NOT NULL alter table o_cached_bean_country drop constraint fk_o_cached_bean_country_o_cached_bean; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_cached_bean_country','U') AND name = 'ix_o_cached_bean_country_o_cached_bean') drop index ix_o_cached_bean_country_o_cached_bean ON o_cached_bean_country; + +IF OBJECT_ID('fk_o_cached_bean_country_o_country', 'F') IS NOT NULL alter table o_cached_bean_country drop constraint fk_o_cached_bean_country_o_country; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_cached_bean_country','U') AND name = 'ix_o_cached_bean_country_o_country') drop index ix_o_cached_bean_country_o_country ON o_cached_bean_country; + +IF OBJECT_ID('fk_o_cached_bean_child_cached_bean_id', 'F') IS NOT NULL alter table o_cached_bean_child drop constraint fk_o_cached_bean_child_cached_bean_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_cached_bean_child','U') AND name = 'ix_o_cached_bean_child_cached_bean_id') drop index ix_o_cached_bean_child_cached_bean_id ON o_cached_bean_child; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ocompany','U') AND name = 'uq_ocompany_corp_id') drop index uq_ocompany_corp_id ON ocompany; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oengine','U') AND name = 'uq_oengine_car_id') drop index uq_oengine_car_id ON oengine; +IF OBJECT_ID('fk_oengine_car_id', 'F') IS NOT NULL alter table oengine drop constraint fk_oengine_car_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ogear_box','U') AND name = 'uq_ogear_box_car_id') drop index uq_ogear_box_car_id ON ogear_box; +IF OBJECT_ID('fk_ogear_box_car_id', 'F') IS NOT NULL alter table ogear_box drop constraint fk_ogear_box_car_id; + +IF OBJECT_ID('fk_omvertex_other_omvertex_id', 'F') IS NOT NULL alter table omvertex_other drop constraint fk_omvertex_other_omvertex_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('omvertex_other','U') AND name = 'ix_omvertex_other_omvertex_id') drop index ix_omvertex_other_omvertex_id ON omvertex_other; + +IF OBJECT_ID('fk_oroad_show_msg_company_id', 'F') IS NOT NULL alter table oroad_show_msg drop constraint fk_oroad_show_msg_company_id; + +IF OBJECT_ID('fk_om_account_child_dbo_banana_rama_id', 'F') IS NOT NULL alter table om_account_child_dbo drop constraint fk_om_account_child_dbo_banana_rama_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('om_account_child_dbo','U') AND name = 'ix_om_account_child_dbo_banana_rama_id') drop index ix_om_account_child_dbo_banana_rama_id ON om_account_child_dbo; + +IF OBJECT_ID('fk_om_basic_child_parent_id', 'F') IS NOT NULL alter table om_basic_child drop constraint fk_om_basic_child_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('om_basic_child','U') AND name = 'ix_om_basic_child_parent_id') drop index ix_om_basic_child_parent_id ON om_basic_child; + +IF OBJECT_ID('fk_om_ordered_detail_master_id', 'F') IS NOT NULL alter table om_ordered_detail drop constraint fk_om_ordered_detail_master_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('om_ordered_detail','U') AND name = 'ix_om_ordered_detail_master_id') drop index ix_om_ordered_detail_master_id ON om_ordered_detail; + +IF OBJECT_ID('fk_o_order_kcustomer_id', 'F') IS NOT NULL alter table o_order drop constraint fk_o_order_kcustomer_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_order','U') AND name = 'ix_o_order_kcustomer_id') drop index ix_o_order_kcustomer_id ON o_order; + +IF OBJECT_ID('fk_o_order_detail_order_id', 'F') IS NOT NULL alter table o_order_detail drop constraint fk_o_order_detail_order_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_order_detail','U') AND name = 'ix_o_order_detail_order_id') drop index ix_o_order_detail_order_id ON o_order_detail; + +IF OBJECT_ID('fk_o_order_detail_product_id', 'F') IS NOT NULL alter table o_order_detail drop constraint fk_o_order_detail_product_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_order_detail','U') AND name = 'ix_o_order_detail_product_id') drop index ix_o_order_detail_product_id ON o_order_detail; + +IF OBJECT_ID('fk_s_order_items_order_uuid', 'F') IS NOT NULL alter table s_order_items drop constraint fk_s_order_items_order_uuid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('s_order_items','U') AND name = 'ix_s_order_items_order_uuid') drop index ix_s_order_items_order_uuid ON s_order_items; + +IF OBJECT_ID('fk_or_order_ship_order_id', 'F') IS NOT NULL alter table or_order_ship drop constraint fk_or_order_ship_order_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('or_order_ship','U') AND name = 'ix_or_order_ship_order_id') drop index ix_or_order_ship_order_id ON or_order_ship; + +IF OBJECT_ID('fk_organization_node_parent_tree_node_id', 'F') IS NOT NULL alter table organization_node drop constraint fk_organization_node_parent_tree_node_id; + +IF OBJECT_ID('fk_orp_detail_master_id', 'F') IS NOT NULL alter table orp_detail drop constraint fk_orp_detail_master_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('orp_detail','U') AND name = 'ix_orp_detail_master_id') drop index ix_orp_detail_master_id ON orp_detail; + +IF OBJECT_ID('fk_orp_detail2_orp_master2_id', 'F') IS NOT NULL alter table orp_detail2 drop constraint fk_orp_detail2_orp_master2_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('orp_detail2','U') AND name = 'ix_orp_detail2_orp_master2_id') drop index ix_orp_detail2_orp_master2_id ON orp_detail2; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oto_atwo','U') AND name = 'uq_oto_atwo_aone_id') drop index uq_oto_atwo_aone_id ON oto_atwo; +IF OBJECT_ID('fk_oto_atwo_aone_id', 'F') IS NOT NULL alter table oto_atwo drop constraint fk_oto_atwo_aone_id; + +IF OBJECT_ID('fk_oto_bchild_master_id', 'F') IS NOT NULL alter table oto_bchild drop constraint fk_oto_bchild_master_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oto_child','U') AND name = 'uq_oto_child_master_id') drop index uq_oto_child_master_id ON oto_child; +IF OBJECT_ID('fk_oto_child_master_id', 'F') IS NOT NULL alter table oto_child drop constraint fk_oto_child_master_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oto_cust_address','U') AND name = 'uq_oto_cust_address_customer_cid') drop index uq_oto_cust_address_customer_cid ON oto_cust_address; +IF OBJECT_ID('fk_oto_cust_address_customer_cid', 'F') IS NOT NULL alter table oto_cust_address drop constraint fk_oto_cust_address_customer_cid; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oto_level_a','U') AND name = 'uq_oto_level_a_b_id') drop index uq_oto_level_a_b_id ON oto_level_a; +IF OBJECT_ID('fk_oto_level_a_b_id', 'F') IS NOT NULL alter table oto_level_a drop constraint fk_oto_level_a_b_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oto_level_b','U') AND name = 'uq_oto_level_b_c_id') drop index uq_oto_level_b_c_id ON oto_level_b; +IF OBJECT_ID('fk_oto_level_b_c_id', 'F') IS NOT NULL alter table oto_level_b drop constraint fk_oto_level_b_c_id; + +IF OBJECT_ID('fk_oto_prime_extra_eid', 'F') IS NOT NULL alter table oto_prime_extra drop constraint fk_oto_prime_extra_eid; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oto_sd_child','U') AND name = 'uq_oto_sd_child_master_id') drop index uq_oto_sd_child_master_id ON oto_sd_child; +IF OBJECT_ID('fk_oto_sd_child_master_id', 'F') IS NOT NULL alter table oto_sd_child drop constraint fk_oto_sd_child_master_id; + +IF OBJECT_ID('fk_oto_th_many_oto_th_top_id', 'F') IS NOT NULL alter table oto_th_many drop constraint fk_oto_th_many_oto_th_top_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oto_th_many','U') AND name = 'ix_oto_th_many_oto_th_top_id') drop index ix_oto_th_many_oto_th_top_id ON oto_th_many; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oto_th_one','U') AND name = 'uq_oto_th_one_many_id') drop index uq_oto_th_one_many_id ON oto_th_one; +IF OBJECT_ID('fk_oto_th_one_many_id', 'F') IS NOT NULL alter table oto_th_one drop constraint fk_oto_th_one_many_id; + +IF OBJECT_ID('fk_oto_ubprime_extra_eid', 'F') IS NOT NULL alter table oto_ubprime_extra drop constraint fk_oto_ubprime_extra_eid; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oto_user_model','U') AND name = 'uq_oto_user_model_user_optional_id') drop index uq_oto_user_model_user_optional_id ON oto_user_model; +IF OBJECT_ID('fk_oto_user_model_user_optional_id', 'F') IS NOT NULL alter table oto_user_model drop constraint fk_oto_user_model_user_optional_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('pfile','U') AND name = 'uq_pfile_file_content_id') drop index uq_pfile_file_content_id ON pfile; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('pfile','U') AND name = 'uq_pfile_file_content2_id') drop index uq_pfile_file_content2_id ON pfile; +IF OBJECT_ID('fk_pfile_file_content_id', 'F') IS NOT NULL alter table pfile drop constraint fk_pfile_file_content_id; + +IF OBJECT_ID('fk_pfile_file_content2_id', 'F') IS NOT NULL alter table pfile drop constraint fk_pfile_file_content2_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('paggview','U') AND name = 'uq_paggview_pview_id') drop index uq_paggview_pview_id ON paggview; +IF OBJECT_ID('fk_paggview_pview_id', 'F') IS NOT NULL alter table paggview drop constraint fk_paggview_pview_id; + +IF OBJECT_ID('fk_pallet_location_zone_sid', 'F') IS NOT NULL alter table pallet_location drop constraint fk_pallet_location_zone_sid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('pallet_location','U') AND name = 'ix_pallet_location_zone_sid') drop index ix_pallet_location_zone_sid ON pallet_location; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('parcel_location','U') AND name = 'uq_parcel_location_parcelid') drop index uq_parcel_location_parcelid ON parcel_location; +IF OBJECT_ID('fk_parcel_location_parcelid', 'F') IS NOT NULL alter table parcel_location drop constraint fk_parcel_location_parcelid; + +IF OBJECT_ID('fk_rawinherit_parent_rawinherit_data_rawinherit_parent', 'F') IS NOT NULL alter table rawinherit_parent_rawinherit_data drop constraint fk_rawinherit_parent_rawinherit_data_rawinherit_parent; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('rawinherit_parent_rawinherit_data','U') AND name = 'ix_rawinherit_parent_rawinherit_data_rawinherit_parent') drop index ix_rawinherit_parent_rawinherit_data_rawinherit_parent ON rawinherit_parent_rawinherit_data; + +IF OBJECT_ID('fk_rawinherit_parent_rawinherit_data_rawinherit_data', 'F') IS NOT NULL alter table rawinherit_parent_rawinherit_data drop constraint fk_rawinherit_parent_rawinherit_data_rawinherit_data; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('rawinherit_parent_rawinherit_data','U') AND name = 'ix_rawinherit_parent_rawinherit_data_rawinherit_data') drop index ix_rawinherit_parent_rawinherit_data_rawinherit_data ON rawinherit_parent_rawinherit_data; + +IF OBJECT_ID('fk_parent_person_some_bean_id', 'F') IS NOT NULL alter table parent_person drop constraint fk_parent_person_some_bean_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('parent_person','U') AND name = 'ix_parent_person_some_bean_id') drop index ix_parent_person_some_bean_id ON parent_person; + +IF OBJECT_ID('fk_parent_person_parent_identifier', 'F') IS NOT NULL alter table parent_person drop constraint fk_parent_person_parent_identifier; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('parent_person','U') AND name = 'ix_parent_person_parent_identifier') drop index ix_parent_person_parent_identifier ON parent_person; + +IF OBJECT_ID('fk_c_participation_conversation_id', 'F') IS NOT NULL alter table c_participation drop constraint fk_c_participation_conversation_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('c_participation','U') AND name = 'ix_c_participation_conversation_id') drop index ix_c_participation_conversation_id ON c_participation; + +IF OBJECT_ID('fk_c_participation_user_id', 'F') IS NOT NULL alter table c_participation drop constraint fk_c_participation_user_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('c_participation','U') AND name = 'ix_c_participation_user_id') drop index ix_c_participation_user_id ON c_participation; + +IF OBJECT_ID('fk_pcf_calendar_pcf_person_id', 'F') IS NOT NULL alter table pcf_calendar drop constraint fk_pcf_calendar_pcf_person_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('pcf_calendar','U') AND name = 'ix_pcf_calendar_pcf_person_id') drop index ix_pcf_calendar_pcf_person_id ON pcf_calendar; + +IF OBJECT_ID('fk_pcf_city_pcf_country_id', 'F') IS NOT NULL alter table pcf_city drop constraint fk_pcf_city_pcf_country_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('pcf_city','U') AND name = 'ix_pcf_city_pcf_country_id') drop index ix_pcf_city_pcf_country_id ON pcf_city; + +IF OBJECT_ID('fk_pcf_city_mayor_id', 'F') IS NOT NULL alter table pcf_city drop constraint fk_pcf_city_mayor_id; + +IF OBJECT_ID('fk_pcf_city_vice_mayor_id', 'F') IS NOT NULL alter table pcf_city drop constraint fk_pcf_city_vice_mayor_id; + +IF OBJECT_ID('fk_pcf_event_pcf_calendar_id', 'F') IS NOT NULL alter table pcf_event drop constraint fk_pcf_event_pcf_calendar_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('pcf_event','U') AND name = 'ix_pcf_event_pcf_calendar_id') drop index ix_pcf_event_pcf_calendar_id ON pcf_event; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('persistent_file_content','U') AND name = 'uq_persistent_file_content_persistent_file_id') drop index uq_persistent_file_content_persistent_file_id ON persistent_file_content; +IF OBJECT_ID('fk_persistent_file_content_persistent_file_id', 'F') IS NOT NULL alter table persistent_file_content drop constraint fk_persistent_file_content_persistent_file_id; + +IF OBJECT_ID('fk_person_default_address_oid', 'F') IS NOT NULL alter table person drop constraint fk_person_default_address_oid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('person','U') AND name = 'ix_person_default_address_oid') drop index ix_person_default_address_oid ON person; + +IF OBJECT_ID('fk_person_cache_email_person_info_person_id', 'F') IS NOT NULL alter table person_cache_email drop constraint fk_person_cache_email_person_info_person_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('person_cache_email','U') AND name = 'ix_person_cache_email_person_info_person_id') drop index ix_person_cache_email_person_info_person_id ON person_cache_email; + +IF OBJECT_ID('fk_phones_person_id', 'F') IS NOT NULL alter table phones drop constraint fk_phones_person_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('phones','U') AND name = 'ix_phones_person_id') drop index ix_phones_person_id ON phones; + +IF OBJECT_ID('fk_e_position_contract_id', 'F') IS NOT NULL alter table e_position drop constraint fk_e_position_contract_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('e_position','U') AND name = 'ix_e_position_contract_id') drop index ix_e_position_contract_id ON e_position; + +IF OBJECT_ID('fk_pp_to_ww_pp', 'F') IS NOT NULL alter table pp_to_ww drop constraint fk_pp_to_ww_pp; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('pp_to_ww','U') AND name = 'ix_pp_to_ww_pp') drop index ix_pp_to_ww_pp ON pp_to_ww; + +IF OBJECT_ID('fk_pp_to_ww_wview', 'F') IS NOT NULL alter table pp_to_ww drop constraint fk_pp_to_ww_wview; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('pp_to_ww','U') AND name = 'ix_pp_to_ww_wview') drop index ix_pp_to_ww_wview ON pp_to_ww; + +IF OBJECT_ID('fk_question_groupobjectid', 'F') IS NOT NULL alter table question drop constraint fk_question_groupobjectid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('question','U') AND name = 'ix_question_groupobjectid') drop index ix_question_groupobjectid ON question; + +IF OBJECT_ID('fk_r_orders_customer', 'F') IS NOT NULL alter table r_orders drop constraint fk_r_orders_customer; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('r_orders','U') AND name = 'ix_r_orders_customer') drop index ix_r_orders_customer ON r_orders; + +IF OBJECT_ID('fk_rel_master_detail_id', 'F') IS NOT NULL alter table rel_master drop constraint fk_rel_master_detail_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('rel_master','U') AND name = 'ix_rel_master_detail_id') drop index ix_rel_master_detail_id ON rel_master; + +IF OBJECT_ID('fk_resourcefile_parentresourcefileid', 'F') IS NOT NULL alter table resourcefile drop constraint fk_resourcefile_parentresourcefileid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('resourcefile','U') AND name = 'ix_resourcefile_parentresourcefileid') drop index ix_resourcefile_parentresourcefileid ON resourcefile; + +IF OBJECT_ID('fk_mt_role_tenant_id', 'F') IS NOT NULL alter table mt_role drop constraint fk_mt_role_tenant_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mt_role','U') AND name = 'ix_mt_role_tenant_id') drop index ix_mt_role_tenant_id ON mt_role; + +IF OBJECT_ID('fk_mt_role_permission_mt_role', 'F') IS NOT NULL alter table mt_role_permission drop constraint fk_mt_role_permission_mt_role; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mt_role_permission','U') AND name = 'ix_mt_role_permission_mt_role') drop index ix_mt_role_permission_mt_role ON mt_role_permission; + +IF OBJECT_ID('fk_mt_role_permission_mt_permission', 'F') IS NOT NULL alter table mt_role_permission drop constraint fk_mt_role_permission_mt_permission; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mt_role_permission','U') AND name = 'ix_mt_role_permission_mt_permission') drop index ix_mt_role_permission_mt_permission ON mt_role_permission; + +IF OBJECT_ID('fk_root_bean_referencing_bean_id', 'F') IS NOT NULL alter table root_bean drop constraint fk_root_bean_referencing_bean_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('root_bean','U') AND name = 'ix_root_bean_referencing_bean_id') drop index ix_root_bean_referencing_bean_id ON root_bean; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('f_second','U') AND name = 'uq_f_second_first') drop index uq_f_second_first ON f_second; +IF OBJECT_ID('fk_f_second_first', 'F') IS NOT NULL alter table f_second drop constraint fk_f_second_first; + +IF OBJECT_ID('fk_section_article_id', 'F') IS NOT NULL alter table section drop constraint fk_section_article_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('section','U') AND name = 'ix_section_article_id') drop index ix_section_article_id ON section; + +IF OBJECT_ID('fk_self_parent_parent_id', 'F') IS NOT NULL alter table self_parent drop constraint fk_self_parent_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('self_parent','U') AND name = 'ix_self_parent_parent_id') drop index ix_self_parent_parent_id ON self_parent; + +IF OBJECT_ID('fk_self_ref_customer_referred_by_id', 'F') IS NOT NULL alter table self_ref_customer drop constraint fk_self_ref_customer_referred_by_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('self_ref_customer','U') AND name = 'ix_self_ref_customer_referred_by_id') drop index ix_self_ref_customer_referred_by_id ON self_ref_customer; + +IF OBJECT_ID('fk_self_ref_example_parent_id', 'F') IS NOT NULL alter table self_ref_example drop constraint fk_self_ref_example_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('self_ref_example','U') AND name = 'ix_self_ref_example_parent_id') drop index ix_self_ref_example_parent_id ON self_ref_example; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('e_save_test_b','U') AND name = 'uq_e_save_test_b_sibling_a_id') drop index uq_e_save_test_b_sibling_a_id ON e_save_test_b; +IF OBJECT_ID('fk_e_save_test_b_sibling_a_id', 'F') IS NOT NULL alter table e_save_test_b drop constraint fk_e_save_test_b_sibling_a_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('site','U') AND name = 'uq_site_data_container_id') drop index uq_site_data_container_id ON site; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('site','U') AND name = 'uq_site_site_address_id') drop index uq_site_site_address_id ON site; +IF OBJECT_ID('fk_site_parent_id', 'F') IS NOT NULL alter table site drop constraint fk_site_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('site','U') AND name = 'ix_site_parent_id') drop index ix_site_parent_id ON site; + +IF OBJECT_ID('fk_site_data_container_id', 'F') IS NOT NULL alter table site drop constraint fk_site_data_container_id; + +IF OBJECT_ID('fk_site_site_address_id', 'F') IS NOT NULL alter table site drop constraint fk_site_site_address_id; + +IF OBJECT_ID('fk_source_base_target_id', 'F') IS NOT NULL alter table source_base drop constraint fk_source_base_target_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('source_base','U') AND name = 'ix_source_base_target_id') drop index ix_source_base_target_id ON source_base; + +IF OBJECT_ID('fk_stockforecast_inner_report_id', 'F') IS NOT NULL alter table stockforecast drop constraint fk_stockforecast_inner_report_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('stockforecast','U') AND name = 'ix_stockforecast_inner_report_id') drop index ix_stockforecast_inner_report_id ON stockforecast; + +IF OBJECT_ID('fk_sub_section_section_id', 'F') IS NOT NULL alter table sub_section drop constraint fk_sub_section_section_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('sub_section','U') AND name = 'ix_sub_section_section_id') drop index ix_sub_section_section_id ON sub_section; + +IF OBJECT_ID('fk_tevent_many_event_id', 'F') IS NOT NULL alter table tevent_many drop constraint fk_tevent_many_event_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('tevent_many','U') AND name = 'ix_tevent_many_event_id') drop index ix_tevent_many_event_id ON tevent_many; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('tevent_one','U') AND name = 'uq_tevent_one_event_id') drop index uq_tevent_one_event_id ON tevent_one; +IF OBJECT_ID('fk_tevent_one_event_id', 'F') IS NOT NULL alter table tevent_one drop constraint fk_tevent_one_event_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('t_detail_with_other_namexxxyy','U') AND name = 'uq_t_detail_with_other_namexxxyy_some_unique_value') drop index uq_t_detail_with_other_namexxxyy_some_unique_value ON t_detail_with_other_namexxxyy; +IF OBJECT_ID('fk_t_detail_with_other_namexxxyy_master_id', 'F') IS NOT NULL alter table t_detail_with_other_namexxxyy drop constraint fk_t_detail_with_other_namexxxyy_master_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('t_detail_with_other_namexxxyy','U') AND name = 'ix_t_detail_with_other_namexxxyy_master_id') drop index ix_t_detail_with_other_namexxxyy_master_id ON t_detail_with_other_namexxxyy; + +IF OBJECT_ID('fk_ttruck_holder_truck_plate_no', 'F') IS NOT NULL alter table ttruck_holder drop constraint fk_ttruck_holder_truck_plate_no; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ttruck_holder','U') AND name = 'ix_ttruck_holder_truck_plate_no') drop index ix_ttruck_holder_truck_plate_no ON ttruck_holder; + +IF OBJECT_ID('fk_ttruck_holder_basic_id', 'F') IS NOT NULL alter table ttruck_holder drop constraint fk_ttruck_holder_basic_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ttruck_holder','U') AND name = 'ix_ttruck_holder_basic_id') drop index ix_ttruck_holder_basic_id ON ttruck_holder; + +IF OBJECT_ID('fk_ttruck_holder_item_owner_id', 'F') IS NOT NULL alter table ttruck_holder_item drop constraint fk_ttruck_holder_item_owner_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ttruck_holder_item','U') AND name = 'ix_ttruck_holder_item_owner_id') drop index ix_ttruck_holder_item_owner_id ON ttruck_holder_item; + +IF OBJECT_ID('fk_twheel_owner_plate_no', 'F') IS NOT NULL alter table twheel drop constraint fk_twheel_owner_plate_no; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('twheel','U') AND name = 'ix_twheel_owner_plate_no') drop index ix_twheel_owner_plate_no ON twheel; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('tire','U') AND name = 'uq_tire_wheel') drop index uq_tire_wheel ON tire; +IF OBJECT_ID('fk_tire_wheel', 'F') IS NOT NULL alter table tire drop constraint fk_tire_wheel; + +IF OBJECT_ID('fk_tree_entity_parent_id', 'F') IS NOT NULL alter table tree_entity drop constraint fk_tree_entity_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('tree_entity','U') AND name = 'ix_tree_entity_parent_id') drop index ix_tree_entity_parent_id ON tree_entity; + +IF OBJECT_ID('fk_trip_vehicle_driver_id', 'F') IS NOT NULL alter table trip drop constraint fk_trip_vehicle_driver_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('trip','U') AND name = 'ix_trip_vehicle_driver_id') drop index ix_trip_vehicle_driver_id ON trip; + +IF OBJECT_ID('fk_trip_address_id', 'F') IS NOT NULL alter table trip drop constraint fk_trip_address_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('trip','U') AND name = 'ix_trip_address_id') drop index ix_trip_address_id ON trip; + +IF OBJECT_ID('fk_type_sub_type_id', 'F') IS NOT NULL alter table [type] drop constraint fk_type_sub_type_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('[type]','U') AND name = 'ix_type_sub_type_id') drop index ix_type_sub_type_id ON [type]; + +IF OBJECT_ID('fk_usib_child_parent_id', 'F') IS NOT NULL alter table usib_child drop constraint fk_usib_child_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('usib_child','U') AND name = 'ix_usib_child_parent_id') drop index ix_usib_child_parent_id ON usib_child; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('usib_child_sibling','U') AND name = 'uq_usib_child_sibling_child_id') drop index uq_usib_child_sibling_child_id ON usib_child_sibling; +IF OBJECT_ID('fk_usib_child_sibling_child_id', 'F') IS NOT NULL alter table usib_child_sibling drop constraint fk_usib_child_sibling_child_id; + +IF OBJECT_ID('fk_ut_detail_utmaster_id', 'F') IS NOT NULL alter table ut_detail drop constraint fk_ut_detail_utmaster_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ut_detail','U') AND name = 'ix_ut_detail_utmaster_id') drop index ix_ut_detail_utmaster_id ON ut_detail; + +IF OBJECT_ID('fk_uutwo_master_id', 'F') IS NOT NULL alter table uutwo drop constraint fk_uutwo_master_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('uutwo','U') AND name = 'ix_uutwo_master_id') drop index ix_uutwo_master_id ON uutwo; + +IF OBJECT_ID('fk_oto_user_account_id', 'F') IS NOT NULL alter table oto_user drop constraint fk_oto_user_account_id; + +IF OBJECT_ID('fk_c_user_group_id', 'F') IS NOT NULL alter table c_user drop constraint fk_c_user_group_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('c_user','U') AND name = 'ix_c_user_group_id') drop index ix_c_user_group_id ON c_user; + +IF OBJECT_ID('fk_em_user_role_user_id', 'F') IS NOT NULL alter table em_user_role drop constraint fk_em_user_role_user_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('em_user_role','U') AND name = 'ix_em_user_role_user_id') drop index ix_em_user_role_user_id ON em_user_role; + +IF OBJECT_ID('fk_em_user_role_role_id', 'F') IS NOT NULL alter table em_user_role drop constraint fk_em_user_role_role_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('em_user_role','U') AND name = 'ix_em_user_role_role_id') drop index ix_em_user_role_role_id ON em_user_role; + +IF OBJECT_ID('fk_vehicle_lease_id', 'F') IS NOT NULL alter table vehicle drop constraint fk_vehicle_lease_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('vehicle','U') AND name = 'ix_vehicle_lease_id') drop index ix_vehicle_lease_id ON vehicle; + +IF OBJECT_ID('fk_vehicle_car_ref_id', 'F') IS NOT NULL alter table vehicle drop constraint fk_vehicle_car_ref_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('vehicle','U') AND name = 'ix_vehicle_car_ref_id') drop index ix_vehicle_car_ref_id ON vehicle; + +IF OBJECT_ID('fk_vehicle_truck_ref_id', 'F') IS NOT NULL alter table vehicle drop constraint fk_vehicle_truck_ref_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('vehicle','U') AND name = 'ix_vehicle_truck_ref_id') drop index ix_vehicle_truck_ref_id ON vehicle; + +IF OBJECT_ID('fk_vehicle_driver_vehicle_id', 'F') IS NOT NULL alter table vehicle_driver drop constraint fk_vehicle_driver_vehicle_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('vehicle_driver','U') AND name = 'ix_vehicle_driver_vehicle_id') drop index ix_vehicle_driver_vehicle_id ON vehicle_driver; + +IF OBJECT_ID('fk_vehicle_driver_address_id', 'F') IS NOT NULL alter table vehicle_driver drop constraint fk_vehicle_driver_address_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('vehicle_driver','U') AND name = 'ix_vehicle_driver_address_id') drop index ix_vehicle_driver_address_id ON vehicle_driver; + +IF OBJECT_ID('fk_warehouses_officezoneid', 'F') IS NOT NULL alter table warehouses drop constraint fk_warehouses_officezoneid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('warehouses','U') AND name = 'ix_warehouses_officezoneid') drop index ix_warehouses_officezoneid ON warehouses; + +IF OBJECT_ID('fk_warehousesshippingzones_warehouses', 'F') IS NOT NULL alter table warehousesshippingzones drop constraint fk_warehousesshippingzones_warehouses; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('warehousesshippingzones','U') AND name = 'ix_warehousesshippingzones_warehouses') drop index ix_warehousesshippingzones_warehouses ON warehousesshippingzones; + +IF OBJECT_ID('fk_warehousesshippingzones_zones', 'F') IS NOT NULL alter table warehousesshippingzones drop constraint fk_warehousesshippingzones_zones; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('warehousesshippingzones','U') AND name = 'ix_warehousesshippingzones_zones') drop index ix_warehousesshippingzones_zones ON warehousesshippingzones; + +IF OBJECT_ID('fk_sa_wheel_tire', 'F') IS NOT NULL alter table sa_wheel drop constraint fk_sa_wheel_tire; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('sa_wheel','U') AND name = 'ix_sa_wheel_tire') drop index ix_sa_wheel_tire ON sa_wheel; + +IF OBJECT_ID('fk_sa_wheel_car', 'F') IS NOT NULL alter table sa_wheel drop constraint fk_sa_wheel_car; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('sa_wheel','U') AND name = 'ix_sa_wheel_car') drop index ix_sa_wheel_car ON sa_wheel; + +IF OBJECT_ID('fk_g_who_props_otm_who_created_id', 'F') IS NOT NULL alter table g_who_props_otm drop constraint fk_g_who_props_otm_who_created_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('g_who_props_otm','U') AND name = 'ix_g_who_props_otm_who_created_id') drop index ix_g_who_props_otm_who_created_id ON g_who_props_otm; + +IF OBJECT_ID('fk_g_who_props_otm_who_modified_id', 'F') IS NOT NULL alter table g_who_props_otm drop constraint fk_g_who_props_otm_who_modified_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('g_who_props_otm','U') AND name = 'ix_g_who_props_otm_who_modified_id') drop index ix_g_who_props_otm_who_modified_id ON g_who_props_otm; + +IF OBJECT_ID('fk_with_zero_parent_id', 'F') IS NOT NULL alter table with_zero drop constraint fk_with_zero_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('with_zero','U') AND name = 'ix_with_zero_parent_id') drop index ix_with_zero_parent_id ON with_zero; + +if exists (select name from sys.types where name = 'ebean_bigint_tvp') drop type ebean_bigint_tvp; +if exists (select name from sys.types where name = 'ebean_float_tvp') drop type ebean_float_tvp; +if exists (select name from sys.types where name = 'ebean_bit_tvp') drop type ebean_bit_tvp; +if exists (select name from sys.types where name = 'ebean_date_tvp') drop type ebean_date_tvp; +if exists (select name from sys.types where name = 'ebean_time_tvp') drop type ebean_time_tvp; +if exists (select name from sys.types where name = 'ebean_uniqueidentifier_tvp') drop type ebean_uniqueidentifier_tvp; +if exists (select name from sys.types where name = 'ebean_nvarchar_tvp') drop type ebean_nvarchar_tvp; +IF OBJECT_ID('asimple_bean', 'U') IS NOT NULL drop table asimple_bean; +IF OBJECT_ID('asimple_bean_seq', 'SO') IS NOT NULL drop sequence asimple_bean_seq; + +IF OBJECT_ID('bar', 'U') IS NOT NULL drop table bar; +IF OBJECT_ID('bar_seq', 'SO') IS NOT NULL drop sequence bar_seq; + +IF OBJECT_ID('block', 'U') IS NOT NULL drop table block; +IF OBJECT_ID('block_seq', 'SO') IS NOT NULL drop sequence block_seq; + +IF OBJECT_ID('oto_account', 'U') IS NOT NULL drop table oto_account; +IF OBJECT_ID('oto_account_seq', 'SO') IS NOT NULL drop sequence oto_account_seq; + +IF OBJECT_ID('acl', 'U') IS NOT NULL drop table acl; +IF OBJECT_ID('acl_seq', 'SO') IS NOT NULL drop sequence acl_seq; + +IF OBJECT_ID('acl_container_relation', 'U') IS NOT NULL drop table acl_container_relation; +IF OBJECT_ID('acl_container_relation_seq', 'SO') IS NOT NULL drop sequence acl_container_relation_seq; + +IF OBJECT_ID('addr', 'U') IS NOT NULL drop table addr; +IF OBJECT_ID('addr_seq', 'SO') IS NOT NULL drop sequence addr_seq; + +IF OBJECT_ID('address', 'U') IS NOT NULL drop table address; +IF OBJECT_ID('address_seq', 'SO') IS NOT NULL drop sequence address_seq; + +IF OBJECT_ID('o_address', 'U') IS NOT NULL drop table o_address; +IF OBJECT_ID('o_address_seq', 'SO') IS NOT NULL drop sequence o_address_seq; + +IF OBJECT_ID('album', 'U') IS NOT NULL drop table album; +IF OBJECT_ID('album_seq', 'SO') IS NOT NULL drop sequence album_seq; + +IF OBJECT_ID('animal', 'U') IS NOT NULL drop table animal; +IF OBJECT_ID('animal_seq', 'SO') IS NOT NULL drop sequence animal_seq; + +IF OBJECT_ID('animal_shelter', 'U') IS NOT NULL drop table animal_shelter; +IF OBJECT_ID('animal_shelter_seq', 'SO') IS NOT NULL drop sequence animal_shelter_seq; + +IF OBJECT_ID('article', 'U') IS NOT NULL drop table article; +IF OBJECT_ID('article_seq', 'SO') IS NOT NULL drop sequence article_seq; + +IF OBJECT_ID('attribute', 'U') IS NOT NULL drop table attribute; +IF OBJECT_ID('attribute_seq', 'SO') IS NOT NULL drop sequence attribute_seq; + +IF OBJECT_ID('attribute_holder', 'U') IS NOT NULL drop table attribute_holder; +IF OBJECT_ID('attribute_holder_seq', 'SO') IS NOT NULL drop sequence attribute_holder_seq; + +IF OBJECT_ID('audit_log', 'U') IS NOT NULL drop table audit_log; +IF OBJECT_ID('audit_log_seq', 'SO') IS NOT NULL drop sequence audit_log_seq; + +IF OBJECT_ID('bbookmark', 'U') IS NOT NULL drop table bbookmark; +IF OBJECT_ID('bbookmark_seq', 'SO') IS NOT NULL drop sequence bbookmark_seq; + +IF OBJECT_ID('bbookmark_org', 'U') IS NOT NULL drop table bbookmark_org; +IF OBJECT_ID('bbookmark_org_seq', 'SO') IS NOT NULL drop sequence bbookmark_org_seq; + +IF OBJECT_ID('bbookmark_user', 'U') IS NOT NULL drop table bbookmark_user; +IF OBJECT_ID('bbookmark_user_seq', 'SO') IS NOT NULL drop sequence bbookmark_user_seq; + +IF OBJECT_ID('bsimple_with_gen', 'U') IS NOT NULL drop table bsimple_with_gen; +IF OBJECT_ID('bsimple_with_gen_seq', 'SO') IS NOT NULL drop sequence bsimple_with_gen_seq; + +IF OBJECT_ID('bsite', 'U') IS NOT NULL drop table bsite; + +IF OBJECT_ID('bsite_user_a', 'U') IS NOT NULL drop table bsite_user_a; + +IF OBJECT_ID('bsite_user_b', 'U') IS NOT NULL drop table bsite_user_b; + +IF OBJECT_ID('bsite_user_c', 'U') IS NOT NULL drop table bsite_user_c; + +IF OBJECT_ID('bsite_user_d', 'U') IS NOT NULL drop table bsite_user_d; + +IF OBJECT_ID('bsite_user_e', 'U') IS NOT NULL drop table bsite_user_e; + +IF OBJECT_ID('buser', 'U') IS NOT NULL drop table buser; + +IF OBJECT_ID('bwith_qident', 'U') IS NOT NULL drop table bwith_qident; +IF OBJECT_ID('bwith_qident_seq', 'SO') IS NOT NULL drop sequence bwith_qident_seq; + +IF OBJECT_ID('basic_draftable_bean', 'U') IS NOT NULL drop table basic_draftable_bean; +IF OBJECT_ID('basic_draftable_bean_seq', 'SO') IS NOT NULL drop sequence basic_draftable_bean_seq; + +IF OBJECT_ID('basic_draftable_bean_draft', 'U') IS NOT NULL drop table basic_draftable_bean_draft; +IF OBJECT_ID('basic_draftable_bean_draft_seq', 'SO') IS NOT NULL drop sequence basic_draftable_bean_draft_seq; + +IF OBJECT_ID('basic_joda_entity', 'U') IS NOT NULL drop table basic_joda_entity; +IF OBJECT_ID('basic_joda_entity_seq', 'SO') IS NOT NULL drop sequence basic_joda_entity_seq; + +IF OBJECT_ID('bean_with_time_zone', 'U') IS NOT NULL drop table bean_with_time_zone; +IF OBJECT_ID('bean_with_time_zone_seq', 'SO') IS NOT NULL drop sequence bean_with_time_zone_seq; + +IF OBJECT_ID('drel_booking', 'U') IS NOT NULL drop table drel_booking; +IF OBJECT_ID('drel_booking_seq', 'SO') IS NOT NULL drop sequence drel_booking_seq; + +IF OBJECT_ID('bw_bean', 'U') IS NOT NULL drop table bw_bean; +IF OBJECT_ID('bw_bean_seq', 'SO') IS NOT NULL drop sequence bw_bean_seq; + +IF OBJECT_ID('cepcategory', 'U') IS NOT NULL drop table cepcategory; +IF OBJECT_ID('cepcategory_seq', 'SO') IS NOT NULL drop sequence cepcategory_seq; + +IF OBJECT_ID('cepproduct', 'U') IS NOT NULL drop table cepproduct; +IF OBJECT_ID('cepproduct_seq', 'SO') IS NOT NULL drop sequence cepproduct_seq; + +IF OBJECT_ID('cepproduct_category', 'U') IS NOT NULL drop table cepproduct_category; + +IF OBJECT_ID('cinh_ref', 'U') IS NOT NULL drop table cinh_ref; +IF OBJECT_ID('cinh_ref_seq', 'SO') IS NOT NULL drop sequence cinh_ref_seq; + +IF OBJECT_ID('cinh_root', 'U') IS NOT NULL drop table cinh_root; +IF OBJECT_ID('cinh_root_seq', 'SO') IS NOT NULL drop sequence cinh_root_seq; + +IF OBJECT_ID('ckey_assoc', 'U') IS NOT NULL drop table ckey_assoc; +IF OBJECT_ID('ckey_assoc_seq', 'SO') IS NOT NULL drop sequence ckey_assoc_seq; + +IF OBJECT_ID('ckey_detail', 'U') IS NOT NULL drop table ckey_detail; +IF OBJECT_ID('ckey_detail_seq', 'SO') IS NOT NULL drop sequence ckey_detail_seq; + +IF OBJECT_ID('ckey_parent', 'U') IS NOT NULL drop table ckey_parent; + +IF OBJECT_ID('coone', 'U') IS NOT NULL drop table coone; +IF OBJECT_ID('coone_seq', 'SO') IS NOT NULL drop sequence coone_seq; + +IF OBJECT_ID('coone_many', 'U') IS NOT NULL drop table coone_many; +IF OBJECT_ID('coone_many_seq', 'SO') IS NOT NULL drop sequence coone_many_seq; + +IF OBJECT_ID('coroot', 'U') IS NOT NULL drop table coroot; +IF OBJECT_ID('coroot_seq', 'SO') IS NOT NULL drop sequence coroot_seq; + +IF OBJECT_ID('calculation_result', 'U') IS NOT NULL drop table calculation_result; +IF OBJECT_ID('calculation_result_seq', 'SO') IS NOT NULL drop sequence calculation_result_seq; + +IF OBJECT_ID('cao_bean', 'U') IS NOT NULL drop table cao_bean; + +IF OBJECT_ID('sp_car_car', 'U') IS NOT NULL drop table sp_car_car; +IF OBJECT_ID('sp_car_car_seq', 'SO') IS NOT NULL drop sequence sp_car_car_seq; + +IF OBJECT_ID('sp_car_car_wheels', 'U') IS NOT NULL drop table sp_car_car_wheels; + +IF OBJECT_ID('sp_car_car_doors', 'U') IS NOT NULL drop table sp_car_car_doors; + +IF OBJECT_ID('sa_car', 'U') IS NOT NULL drop table sa_car; +IF OBJECT_ID('sa_car_seq', 'SO') IS NOT NULL drop sequence sa_car_seq; + +IF OBJECT_ID('car_accessory', 'U') IS NOT NULL drop table car_accessory; +IF OBJECT_ID('car_accessory_seq', 'SO') IS NOT NULL drop sequence car_accessory_seq; + +IF OBJECT_ID('car_fuse', 'U') IS NOT NULL drop table car_fuse; +IF OBJECT_ID('car_fuse_seq', 'SO') IS NOT NULL drop sequence car_fuse_seq; + +IF OBJECT_ID('category', 'U') IS NOT NULL drop table category; +IF OBJECT_ID('category_seq', 'SO') IS NOT NULL drop sequence category_seq; + +IF OBJECT_ID('e_save_test_d', 'U') IS NOT NULL drop table e_save_test_d; +IF OBJECT_ID('e_save_test_d_seq', 'SO') IS NOT NULL drop sequence e_save_test_d_seq; + +IF OBJECT_ID('child_person', 'U') IS NOT NULL drop table child_person; +IF OBJECT_ID('child_person_seq', 'SO') IS NOT NULL drop sequence child_person_seq; + +IF OBJECT_ID('cke_client', 'U') IS NOT NULL drop table cke_client; + +IF OBJECT_ID('cke_user', 'U') IS NOT NULL drop table cke_user; + +IF OBJECT_ID('class_super', 'U') IS NOT NULL drop table class_super; +IF OBJECT_ID('class_super_seq', 'SO') IS NOT NULL drop sequence class_super_seq; + +IF OBJECT_ID('class_super_monkey', 'U') IS NOT NULL drop table class_super_monkey; + +IF OBJECT_ID('configuration', 'U') IS NOT NULL drop table configuration; +IF OBJECT_ID('configuration_seq', 'SO') IS NOT NULL drop sequence configuration_seq; + +IF OBJECT_ID('configurations', 'U') IS NOT NULL drop table configurations; +IF OBJECT_ID('configurations_seq', 'SO') IS NOT NULL drop sequence configurations_seq; + +IF OBJECT_ID('contact', 'U') IS NOT NULL drop table contact; +IF OBJECT_ID('contact_seq', 'SO') IS NOT NULL drop sequence contact_seq; + +IF OBJECT_ID('contact_group', 'U') IS NOT NULL drop table contact_group; +IF OBJECT_ID('contact_group_seq', 'SO') IS NOT NULL drop sequence contact_group_seq; + +IF OBJECT_ID('contact_note', 'U') IS NOT NULL drop table contact_note; +IF OBJECT_ID('contact_note_seq', 'SO') IS NOT NULL drop sequence contact_note_seq; + +IF OBJECT_ID('contract', 'U') IS NOT NULL drop table contract; +IF OBJECT_ID('contract_seq', 'SO') IS NOT NULL drop sequence contract_seq; + +IF OBJECT_ID('contract_costs', 'U') IS NOT NULL drop table contract_costs; +IF OBJECT_ID('contract_costs_seq', 'SO') IS NOT NULL drop sequence contract_costs_seq; + +IF OBJECT_ID('c_conversation', 'U') IS NOT NULL drop table c_conversation; +IF OBJECT_ID('c_conversation_seq', 'SO') IS NOT NULL drop sequence c_conversation_seq; + +IF OBJECT_ID('o_country', 'U') IS NOT NULL drop table o_country; + +IF OBJECT_ID('cover', 'U') IS NOT NULL drop table cover; +IF OBJECT_ID('cover_seq', 'SO') IS NOT NULL drop sequence cover_seq; + +IF OBJECT_ID('o_customer', 'U') IS NOT NULL drop table o_customer; +IF OBJECT_ID('o_customer_seq', 'SO') IS NOT NULL drop sequence o_customer_seq; + +IF OBJECT_ID('dcredit', 'U') IS NOT NULL drop table dcredit; +IF OBJECT_ID('dcredit_seq', 'SO') IS NOT NULL drop sequence dcredit_seq; + +IF OBJECT_ID('dcredit_drol', 'U') IS NOT NULL drop table dcredit_drol; + +IF OBJECT_ID('dexh_entity', 'U') IS NOT NULL drop table dexh_entity; +IF OBJECT_ID('dexh_entity_seq', 'SO') IS NOT NULL drop sequence dexh_entity_seq; + +IF OBJECT_ID('dint_parent', 'U') IS NOT NULL drop table dint_parent; +IF OBJECT_ID('dint_parent_seq', 'SO') IS NOT NULL drop sequence dint_parent_seq; + +IF OBJECT_ID('dmachine', 'U') IS NOT NULL drop table dmachine; +IF OBJECT_ID('dmachine_seq', 'SO') IS NOT NULL drop sequence dmachine_seq; + +IF OBJECT_ID('d_machine_aux_use', 'U') IS NOT NULL drop table d_machine_aux_use; +IF OBJECT_ID('d_machine_aux_use_seq', 'SO') IS NOT NULL drop sequence d_machine_aux_use_seq; + +IF OBJECT_ID('d_machine_stats', 'U') IS NOT NULL drop table d_machine_stats; +IF OBJECT_ID('d_machine_stats_seq', 'SO') IS NOT NULL drop sequence d_machine_stats_seq; + +IF OBJECT_ID('d_machine_use', 'U') IS NOT NULL drop table d_machine_use; +IF OBJECT_ID('d_machine_use_seq', 'SO') IS NOT NULL drop sequence d_machine_use_seq; + +IF OBJECT_ID('dorg', 'U') IS NOT NULL drop table dorg; +IF OBJECT_ID('dorg_seq', 'SO') IS NOT NULL drop sequence dorg_seq; + +IF OBJECT_ID('dperson', 'U') IS NOT NULL drop table dperson; +IF OBJECT_ID('dperson_seq', 'SO') IS NOT NULL drop sequence dperson_seq; + +IF OBJECT_ID('drol', 'U') IS NOT NULL drop table drol; +IF OBJECT_ID('drol_seq', 'SO') IS NOT NULL drop sequence drol_seq; + +IF OBJECT_ID('drot', 'U') IS NOT NULL drop table drot; +IF OBJECT_ID('drot_seq', 'SO') IS NOT NULL drop sequence drot_seq; + +IF OBJECT_ID('drot_drol', 'U') IS NOT NULL drop table drot_drol; + +IF OBJECT_ID('rawinherit_data', 'U') IS NOT NULL drop table rawinherit_data; +IF OBJECT_ID('rawinherit_data_seq', 'SO') IS NOT NULL drop sequence rawinherit_data_seq; + +IF OBJECT_ID('data_container', 'U') IS NOT NULL drop table data_container; + +IF OBJECT_ID('dc_detail', 'U') IS NOT NULL drop table dc_detail; +IF OBJECT_ID('dc_detail_seq', 'SO') IS NOT NULL drop sequence dc_detail_seq; + +IF OBJECT_ID('dc_master', 'U') IS NOT NULL drop table dc_master; +IF OBJECT_ID('dc_master_seq', 'SO') IS NOT NULL drop sequence dc_master_seq; + +IF OBJECT_ID('dfk_cascade', 'U') IS NOT NULL drop table dfk_cascade; +IF OBJECT_ID('dfk_cascade_seq', 'SO') IS NOT NULL drop sequence dfk_cascade_seq; + +IF OBJECT_ID('dfk_cascade_one', 'U') IS NOT NULL drop table dfk_cascade_one; +IF OBJECT_ID('dfk_cascade_one_seq', 'SO') IS NOT NULL drop sequence dfk_cascade_one_seq; + +IF OBJECT_ID('dfk_none', 'U') IS NOT NULL drop table dfk_none; +IF OBJECT_ID('dfk_none_seq', 'SO') IS NOT NULL drop sequence dfk_none_seq; + +IF OBJECT_ID('dfk_none_via_join', 'U') IS NOT NULL drop table dfk_none_via_join; +IF OBJECT_ID('dfk_none_via_join_seq', 'SO') IS NOT NULL drop sequence dfk_none_via_join_seq; + +IF OBJECT_ID('dfk_none_via_mto_m', 'U') IS NOT NULL drop table dfk_none_via_mto_m; +IF OBJECT_ID('dfk_none_via_mto_m_seq', 'SO') IS NOT NULL drop sequence dfk_none_via_mto_m_seq; + +IF OBJECT_ID('dfk_none_via_mto_m_dfk_one', 'U') IS NOT NULL drop table dfk_none_via_mto_m_dfk_one; + +IF OBJECT_ID('dfk_one', 'U') IS NOT NULL drop table dfk_one; +IF OBJECT_ID('dfk_one_seq', 'SO') IS NOT NULL drop sequence dfk_one_seq; + +IF OBJECT_ID('dfk_set_null', 'U') IS NOT NULL drop table dfk_set_null; +IF OBJECT_ID('dfk_set_null_seq', 'SO') IS NOT NULL drop sequence dfk_set_null_seq; + +IF OBJECT_ID('doc', 'U') IS NOT NULL drop table doc; +IF OBJECT_ID('doc_seq', 'SO') IS NOT NULL drop sequence doc_seq; + +IF OBJECT_ID('doc_link', 'U') IS NOT NULL drop table doc_link; + +IF OBJECT_ID('doc_link_draft', 'U') IS NOT NULL drop table doc_link_draft; + +IF OBJECT_ID('doc_draft', 'U') IS NOT NULL drop table doc_draft; +IF OBJECT_ID('doc_draft_seq', 'SO') IS NOT NULL drop sequence doc_draft_seq; + +IF OBJECT_ID('document', 'U') IS NOT NULL drop table document; +IF OBJECT_ID('document_seq', 'SO') IS NOT NULL drop sequence document_seq; + +IF OBJECT_ID('document_draft', 'U') IS NOT NULL drop table document_draft; +IF OBJECT_ID('document_draft_seq', 'SO') IS NOT NULL drop sequence document_draft_seq; + +IF OBJECT_ID('document_media', 'U') IS NOT NULL drop table document_media; +IF OBJECT_ID('document_media_seq', 'SO') IS NOT NULL drop sequence document_media_seq; + +IF OBJECT_ID('document_media_draft', 'U') IS NOT NULL drop table document_media_draft; +IF OBJECT_ID('document_media_draft_seq', 'SO') IS NOT NULL drop sequence document_media_draft_seq; + +IF OBJECT_ID('sp_car_door', 'U') IS NOT NULL drop table sp_car_door; +IF OBJECT_ID('sp_car_door_seq', 'SO') IS NOT NULL drop sequence sp_car_door_seq; + +IF OBJECT_ID('earray_bean', 'U') IS NOT NULL drop table earray_bean; +IF OBJECT_ID('earray_bean_seq', 'SO') IS NOT NULL drop sequence earray_bean_seq; + +IF OBJECT_ID('earray_set_bean', 'U') IS NOT NULL drop table earray_set_bean; +IF OBJECT_ID('earray_set_bean_seq', 'SO') IS NOT NULL drop sequence earray_set_bean_seq; + +IF OBJECT_ID('e_basic', 'U') IS NOT NULL drop table e_basic; +IF OBJECT_ID('e_basic_seq', 'SO') IS NOT NULL drop sequence e_basic_seq; + +IF OBJECT_ID('ebasic_change_log', 'U') IS NOT NULL drop table ebasic_change_log; +IF OBJECT_ID('ebasic_change_log_seq', 'SO') IS NOT NULL drop sequence ebasic_change_log_seq; + +IF OBJECT_ID('ebasic_clob', 'U') IS NOT NULL drop table ebasic_clob; +IF OBJECT_ID('ebasic_clob_seq', 'SO') IS NOT NULL drop sequence ebasic_clob_seq; + +IF OBJECT_ID('ebasic_clob_fetch_eager', 'U') IS NOT NULL drop table ebasic_clob_fetch_eager; +IF OBJECT_ID('ebasic_clob_fetch_eager_seq', 'SO') IS NOT NULL drop sequence ebasic_clob_fetch_eager_seq; + +IF OBJECT_ID('ebasic_clob_no_ver', 'U') IS NOT NULL drop table ebasic_clob_no_ver; +IF OBJECT_ID('ebasic_clob_no_ver_seq', 'SO') IS NOT NULL drop sequence ebasic_clob_no_ver_seq; + +IF OBJECT_ID('e_basicenc', 'U') IS NOT NULL drop table e_basicenc; +IF OBJECT_ID('e_basicenc_seq', 'SO') IS NOT NULL drop sequence e_basicenc_seq; + +IF OBJECT_ID('e_basicenc_bin', 'U') IS NOT NULL drop table e_basicenc_bin; +IF OBJECT_ID('e_basicenc_bin_seq', 'SO') IS NOT NULL drop sequence e_basicenc_bin_seq; + +IF OBJECT_ID('e_basicenc_client', 'U') IS NOT NULL drop table e_basicenc_client; +IF OBJECT_ID('e_basicenc_client_seq', 'SO') IS NOT NULL drop sequence e_basicenc_client_seq; + +IF OBJECT_ID('e_basicenc_relate', 'U') IS NOT NULL drop table e_basicenc_relate; +IF OBJECT_ID('e_basicenc_relate_seq', 'SO') IS NOT NULL drop sequence e_basicenc_relate_seq; + +IF OBJECT_ID('e_basic_enum_id', 'U') IS NOT NULL drop table e_basic_enum_id; + +IF OBJECT_ID('e_basic_eni', 'U') IS NOT NULL drop table e_basic_eni; +IF OBJECT_ID('e_basic_eni_seq', 'SO') IS NOT NULL drop sequence e_basic_eni_seq; + +IF OBJECT_ID('ebasic_hstore', 'U') IS NOT NULL drop table ebasic_hstore; +IF OBJECT_ID('ebasic_hstore_seq', 'SO') IS NOT NULL drop sequence ebasic_hstore_seq; + +IF OBJECT_ID('ebasic_json_jackson', 'U') IS NOT NULL drop table ebasic_json_jackson; +IF OBJECT_ID('ebasic_json_jackson_seq', 'SO') IS NOT NULL drop sequence ebasic_json_jackson_seq; + +IF OBJECT_ID('ebasic_json_jackson2', 'U') IS NOT NULL drop table ebasic_json_jackson2; +IF OBJECT_ID('ebasic_json_jackson2_seq', 'SO') IS NOT NULL drop sequence ebasic_json_jackson2_seq; + +IF OBJECT_ID('ebasic_json_list', 'U') IS NOT NULL drop table ebasic_json_list; +IF OBJECT_ID('ebasic_json_list_seq', 'SO') IS NOT NULL drop sequence ebasic_json_list_seq; + +IF OBJECT_ID('ebasic_json_map', 'U') IS NOT NULL drop table ebasic_json_map; +IF OBJECT_ID('ebasic_json_map_seq', 'SO') IS NOT NULL drop sequence ebasic_json_map_seq; + +IF OBJECT_ID('ebasic_json_map_blob', 'U') IS NOT NULL drop table ebasic_json_map_blob; +IF OBJECT_ID('ebasic_json_map_blob_seq', 'SO') IS NOT NULL drop sequence ebasic_json_map_blob_seq; + +IF OBJECT_ID('ebasic_json_map_clob', 'U') IS NOT NULL drop table ebasic_json_map_clob; +IF OBJECT_ID('ebasic_json_map_clob_seq', 'SO') IS NOT NULL drop sequence ebasic_json_map_clob_seq; + +IF OBJECT_ID('ebasic_json_map_detail', 'U') IS NOT NULL drop table ebasic_json_map_detail; +IF OBJECT_ID('ebasic_json_map_detail_seq', 'SO') IS NOT NULL drop sequence ebasic_json_map_detail_seq; + +IF OBJECT_ID('ebasic_json_map_json_b', 'U') IS NOT NULL drop table ebasic_json_map_json_b; +IF OBJECT_ID('ebasic_json_map_json_b_seq', 'SO') IS NOT NULL drop sequence ebasic_json_map_json_b_seq; + +IF OBJECT_ID('ebasic_json_map_varchar', 'U') IS NOT NULL drop table ebasic_json_map_varchar; +IF OBJECT_ID('ebasic_json_map_varchar_seq', 'SO') IS NOT NULL drop sequence ebasic_json_map_varchar_seq; + +IF OBJECT_ID('ebasic_json_node', 'U') IS NOT NULL drop table ebasic_json_node; +IF OBJECT_ID('ebasic_json_node_seq', 'SO') IS NOT NULL drop sequence ebasic_json_node_seq; + +IF OBJECT_ID('ebasic_json_node_blob', 'U') IS NOT NULL drop table ebasic_json_node_blob; +IF OBJECT_ID('ebasic_json_node_blob_seq', 'SO') IS NOT NULL drop sequence ebasic_json_node_blob_seq; + +IF OBJECT_ID('ebasic_json_node_json_b', 'U') IS NOT NULL drop table ebasic_json_node_json_b; +IF OBJECT_ID('ebasic_json_node_json_b_seq', 'SO') IS NOT NULL drop sequence ebasic_json_node_json_b_seq; + +IF OBJECT_ID('ebasic_json_node_varchar', 'U') IS NOT NULL drop table ebasic_json_node_varchar; +IF OBJECT_ID('ebasic_json_node_varchar_seq', 'SO') IS NOT NULL drop sequence ebasic_json_node_varchar_seq; + +IF OBJECT_ID('ebasic_json_unmapped', 'U') IS NOT NULL drop table ebasic_json_unmapped; +IF OBJECT_ID('ebasic_json_unmapped_seq', 'SO') IS NOT NULL drop sequence ebasic_json_unmapped_seq; + +IF OBJECT_ID('e_basic_ndc', 'U') IS NOT NULL drop table e_basic_ndc; +IF OBJECT_ID('e_basic_ndc_seq', 'SO') IS NOT NULL drop sequence e_basic_ndc_seq; + +IF OBJECT_ID('ebasic_no_sdchild', 'U') IS NOT NULL drop table ebasic_no_sdchild; +IF OBJECT_ID('ebasic_no_sdchild_seq', 'SO') IS NOT NULL drop sequence ebasic_no_sdchild_seq; + +IF OBJECT_ID('ebasic_sdchild', 'U') IS NOT NULL drop table ebasic_sdchild; +IF OBJECT_ID('ebasic_sdchild_seq', 'SO') IS NOT NULL drop sequence ebasic_sdchild_seq; + +IF OBJECT_ID('ebasic_soft_delete', 'U') IS NOT NULL drop table ebasic_soft_delete; +IF OBJECT_ID('ebasic_soft_delete_seq', 'SO') IS NOT NULL drop sequence ebasic_soft_delete_seq; + +IF OBJECT_ID('e_basicver', 'U') IS NOT NULL drop table e_basicver; +IF OBJECT_ID('e_basicver_seq', 'SO') IS NOT NULL drop sequence e_basicver_seq; + +IF OBJECT_ID('e_basic_withlife', 'U') IS NOT NULL drop table e_basic_withlife; +IF OBJECT_ID('e_basic_withlife_seq', 'SO') IS NOT NULL drop sequence e_basic_withlife_seq; + +IF OBJECT_ID('e_basic_with_ex', 'U') IS NOT NULL drop table e_basic_with_ex; +IF OBJECT_ID('e_basic_with_ex_seq', 'SO') IS NOT NULL drop sequence e_basic_with_ex_seq; + +IF OBJECT_ID('e_basicverucon', 'U') IS NOT NULL drop table e_basicverucon; +IF OBJECT_ID('e_basicverucon_seq', 'SO') IS NOT NULL drop sequence e_basicverucon_seq; + +IF OBJECT_ID('ecache_child', 'U') IS NOT NULL drop table ecache_child; + +IF OBJECT_ID('ecache_root', 'U') IS NOT NULL drop table ecache_root; + +IF OBJECT_ID('e_col_ab', 'U') IS NOT NULL drop table e_col_ab; +IF OBJECT_ID('e_col_ab_seq', 'SO') IS NOT NULL drop sequence e_col_ab_seq; + +IF OBJECT_ID('ecustom_id', 'U') IS NOT NULL drop table ecustom_id; + +IF OBJECT_ID('edefault_prop', 'U') IS NOT NULL drop table edefault_prop; +IF OBJECT_ID('edefault_prop_seq', 'SO') IS NOT NULL drop sequence edefault_prop_seq; + +IF OBJECT_ID('eemb_inner', 'U') IS NOT NULL drop table eemb_inner; +IF OBJECT_ID('eemb_inner_seq', 'SO') IS NOT NULL drop sequence eemb_inner_seq; + +IF OBJECT_ID('eemb_outer', 'U') IS NOT NULL drop table eemb_outer; +IF OBJECT_ID('eemb_outer_seq', 'SO') IS NOT NULL drop sequence eemb_outer_seq; + +IF OBJECT_ID('efile2_no_fk', 'U') IS NOT NULL drop table efile2_no_fk; + +IF OBJECT_ID('efile_no_fk', 'U') IS NOT NULL drop table efile_no_fk; + +IF OBJECT_ID('efile_no_fk_euser_no_fk', 'U') IS NOT NULL drop table efile_no_fk_euser_no_fk; + +IF OBJECT_ID('efile_no_fk_euser_no_fk_soft_del', 'U') IS NOT NULL drop table efile_no_fk_euser_no_fk_soft_del; + +IF OBJECT_ID('egen_props', 'U') IS NOT NULL drop table egen_props; +IF OBJECT_ID('egen_props_seq', 'SO') IS NOT NULL drop sequence egen_props_seq; + +IF OBJECT_ID('eid_uid_bean', 'U') IS NOT NULL drop table eid_uid_bean; +IF OBJECT_ID('eid_uid_bean_seq', 'SO') IS NOT NULL drop sequence eid_uid_bean_seq; + +IF OBJECT_ID('einvoice', 'U') IS NOT NULL drop table einvoice; +IF OBJECT_ID('einvoice_seq', 'SO') IS NOT NULL drop sequence einvoice_seq; + +IF OBJECT_ID('e_main', 'U') IS NOT NULL drop table e_main; +IF OBJECT_ID('e_main_seq', 'SO') IS NOT NULL drop sequence e_main_seq; + +IF OBJECT_ID('enull_collection', 'U') IS NOT NULL drop table enull_collection; +IF OBJECT_ID('enull_collection_seq', 'SO') IS NOT NULL drop sequence enull_collection_seq; + +IF OBJECT_ID('enull_collection_detail', 'U') IS NOT NULL drop table enull_collection_detail; +IF OBJECT_ID('enull_collection_detail_seq', 'SO') IS NOT NULL drop sequence enull_collection_detail_seq; + +IF OBJECT_ID('eopt_one_a', 'U') IS NOT NULL drop table eopt_one_a; +IF OBJECT_ID('eopt_one_a_seq', 'SO') IS NOT NULL drop sequence eopt_one_a_seq; + +IF OBJECT_ID('eopt_one_b', 'U') IS NOT NULL drop table eopt_one_b; +IF OBJECT_ID('eopt_one_b_seq', 'SO') IS NOT NULL drop sequence eopt_one_b_seq; + +IF OBJECT_ID('eopt_one_c', 'U') IS NOT NULL drop table eopt_one_c; +IF OBJECT_ID('eopt_one_c_seq', 'SO') IS NOT NULL drop sequence eopt_one_c_seq; + +IF OBJECT_ID('eper_addr', 'U') IS NOT NULL drop table eper_addr; +IF OBJECT_ID('eper_addr_seq', 'SO') IS NOT NULL drop sequence eper_addr_seq; + +IF OBJECT_ID('eperson', 'U') IS NOT NULL drop table eperson; +IF OBJECT_ID('eperson_seq', 'SO') IS NOT NULL drop sequence eperson_seq; + +IF OBJECT_ID('e_person_online', 'U') IS NOT NULL drop table e_person_online; +IF OBJECT_ID('e_person_online_seq', 'SO') IS NOT NULL drop sequence e_person_online_seq; + +IF OBJECT_ID('esimple', 'U') IS NOT NULL drop table esimple; + +IF OBJECT_ID('esoft_del_book', 'U') IS NOT NULL drop table esoft_del_book; +IF OBJECT_ID('esoft_del_book_seq', 'SO') IS NOT NULL drop sequence esoft_del_book_seq; + +IF OBJECT_ID('esoft_del_book_esoft_del_user', 'U') IS NOT NULL drop table esoft_del_book_esoft_del_user; + +IF OBJECT_ID('esoft_del_down', 'U') IS NOT NULL drop table esoft_del_down; +IF OBJECT_ID('esoft_del_down_seq', 'SO') IS NOT NULL drop sequence esoft_del_down_seq; + +IF OBJECT_ID('esoft_del_mid', 'U') IS NOT NULL drop table esoft_del_mid; +IF OBJECT_ID('esoft_del_mid_seq', 'SO') IS NOT NULL drop sequence esoft_del_mid_seq; + +IF OBJECT_ID('esoft_del_one_a', 'U') IS NOT NULL drop table esoft_del_one_a; +IF OBJECT_ID('esoft_del_one_a_seq', 'SO') IS NOT NULL drop sequence esoft_del_one_a_seq; + +IF OBJECT_ID('esoft_del_one_b', 'U') IS NOT NULL drop table esoft_del_one_b; +IF OBJECT_ID('esoft_del_one_b_seq', 'SO') IS NOT NULL drop sequence esoft_del_one_b_seq; + +IF OBJECT_ID('esoft_del_role', 'U') IS NOT NULL drop table esoft_del_role; +IF OBJECT_ID('esoft_del_role_seq', 'SO') IS NOT NULL drop sequence esoft_del_role_seq; + +IF OBJECT_ID('esoft_del_role_esoft_del_user', 'U') IS NOT NULL drop table esoft_del_role_esoft_del_user; + +IF OBJECT_ID('esoft_del_top', 'U') IS NOT NULL drop table esoft_del_top; +IF OBJECT_ID('esoft_del_top_seq', 'SO') IS NOT NULL drop sequence esoft_del_top_seq; + +IF OBJECT_ID('esoft_del_up', 'U') IS NOT NULL drop table esoft_del_up; +IF OBJECT_ID('esoft_del_up_seq', 'SO') IS NOT NULL drop sequence esoft_del_up_seq; + +IF OBJECT_ID('esoft_del_user', 'U') IS NOT NULL drop table esoft_del_user; +IF OBJECT_ID('esoft_del_user_seq', 'SO') IS NOT NULL drop sequence esoft_del_user_seq; + +IF OBJECT_ID('esoft_del_user_esoft_del_role', 'U') IS NOT NULL drop table esoft_del_user_esoft_del_role; + +IF OBJECT_ID('esome_convert_type', 'U') IS NOT NULL drop table esome_convert_type; +IF OBJECT_ID('esome_convert_type_seq', 'SO') IS NOT NULL drop sequence esome_convert_type_seq; + +IF OBJECT_ID('esome_type', 'U') IS NOT NULL drop table esome_type; +IF OBJECT_ID('esome_type_seq', 'SO') IS NOT NULL drop sequence esome_type_seq; + +IF OBJECT_ID('etrans_many', 'U') IS NOT NULL drop table etrans_many; +IF OBJECT_ID('etrans_many_seq', 'SO') IS NOT NULL drop sequence etrans_many_seq; + +IF OBJECT_ID('rawinherit_uncle', 'U') IS NOT NULL drop table rawinherit_uncle; +IF OBJECT_ID('rawinherit_uncle_seq', 'SO') IS NOT NULL drop sequence rawinherit_uncle_seq; + +IF OBJECT_ID('euser_no_fk', 'U') IS NOT NULL drop table euser_no_fk; +IF OBJECT_ID('euser_no_fk_seq', 'SO') IS NOT NULL drop sequence euser_no_fk_seq; + +IF OBJECT_ID('euser_no_fk_soft_del', 'U') IS NOT NULL drop table euser_no_fk_soft_del; +IF OBJECT_ID('euser_no_fk_soft_del_seq', 'SO') IS NOT NULL drop sequence euser_no_fk_soft_del_seq; + +IF OBJECT_ID('evanilla_collection', 'U') IS NOT NULL drop table evanilla_collection; +IF OBJECT_ID('evanilla_collection_seq', 'SO') IS NOT NULL drop sequence evanilla_collection_seq; + +IF OBJECT_ID('evanilla_collection_detail', 'U') IS NOT NULL drop table evanilla_collection_detail; +IF OBJECT_ID('evanilla_collection_detail_seq', 'SO') IS NOT NULL drop sequence evanilla_collection_detail_seq; + +IF OBJECT_ID('ewho_props', 'U') IS NOT NULL drop table ewho_props; +IF OBJECT_ID('ewho_props_seq', 'SO') IS NOT NULL drop sequence ewho_props_seq; + +IF OBJECT_ID('e_withinet', 'U') IS NOT NULL drop table e_withinet; +IF OBJECT_ID('e_withinet_seq', 'SO') IS NOT NULL drop sequence e_withinet_seq; + +IF OBJECT_ID('ec_enum_person', 'U') IS NOT NULL drop table ec_enum_person; +IF OBJECT_ID('ec_enum_person_seq', 'SO') IS NOT NULL drop sequence ec_enum_person_seq; + +IF OBJECT_ID('ec_enum_person_tags', 'U') IS NOT NULL drop table ec_enum_person_tags; + +IF OBJECT_ID('ec_person', 'U') IS NOT NULL drop table ec_person; +IF OBJECT_ID('ec_person_seq', 'SO') IS NOT NULL drop sequence ec_person_seq; + +IF OBJECT_ID('ec_person_phone', 'U') IS NOT NULL drop table ec_person_phone; + +IF OBJECT_ID('ec_top', 'U') IS NOT NULL drop table ec_top; +IF OBJECT_ID('ec_top_seq', 'SO') IS NOT NULL drop sequence ec_top_seq; + +IF OBJECT_ID('ec_top_ecs_person', 'U') IS NOT NULL drop table ec_top_ecs_person; + +IF OBJECT_ID('ecbl_person', 'U') IS NOT NULL drop table ecbl_person; +IF OBJECT_ID('ecbl_person_seq', 'SO') IS NOT NULL drop sequence ecbl_person_seq; + +IF OBJECT_ID('ecbl_person_phone_numbers', 'U') IS NOT NULL drop table ecbl_person_phone_numbers; + +IF OBJECT_ID('ecbm_person', 'U') IS NOT NULL drop table ecbm_person; +IF OBJECT_ID('ecbm_person_seq', 'SO') IS NOT NULL drop sequence ecbm_person_seq; + +IF OBJECT_ID('ecbm_person_phone_numbers', 'U') IS NOT NULL drop table ecbm_person_phone_numbers; + +IF OBJECT_ID('ecm_person', 'U') IS NOT NULL drop table ecm_person; +IF OBJECT_ID('ecm_person_seq', 'SO') IS NOT NULL drop sequence ecm_person_seq; + +IF OBJECT_ID('ecm_person_phone_numbers', 'U') IS NOT NULL drop table ecm_person_phone_numbers; + +IF OBJECT_ID('ecmc_person', 'U') IS NOT NULL drop table ecmc_person; +IF OBJECT_ID('ecmc_person_seq', 'SO') IS NOT NULL drop sequence ecmc_person_seq; + +IF OBJECT_ID('ecmc_person_phone_numbers', 'U') IS NOT NULL drop table ecmc_person_phone_numbers; + +IF OBJECT_ID('ecs_person', 'U') IS NOT NULL drop table ecs_person; +IF OBJECT_ID('ecs_person_seq', 'SO') IS NOT NULL drop sequence ecs_person_seq; + +IF OBJECT_ID('ecs_person_phone', 'U') IS NOT NULL drop table ecs_person_phone; + +IF OBJECT_ID('ecsm_child', 'U') IS NOT NULL drop table ecsm_child; + +IF OBJECT_ID('ecsm_values', 'U') IS NOT NULL drop table ecsm_values; + +IF OBJECT_ID('ecsm_one', 'U') IS NOT NULL drop table ecsm_one; + +IF OBJECT_ID('ecsm_parent', 'U') IS NOT NULL drop table ecsm_parent; +IF OBJECT_ID('ecsm_parent_seq', 'SO') IS NOT NULL drop sequence ecsm_parent_seq; + +IF OBJECT_ID('ecsm_two', 'U') IS NOT NULL drop table ecsm_two; + +IF OBJECT_ID('td_child', 'U') IS NOT NULL drop table td_child; +IF OBJECT_ID('td_child_seq', 'SO') IS NOT NULL drop sequence td_child_seq; + +IF OBJECT_ID('td_parent', 'U') IS NOT NULL drop table td_parent; +IF OBJECT_ID('td_parent_seq', 'SO') IS NOT NULL drop sequence td_parent_seq; + +IF OBJECT_ID('element_bean', 'U') IS NOT NULL drop table element_bean; +IF OBJECT_ID('element_bean_seq', 'SO') IS NOT NULL drop sequence element_bean_seq; + +IF OBJECT_ID('empl', 'U') IS NOT NULL drop table empl; +IF OBJECT_ID('empl_seq', 'SO') IS NOT NULL drop sequence empl_seq; + +IF OBJECT_ID('esd_detail', 'U') IS NOT NULL drop table esd_detail; +IF OBJECT_ID('esd_detail_seq', 'SO') IS NOT NULL drop sequence esd_detail_seq; + +IF OBJECT_ID('esd_master', 'U') IS NOT NULL drop table esd_master; +IF OBJECT_ID('esd_master_seq', 'SO') IS NOT NULL drop sequence esd_master_seq; + +IF OBJECT_ID('feature_desc', 'U') IS NOT NULL drop table feature_desc; +IF OBJECT_ID('feature_desc_seq', 'SO') IS NOT NULL drop sequence feature_desc_seq; + +IF OBJECT_ID('f_first', 'U') IS NOT NULL drop table f_first; +IF OBJECT_ID('f_first_seq', 'SO') IS NOT NULL drop sequence f_first_seq; + +IF OBJECT_ID('foo', 'U') IS NOT NULL drop table foo; +IF OBJECT_ID('foo_seq', 'SO') IS NOT NULL drop sequence foo_seq; + +IF OBJECT_ID('gen_key_identity', 'U') IS NOT NULL drop table gen_key_identity; + +IF OBJECT_ID('gen_key_sequence', 'U') IS NOT NULL drop table gen_key_sequence; +IF OBJECT_ID('gen_key_sequence_seq', 'SO') IS NOT NULL drop sequence gen_key_sequence_seq; + +IF OBJECT_ID('gen_key_table', 'U') IS NOT NULL drop table gen_key_table; +IF OBJECT_ID('gen_key_table_seq', 'SO') IS NOT NULL drop sequence gen_key_table_seq; + +IF OBJECT_ID('grand_parent_person', 'U') IS NOT NULL drop table grand_parent_person; +IF OBJECT_ID('grand_parent_person_seq', 'SO') IS NOT NULL drop sequence grand_parent_person_seq; + +IF OBJECT_ID('survey_group', 'U') IS NOT NULL drop table survey_group; +IF OBJECT_ID('survey_group_seq', 'SO') IS NOT NULL drop sequence survey_group_seq; + +IF OBJECT_ID('c_group', 'U') IS NOT NULL drop table c_group; +IF OBJECT_ID('c_group_seq', 'SO') IS NOT NULL drop sequence c_group_seq; + +IF OBJECT_ID('he_doc', 'U') IS NOT NULL drop table he_doc; +IF OBJECT_ID('he_doc_seq', 'SO') IS NOT NULL drop sequence he_doc_seq; + +IF OBJECT_ID('hx_link', 'U') IS NOT NULL alter table hx_link set (system_versioning = off); +IF OBJECT_ID('hx_link_history', 'U') IS NOT NULL drop table hx_link_history; +IF OBJECT_ID('hx_link', 'U') IS NOT NULL drop table hx_link; +IF OBJECT_ID('hx_link_seq', 'SO') IS NOT NULL drop sequence hx_link_seq; + +IF OBJECT_ID('hx_link_doc', 'U') IS NOT NULL drop table hx_link_doc; + +IF OBJECT_ID('hi_doc', 'U') IS NOT NULL drop table hi_doc; +IF OBJECT_ID('hi_doc_seq', 'SO') IS NOT NULL drop sequence hi_doc_seq; + +IF OBJECT_ID('hi_link', 'U') IS NOT NULL alter table hi_link set (system_versioning = off); +IF OBJECT_ID('hi_link_history', 'U') IS NOT NULL drop table hi_link_history; +IF OBJECT_ID('hi_link', 'U') IS NOT NULL drop table hi_link; +IF OBJECT_ID('hi_link_seq', 'SO') IS NOT NULL drop sequence hi_link_seq; + +IF OBJECT_ID('hi_link_doc', 'U') IS NOT NULL alter table hi_link_doc set (system_versioning = off); +IF OBJECT_ID('hi_link_doc_history', 'U') IS NOT NULL drop table hi_link_doc_history; +IF OBJECT_ID('hi_link_doc', 'U') IS NOT NULL drop table hi_link_doc; + +IF OBJECT_ID('hi_tone', 'U') IS NOT NULL alter table hi_tone set (system_versioning = off); +IF OBJECT_ID('hi_tone_history', 'U') IS NOT NULL drop table hi_tone_history; +IF OBJECT_ID('hi_tone', 'U') IS NOT NULL drop table hi_tone; +IF OBJECT_ID('hi_tone_seq', 'SO') IS NOT NULL drop sequence hi_tone_seq; + +IF OBJECT_ID('hi_tthree', 'U') IS NOT NULL alter table hi_tthree set (system_versioning = off); +IF OBJECT_ID('hi_tthree_history', 'U') IS NOT NULL drop table hi_tthree_history; +IF OBJECT_ID('hi_tthree', 'U') IS NOT NULL drop table hi_tthree; +IF OBJECT_ID('hi_tthree_seq', 'SO') IS NOT NULL drop sequence hi_tthree_seq; + +IF OBJECT_ID('hi_ttwo', 'U') IS NOT NULL alter table hi_ttwo set (system_versioning = off); +IF OBJECT_ID('hi_ttwo_history', 'U') IS NOT NULL drop table hi_ttwo_history; +IF OBJECT_ID('hi_ttwo', 'U') IS NOT NULL drop table hi_ttwo; +IF OBJECT_ID('hi_ttwo_seq', 'SO') IS NOT NULL drop sequence hi_ttwo_seq; + +IF OBJECT_ID('hsd_setting', 'U') IS NOT NULL alter table hsd_setting set (system_versioning = off); +IF OBJECT_ID('hsd_setting_history', 'U') IS NOT NULL drop table hsd_setting_history; +IF OBJECT_ID('hsd_setting', 'U') IS NOT NULL drop table hsd_setting; +IF OBJECT_ID('hsd_setting_seq', 'SO') IS NOT NULL drop sequence hsd_setting_seq; + +IF OBJECT_ID('hsd_user', 'U') IS NOT NULL alter table hsd_user set (system_versioning = off); +IF OBJECT_ID('hsd_user_history', 'U') IS NOT NULL drop table hsd_user_history; +IF OBJECT_ID('hsd_user', 'U') IS NOT NULL drop table hsd_user; +IF OBJECT_ID('hsd_user_seq', 'SO') IS NOT NULL drop sequence hsd_user_seq; + +IF OBJECT_ID('iaf_segment', 'U') IS NOT NULL drop table iaf_segment; +IF OBJECT_ID('iaf_segment_seq', 'SO') IS NOT NULL drop sequence iaf_segment_seq; + +IF OBJECT_ID('iaf_segment_status', 'U') IS NOT NULL drop table iaf_segment_status; +IF OBJECT_ID('iaf_segment_status_seq', 'SO') IS NOT NULL drop sequence iaf_segment_status_seq; + +IF OBJECT_ID('imrelated', 'U') IS NOT NULL drop table imrelated; +IF OBJECT_ID('imrelated_seq', 'SO') IS NOT NULL drop sequence imrelated_seq; + +IF OBJECT_ID('imroot', 'U') IS NOT NULL drop table imroot; +IF OBJECT_ID('imroot_seq', 'SO') IS NOT NULL drop sequence imroot_seq; + +IF OBJECT_ID('ixresource', 'U') IS NOT NULL drop table ixresource; + +IF OBJECT_ID('info_company', 'U') IS NOT NULL drop table info_company; +IF OBJECT_ID('info_company_seq', 'SO') IS NOT NULL drop sequence info_company_seq; + +IF OBJECT_ID('info_contact', 'U') IS NOT NULL drop table info_contact; +IF OBJECT_ID('info_contact_seq', 'SO') IS NOT NULL drop sequence info_contact_seq; + +IF OBJECT_ID('info_customer', 'U') IS NOT NULL drop table info_customer; +IF OBJECT_ID('info_customer_seq', 'SO') IS NOT NULL drop sequence info_customer_seq; + +IF OBJECT_ID('inner_report', 'U') IS NOT NULL drop table inner_report; +IF OBJECT_ID('inner_report_seq', 'SO') IS NOT NULL drop sequence inner_report_seq; + +IF OBJECT_ID('drel_invoice', 'U') IS NOT NULL drop table drel_invoice; +IF OBJECT_ID('drel_invoice_seq', 'SO') IS NOT NULL drop sequence drel_invoice_seq; + +IF OBJECT_ID('item', 'U') IS NOT NULL drop table item; + +IF OBJECT_ID('monkey', 'U') IS NOT NULL drop table monkey; +IF OBJECT_ID('monkey_seq', 'SO') IS NOT NULL drop sequence monkey_seq; + +IF OBJECT_ID('mkeygroup', 'U') IS NOT NULL drop table mkeygroup; +IF OBJECT_ID('mkeygroup_seq', 'SO') IS NOT NULL drop sequence mkeygroup_seq; + +IF OBJECT_ID('mkeygroup_monkey', 'U') IS NOT NULL drop table mkeygroup_monkey; + +IF OBJECT_ID('trainer', 'U') IS NOT NULL drop table trainer; +IF OBJECT_ID('trainer_seq', 'SO') IS NOT NULL drop sequence trainer_seq; + +IF OBJECT_ID('trainer_monkey', 'U') IS NOT NULL drop table trainer_monkey; + +IF OBJECT_ID('troop', 'U') IS NOT NULL drop table troop; +IF OBJECT_ID('troop_seq', 'SO') IS NOT NULL drop sequence troop_seq; + +IF OBJECT_ID('troop_monkey', 'U') IS NOT NULL drop table troop_monkey; + +IF OBJECT_ID('l2_cldf_reset_bean', 'U') IS NOT NULL drop table l2_cldf_reset_bean; +IF OBJECT_ID('l2_cldf_reset_bean_seq', 'SO') IS NOT NULL drop sequence l2_cldf_reset_bean_seq; + +IF OBJECT_ID('l2_cldf_reset_bean_child', 'U') IS NOT NULL drop table l2_cldf_reset_bean_child; +IF OBJECT_ID('l2_cldf_reset_bean_child_seq', 'SO') IS NOT NULL drop sequence l2_cldf_reset_bean_child_seq; + +IF OBJECT_ID('level1', 'U') IS NOT NULL drop table level1; +IF OBJECT_ID('level1_seq', 'SO') IS NOT NULL drop sequence level1_seq; + +IF OBJECT_ID('level1_level4', 'U') IS NOT NULL drop table level1_level4; + +IF OBJECT_ID('level1_level2', 'U') IS NOT NULL drop table level1_level2; + +IF OBJECT_ID('level2', 'U') IS NOT NULL drop table level2; +IF OBJECT_ID('level2_seq', 'SO') IS NOT NULL drop sequence level2_seq; + +IF OBJECT_ID('level2_level3', 'U') IS NOT NULL drop table level2_level3; + +IF OBJECT_ID('level3', 'U') IS NOT NULL drop table level3; +IF OBJECT_ID('level3_seq', 'SO') IS NOT NULL drop sequence level3_seq; + +IF OBJECT_ID('level4', 'U') IS NOT NULL drop table level4; +IF OBJECT_ID('level4_seq', 'SO') IS NOT NULL drop sequence level4_seq; + +IF OBJECT_ID('link', 'U') IS NOT NULL alter table link set (system_versioning = off); +IF OBJECT_ID('link_history', 'U') IS NOT NULL drop table link_history; +IF OBJECT_ID('link', 'U') IS NOT NULL drop table link; +IF OBJECT_ID('link_seq', 'SO') IS NOT NULL drop sequence link_seq; + +IF OBJECT_ID('link_draft', 'U') IS NOT NULL drop table link_draft; +IF OBJECT_ID('link_draft_seq', 'SO') IS NOT NULL drop sequence link_draft_seq; + +IF OBJECT_ID('la_attr_value', 'U') IS NOT NULL drop table la_attr_value; +IF OBJECT_ID('la_attr_value_seq', 'SO') IS NOT NULL drop sequence la_attr_value_seq; + +IF OBJECT_ID('la_attr_value_attribute', 'U') IS NOT NULL drop table la_attr_value_attribute; + +IF OBJECT_ID('looney', 'U') IS NOT NULL drop table looney; +IF OBJECT_ID('looney_seq', 'SO') IS NOT NULL drop sequence looney_seq; + +IF OBJECT_ID('maddress', 'U') IS NOT NULL drop table maddress; + +IF OBJECT_ID('mcontact', 'U') IS NOT NULL drop table mcontact; + +IF OBJECT_ID('mcontact_message', 'U') IS NOT NULL drop table mcontact_message; + +IF OBJECT_ID('mcustomer', 'U') IS NOT NULL drop table mcustomer; + +IF OBJECT_ID('mgroup', 'U') IS NOT NULL drop table mgroup; +IF OBJECT_ID('mgroup_seq', 'SO') IS NOT NULL drop sequence mgroup_seq; + +IF OBJECT_ID('mmachine', 'U') IS NOT NULL drop table mmachine; +IF OBJECT_ID('mmachine_seq', 'SO') IS NOT NULL drop sequence mmachine_seq; + +IF OBJECT_ID('mmachine_mgroup', 'U') IS NOT NULL drop table mmachine_mgroup; + +IF OBJECT_ID('mmedia', 'U') IS NOT NULL drop table mmedia; +IF OBJECT_ID('mmedia_seq', 'SO') IS NOT NULL drop sequence mmedia_seq; + +IF OBJECT_ID('non_updateprop', 'U') IS NOT NULL drop table non_updateprop; +IF OBJECT_ID('non_updateprop_seq', 'SO') IS NOT NULL drop sequence non_updateprop_seq; + +IF OBJECT_ID('mprinter', 'U') IS NOT NULL drop table mprinter; +IF OBJECT_ID('mprinter_seq', 'SO') IS NOT NULL drop sequence mprinter_seq; + +IF OBJECT_ID('mprinter_state', 'U') IS NOT NULL drop table mprinter_state; +IF OBJECT_ID('mprinter_state_seq', 'SO') IS NOT NULL drop sequence mprinter_state_seq; + +IF OBJECT_ID('mprofile', 'U') IS NOT NULL drop table mprofile; +IF OBJECT_ID('mprofile_seq', 'SO') IS NOT NULL drop sequence mprofile_seq; + +IF OBJECT_ID('mprotected_construct_bean', 'U') IS NOT NULL drop table mprotected_construct_bean; +IF OBJECT_ID('mprotected_construct_bean_seq', 'SO') IS NOT NULL drop sequence mprotected_construct_bean_seq; + +IF OBJECT_ID('mrole', 'U') IS NOT NULL drop table mrole; +IF OBJECT_ID('mrole_seq', 'SO') IS NOT NULL drop sequence mrole_seq; + +IF OBJECT_ID('mrole_muser', 'U') IS NOT NULL drop table mrole_muser; + +IF OBJECT_ID('msome_other', 'U') IS NOT NULL drop table msome_other; +IF OBJECT_ID('msome_other_seq', 'SO') IS NOT NULL drop sequence msome_other_seq; + +IF OBJECT_ID('muser', 'U') IS NOT NULL drop table muser; +IF OBJECT_ID('muser_seq', 'SO') IS NOT NULL drop sequence muser_seq; + +IF OBJECT_ID('muser_type', 'U') IS NOT NULL drop table muser_type; +IF OBJECT_ID('muser_type_seq', 'SO') IS NOT NULL drop sequence muser_type_seq; + +IF OBJECT_ID('mail_box', 'U') IS NOT NULL drop table mail_box; +IF OBJECT_ID('mail_box_seq', 'SO') IS NOT NULL drop sequence mail_box_seq; + +IF OBJECT_ID('mail_user', 'U') IS NOT NULL drop table mail_user; +IF OBJECT_ID('mail_user_seq', 'SO') IS NOT NULL drop sequence mail_user_seq; + +IF OBJECT_ID('mail_user_inbox', 'U') IS NOT NULL drop table mail_user_inbox; + +IF OBJECT_ID('mail_user_outbox', 'U') IS NOT NULL drop table mail_user_outbox; + +IF OBJECT_ID('main_entity', 'U') IS NOT NULL drop table main_entity; + +IF OBJECT_ID('main_entity_relation', 'U') IS NOT NULL drop table main_entity_relation; + +IF OBJECT_ID('map_super_actual', 'U') IS NOT NULL drop table map_super_actual; +IF OBJECT_ID('map_super_actual_seq', 'SO') IS NOT NULL drop sequence map_super_actual_seq; + +IF OBJECT_ID('c_message', 'U') IS NOT NULL drop table c_message; +IF OBJECT_ID('c_message_seq', 'SO') IS NOT NULL drop sequence c_message_seq; + +IF OBJECT_ID('meter_address_data', 'U') IS NOT NULL drop table meter_address_data; + +IF OBJECT_ID('meter_contract_data', 'U') IS NOT NULL drop table meter_contract_data; + +IF OBJECT_ID('meter_special_needs_client', 'U') IS NOT NULL drop table meter_special_needs_client; + +IF OBJECT_ID('meter_special_needs_contact', 'U') IS NOT NULL drop table meter_special_needs_contact; + +IF OBJECT_ID('meter_version', 'U') IS NOT NULL drop table meter_version; + +IF OBJECT_ID('mnoc_role', 'U') IS NOT NULL drop table mnoc_role; +IF OBJECT_ID('mnoc_role_seq', 'SO') IS NOT NULL drop sequence mnoc_role_seq; + +IF OBJECT_ID('mnoc_user', 'U') IS NOT NULL drop table mnoc_user; +IF OBJECT_ID('mnoc_user_seq', 'SO') IS NOT NULL drop sequence mnoc_user_seq; + +IF OBJECT_ID('mnoc_user_mnoc_role', 'U') IS NOT NULL drop table mnoc_user_mnoc_role; + +IF OBJECT_ID('mny_a', 'U') IS NOT NULL drop table mny_a; +IF OBJECT_ID('mny_a_seq', 'SO') IS NOT NULL drop sequence mny_a_seq; + +IF OBJECT_ID('mny_b', 'U') IS NOT NULL drop table mny_b; +IF OBJECT_ID('mny_b_seq', 'SO') IS NOT NULL drop sequence mny_b_seq; + +IF OBJECT_ID('mny_b_mny_c', 'U') IS NOT NULL drop table mny_b_mny_c; + +IF OBJECT_ID('mny_c', 'U') IS NOT NULL drop table mny_c; +IF OBJECT_ID('mny_c_seq', 'SO') IS NOT NULL drop sequence mny_c_seq; + +IF OBJECT_ID('mny_topic', 'U') IS NOT NULL drop table mny_topic; +IF OBJECT_ID('mny_topic_seq', 'SO') IS NOT NULL drop sequence mny_topic_seq; + +IF OBJECT_ID('subtopics', 'U') IS NOT NULL drop table subtopics; + +IF OBJECT_ID('mp_role', 'U') IS NOT NULL drop table mp_role; +IF OBJECT_ID('mp_role_seq', 'SO') IS NOT NULL drop sequence mp_role_seq; + +IF OBJECT_ID('mp_user', 'U') IS NOT NULL drop table mp_user; +IF OBJECT_ID('mp_user_seq', 'SO') IS NOT NULL drop sequence mp_user_seq; + +IF OBJECT_ID('ms_many_a', 'U') IS NOT NULL drop table ms_many_a; +IF OBJECT_ID('ms_many_a_seq', 'SO') IS NOT NULL drop sequence ms_many_a_seq; + +IF OBJECT_ID('ms_many_a_many_b', 'U') IS NOT NULL drop table ms_many_a_many_b; + +IF OBJECT_ID('ms_many_b', 'U') IS NOT NULL drop table ms_many_b; +IF OBJECT_ID('ms_many_b_seq', 'SO') IS NOT NULL drop sequence ms_many_b_seq; + +IF OBJECT_ID('ms_many_b_many_a', 'U') IS NOT NULL drop table ms_many_b_many_a; + +IF OBJECT_ID('my_lob_size', 'U') IS NOT NULL drop table my_lob_size; +IF OBJECT_ID('my_lob_size_seq', 'SO') IS NOT NULL drop sequence my_lob_size_seq; + +IF OBJECT_ID('my_lob_size_join_many', 'U') IS NOT NULL drop table my_lob_size_join_many; +IF OBJECT_ID('my_lob_size_join_many_seq', 'SO') IS NOT NULL drop sequence my_lob_size_join_many_seq; + +IF OBJECT_ID('noidbean', 'U') IS NOT NULL drop table noidbean; + +IF OBJECT_ID('o_bean_child', 'U') IS NOT NULL drop table o_bean_child; +IF OBJECT_ID('o_bean_child_seq', 'SO') IS NOT NULL drop sequence o_bean_child_seq; + +IF OBJECT_ID('ocached_app', 'U') IS NOT NULL drop table ocached_app; +IF OBJECT_ID('ocached_app_seq', 'SO') IS NOT NULL drop sequence ocached_app_seq; + +IF OBJECT_ID('ocached_app_detail', 'U') IS NOT NULL drop table ocached_app_detail; +IF OBJECT_ID('ocached_app_detail_seq', 'SO') IS NOT NULL drop sequence ocached_app_detail_seq; + +IF OBJECT_ID('o_cached_bean', 'U') IS NOT NULL drop table o_cached_bean; +IF OBJECT_ID('o_cached_bean_seq', 'SO') IS NOT NULL drop sequence o_cached_bean_seq; + +IF OBJECT_ID('o_cached_bean_country', 'U') IS NOT NULL drop table o_cached_bean_country; + +IF OBJECT_ID('o_cached_bean_child', 'U') IS NOT NULL drop table o_cached_bean_child; +IF OBJECT_ID('o_cached_bean_child_seq', 'SO') IS NOT NULL drop sequence o_cached_bean_child_seq; + +IF OBJECT_ID('o_cached_inherit', 'U') IS NOT NULL drop table o_cached_inherit; +IF OBJECT_ID('o_cached_inherit_seq', 'SO') IS NOT NULL drop sequence o_cached_inherit_seq; + +IF OBJECT_ID('o_cached_natkey', 'U') IS NOT NULL drop table o_cached_natkey; +IF OBJECT_ID('o_cached_natkey_seq', 'SO') IS NOT NULL drop sequence o_cached_natkey_seq; + +IF OBJECT_ID('o_cached_natkey3', 'U') IS NOT NULL drop table o_cached_natkey3; +IF OBJECT_ID('o_cached_natkey3_seq', 'SO') IS NOT NULL drop sequence o_cached_natkey3_seq; + +IF OBJECT_ID('ocached_nkey_uid', 'U') IS NOT NULL drop table ocached_nkey_uid; +IF OBJECT_ID('ocached_nkey_uid_seq', 'SO') IS NOT NULL drop sequence ocached_nkey_uid_seq; + +IF OBJECT_ID('ocar', 'U') IS NOT NULL drop table ocar; +IF OBJECT_ID('ocar_seq', 'SO') IS NOT NULL drop sequence ocar_seq; + +IF OBJECT_ID('ocompany', 'U') IS NOT NULL drop table ocompany; +IF OBJECT_ID('ocompany_seq', 'SO') IS NOT NULL drop sequence ocompany_seq; + +IF OBJECT_ID('oengine', 'U') IS NOT NULL drop table oengine; + +IF OBJECT_ID('ogear_box', 'U') IS NOT NULL drop table ogear_box; + +IF OBJECT_ID('omvertex', 'U') IS NOT NULL drop table omvertex; + +IF OBJECT_ID('omvertex_other', 'U') IS NOT NULL drop table omvertex_other; + +IF OBJECT_ID('oroad_show_msg', 'U') IS NOT NULL drop table oroad_show_msg; +IF OBJECT_ID('oroad_show_msg_seq', 'SO') IS NOT NULL drop sequence oroad_show_msg_seq; + +IF OBJECT_ID('om_account_child_dbo', 'U') IS NOT NULL drop table om_account_child_dbo; +IF OBJECT_ID('om_account_child_dbo_seq', 'SO') IS NOT NULL drop sequence om_account_child_dbo_seq; + +IF OBJECT_ID('om_account_dbo', 'U') IS NOT NULL drop table om_account_dbo; +IF OBJECT_ID('om_account_dbo_seq', 'SO') IS NOT NULL drop sequence om_account_dbo_seq; + +IF OBJECT_ID('om_basic_child', 'U') IS NOT NULL drop table om_basic_child; +IF OBJECT_ID('om_basic_child_seq', 'SO') IS NOT NULL drop sequence om_basic_child_seq; + +IF OBJECT_ID('om_basic_parent', 'U') IS NOT NULL drop table om_basic_parent; +IF OBJECT_ID('om_basic_parent_seq', 'SO') IS NOT NULL drop sequence om_basic_parent_seq; + +IF OBJECT_ID('om_ordered_detail', 'U') IS NOT NULL drop table om_ordered_detail; +IF OBJECT_ID('om_ordered_detail_seq', 'SO') IS NOT NULL drop sequence om_ordered_detail_seq; + +IF OBJECT_ID('om_ordered_master', 'U') IS NOT NULL drop table om_ordered_master; +IF OBJECT_ID('om_ordered_master_seq', 'SO') IS NOT NULL drop sequence om_ordered_master_seq; + +IF OBJECT_ID('only_id_entity', 'U') IS NOT NULL drop table only_id_entity; +IF OBJECT_ID('only_id_entity_seq', 'SO') IS NOT NULL drop sequence only_id_entity_seq; + +IF OBJECT_ID('o_order', 'U') IS NOT NULL drop table o_order; +IF OBJECT_ID('o_order_seq', 'SO') IS NOT NULL drop sequence o_order_seq; + +IF OBJECT_ID('o_order_detail', 'U') IS NOT NULL drop table o_order_detail; +IF OBJECT_ID('o_order_detail_seq', 'SO') IS NOT NULL drop sequence o_order_detail_seq; + +IF OBJECT_ID('s_orders', 'U') IS NOT NULL drop table s_orders; + +IF OBJECT_ID('s_order_items', 'U') IS NOT NULL drop table s_order_items; + +IF OBJECT_ID('or_order_ship', 'U') IS NOT NULL drop table or_order_ship; +IF OBJECT_ID('or_order_ship_seq', 'SO') IS NOT NULL drop sequence or_order_ship_seq; + +IF OBJECT_ID('organisation', 'U') IS NOT NULL drop table organisation; +IF OBJECT_ID('organisation_seq', 'SO') IS NOT NULL drop sequence organisation_seq; + +IF OBJECT_ID('organization_node', 'U') IS NOT NULL drop table organization_node; +IF OBJECT_ID('organization_node_seq', 'SO') IS NOT NULL drop sequence organization_node_seq; + +IF OBJECT_ID('organization_tree_node', 'U') IS NOT NULL drop table organization_tree_node; +IF OBJECT_ID('organization_tree_node_seq', 'SO') IS NOT NULL drop sequence organization_tree_node_seq; + +IF OBJECT_ID('orp_detail', 'U') IS NOT NULL drop table orp_detail; + +IF OBJECT_ID('orp_detail2', 'U') IS NOT NULL drop table orp_detail2; + +IF OBJECT_ID('orp_master', 'U') IS NOT NULL drop table orp_master; + +IF OBJECT_ID('orp_master2', 'U') IS NOT NULL drop table orp_master2; + +IF OBJECT_ID('oto_aone', 'U') IS NOT NULL drop table oto_aone; + +IF OBJECT_ID('oto_atwo', 'U') IS NOT NULL drop table oto_atwo; + +IF OBJECT_ID('oto_bchild', 'U') IS NOT NULL drop table oto_bchild; +IF OBJECT_ID('oto_bchild_seq', 'SO') IS NOT NULL drop sequence oto_bchild_seq; + +IF OBJECT_ID('oto_bmaster', 'U') IS NOT NULL drop table oto_bmaster; +IF OBJECT_ID('oto_bmaster_seq', 'SO') IS NOT NULL drop sequence oto_bmaster_seq; + +IF OBJECT_ID('oto_child', 'U') IS NOT NULL drop table oto_child; +IF OBJECT_ID('oto_child_seq', 'SO') IS NOT NULL drop sequence oto_child_seq; + +IF OBJECT_ID('oto_cust', 'U') IS NOT NULL drop table oto_cust; +IF OBJECT_ID('oto_cust_seq', 'SO') IS NOT NULL drop sequence oto_cust_seq; + +IF OBJECT_ID('oto_cust_address', 'U') IS NOT NULL drop table oto_cust_address; +IF OBJECT_ID('oto_cust_address_seq', 'SO') IS NOT NULL drop sequence oto_cust_address_seq; + +IF OBJECT_ID('oto_level_a', 'U') IS NOT NULL drop table oto_level_a; +IF OBJECT_ID('oto_level_a_seq', 'SO') IS NOT NULL drop sequence oto_level_a_seq; + +IF OBJECT_ID('oto_level_b', 'U') IS NOT NULL drop table oto_level_b; +IF OBJECT_ID('oto_level_b_seq', 'SO') IS NOT NULL drop sequence oto_level_b_seq; + +IF OBJECT_ID('oto_level_c', 'U') IS NOT NULL drop table oto_level_c; +IF OBJECT_ID('oto_level_c_seq', 'SO') IS NOT NULL drop sequence oto_level_c_seq; + +IF OBJECT_ID('oto_master', 'U') IS NOT NULL drop table oto_master; +IF OBJECT_ID('oto_master_seq', 'SO') IS NOT NULL drop sequence oto_master_seq; + +IF OBJECT_ID('oto_prime', 'U') IS NOT NULL drop table oto_prime; +IF OBJECT_ID('oto_prime_seq', 'SO') IS NOT NULL drop sequence oto_prime_seq; + +IF OBJECT_ID('oto_prime_extra', 'U') IS NOT NULL drop table oto_prime_extra; +IF OBJECT_ID('oto_prime_extra_seq', 'SO') IS NOT NULL drop sequence oto_prime_extra_seq; + +IF OBJECT_ID('oto_sd_child', 'U') IS NOT NULL drop table oto_sd_child; +IF OBJECT_ID('oto_sd_child_seq', 'SO') IS NOT NULL drop sequence oto_sd_child_seq; + +IF OBJECT_ID('oto_sd_master', 'U') IS NOT NULL drop table oto_sd_master; +IF OBJECT_ID('oto_sd_master_seq', 'SO') IS NOT NULL drop sequence oto_sd_master_seq; + +IF OBJECT_ID('oto_th_many', 'U') IS NOT NULL drop table oto_th_many; +IF OBJECT_ID('oto_th_many_seq', 'SO') IS NOT NULL drop sequence oto_th_many_seq; + +IF OBJECT_ID('oto_th_one', 'U') IS NOT NULL drop table oto_th_one; +IF OBJECT_ID('oto_th_one_seq', 'SO') IS NOT NULL drop sequence oto_th_one_seq; + +IF OBJECT_ID('oto_th_top', 'U') IS NOT NULL drop table oto_th_top; +IF OBJECT_ID('oto_th_top_seq', 'SO') IS NOT NULL drop sequence oto_th_top_seq; + +IF OBJECT_ID('oto_ubprime', 'U') IS NOT NULL drop table oto_ubprime; + +IF OBJECT_ID('oto_ubprime_extra', 'U') IS NOT NULL drop table oto_ubprime_extra; + +IF OBJECT_ID('oto_uprime', 'U') IS NOT NULL drop table oto_uprime; + +IF OBJECT_ID('oto_uprime_extra', 'U') IS NOT NULL drop table oto_uprime_extra; + +IF OBJECT_ID('oto_user_model', 'U') IS NOT NULL drop table oto_user_model; +IF OBJECT_ID('oto_user_model_seq', 'SO') IS NOT NULL drop sequence oto_user_model_seq; + +IF OBJECT_ID('oto_user_model_optional', 'U') IS NOT NULL drop table oto_user_model_optional; +IF OBJECT_ID('oto_user_model_optional_seq', 'SO') IS NOT NULL drop sequence oto_user_model_optional_seq; + +IF OBJECT_ID('pfile', 'U') IS NOT NULL drop table pfile; +IF OBJECT_ID('pfile_seq', 'SO') IS NOT NULL drop sequence pfile_seq; + +IF OBJECT_ID('pfile_content', 'U') IS NOT NULL drop table pfile_content; +IF OBJECT_ID('pfile_content_seq', 'SO') IS NOT NULL drop sequence pfile_content_seq; + +IF OBJECT_ID('paggview', 'U') IS NOT NULL drop table paggview; + +IF OBJECT_ID('pallet_location', 'U') IS NOT NULL drop table pallet_location; +IF OBJECT_ID('pallet_location_seq', 'SO') IS NOT NULL drop sequence pallet_location_seq; + +IF OBJECT_ID('parcel', 'U') IS NOT NULL drop table parcel; +IF OBJECT_ID('parcel_seq', 'SO') IS NOT NULL drop sequence parcel_seq; + +IF OBJECT_ID('parcel_location', 'U') IS NOT NULL drop table parcel_location; +IF OBJECT_ID('parcel_location_seq', 'SO') IS NOT NULL drop sequence parcel_location_seq; + +IF OBJECT_ID('rawinherit_parent', 'U') IS NOT NULL drop table rawinherit_parent; +IF OBJECT_ID('rawinherit_parent_seq', 'SO') IS NOT NULL drop sequence rawinherit_parent_seq; + +IF OBJECT_ID('rawinherit_parent_rawinherit_data', 'U') IS NOT NULL drop table rawinherit_parent_rawinherit_data; + +IF OBJECT_ID('e_save_test_c', 'U') IS NOT NULL drop table e_save_test_c; +IF OBJECT_ID('e_save_test_c_seq', 'SO') IS NOT NULL drop sequence e_save_test_c_seq; + +IF OBJECT_ID('parent_person', 'U') IS NOT NULL drop table parent_person; +IF OBJECT_ID('parent_person_seq', 'SO') IS NOT NULL drop sequence parent_person_seq; + +IF OBJECT_ID('c_participation', 'U') IS NOT NULL drop table c_participation; +IF OBJECT_ID('c_participation_seq', 'SO') IS NOT NULL drop sequence c_participation_seq; + +IF OBJECT_ID('password_store_model', 'U') IS NOT NULL drop table password_store_model; +IF OBJECT_ID('password_store_model_seq', 'SO') IS NOT NULL drop sequence password_store_model_seq; + +IF OBJECT_ID('pcf_calendar', 'U') IS NOT NULL drop table pcf_calendar; +IF OBJECT_ID('pcf_calendar_seq', 'SO') IS NOT NULL drop sequence pcf_calendar_seq; + +IF OBJECT_ID('pcf_city', 'U') IS NOT NULL drop table pcf_city; +IF OBJECT_ID('pcf_city_seq', 'SO') IS NOT NULL drop sequence pcf_city_seq; + +IF OBJECT_ID('pcf_country', 'U') IS NOT NULL drop table pcf_country; +IF OBJECT_ID('pcf_country_seq', 'SO') IS NOT NULL drop sequence pcf_country_seq; + +IF OBJECT_ID('pcf_event', 'U') IS NOT NULL drop table pcf_event; +IF OBJECT_ID('pcf_event_seq', 'SO') IS NOT NULL drop sequence pcf_event_seq; + +IF OBJECT_ID('pcf_person', 'U') IS NOT NULL drop table pcf_person; +IF OBJECT_ID('pcf_person_seq', 'SO') IS NOT NULL drop sequence pcf_person_seq; + +IF OBJECT_ID('mt_permission', 'U') IS NOT NULL drop table mt_permission; + +IF OBJECT_ID('persistent_file', 'U') IS NOT NULL drop table persistent_file; +IF OBJECT_ID('persistent_file_seq', 'SO') IS NOT NULL drop sequence persistent_file_seq; + +IF OBJECT_ID('persistent_file_content', 'U') IS NOT NULL drop table persistent_file_content; +IF OBJECT_ID('persistent_file_content_seq', 'SO') IS NOT NULL drop sequence persistent_file_content_seq; + +IF OBJECT_ID('person', 'U') IS NOT NULL drop table person; +IF OBJECT_ID('person_seq', 'SO') IS NOT NULL drop sequence person_seq; + +IF OBJECT_ID('persons', 'U') IS NOT NULL drop table persons; +IF OBJECT_ID('PERSONS_seq', 'SO') IS NOT NULL drop sequence PERSONS_seq; + +IF OBJECT_ID('person_cache_email', 'U') IS NOT NULL drop table person_cache_email; + +IF OBJECT_ID('person_cache_info', 'U') IS NOT NULL drop table person_cache_info; + +IF OBJECT_ID('phones', 'U') IS NOT NULL drop table phones; +IF OBJECT_ID('PHONES_seq', 'SO') IS NOT NULL drop sequence PHONES_seq; + +IF OBJECT_ID('e_position', 'U') IS NOT NULL drop table e_position; +IF OBJECT_ID('e_position_seq', 'SO') IS NOT NULL drop sequence e_position_seq; + +IF OBJECT_ID('primary_revision', 'U') IS NOT NULL drop table primary_revision; + +IF OBJECT_ID('o_product', 'U') IS NOT NULL drop table o_product; +IF OBJECT_ID('o_product_seq', 'SO') IS NOT NULL drop sequence o_product_seq; + +IF OBJECT_ID('pp', 'U') IS NOT NULL drop table pp; + +IF OBJECT_ID('pp_to_ww', 'U') IS NOT NULL drop table pp_to_ww; + +IF OBJECT_ID('question', 'U') IS NOT NULL drop table question; +IF OBJECT_ID('question_seq', 'SO') IS NOT NULL drop sequence question_seq; + +IF OBJECT_ID('rcustomer', 'U') IS NOT NULL drop table rcustomer; + +IF OBJECT_ID('r_orders', 'U') IS NOT NULL drop table r_orders; + +IF OBJECT_ID('referencing_bean', 'U') IS NOT NULL drop table referencing_bean; + +IF OBJECT_ID('region', 'U') IS NOT NULL drop table region; + +IF OBJECT_ID('rel_detail', 'U') IS NOT NULL drop table rel_detail; +IF OBJECT_ID('rel_detail_seq', 'SO') IS NOT NULL drop sequence rel_detail_seq; + +IF OBJECT_ID('rel_master', 'U') IS NOT NULL drop table rel_master; +IF OBJECT_ID('rel_master_seq', 'SO') IS NOT NULL drop sequence rel_master_seq; + +IF OBJECT_ID('resourcefile', 'U') IS NOT NULL drop table resourcefile; + +IF OBJECT_ID('mt_role', 'U') IS NOT NULL drop table mt_role; + +IF OBJECT_ID('mt_role_permission', 'U') IS NOT NULL drop table mt_role_permission; + +IF OBJECT_ID('em_role', 'U') IS NOT NULL drop table em_role; +IF OBJECT_ID('em_role_seq', 'SO') IS NOT NULL drop sequence em_role_seq; + +IF OBJECT_ID('root_bean', 'U') IS NOT NULL drop table root_bean; + +IF OBJECT_ID('f_second', 'U') IS NOT NULL drop table f_second; +IF OBJECT_ID('f_second_seq', 'SO') IS NOT NULL drop sequence f_second_seq; + +IF OBJECT_ID('section', 'U') IS NOT NULL drop table section; +IF OBJECT_ID('section_seq', 'SO') IS NOT NULL drop sequence section_seq; + +IF OBJECT_ID('self_parent', 'U') IS NOT NULL drop table self_parent; +IF OBJECT_ID('self_parent_seq', 'SO') IS NOT NULL drop sequence self_parent_seq; + +IF OBJECT_ID('self_ref_customer', 'U') IS NOT NULL drop table self_ref_customer; +IF OBJECT_ID('self_ref_customer_seq', 'SO') IS NOT NULL drop sequence self_ref_customer_seq; + +IF OBJECT_ID('self_ref_example', 'U') IS NOT NULL drop table self_ref_example; +IF OBJECT_ID('self_ref_example_seq', 'SO') IS NOT NULL drop sequence self_ref_example_seq; + +IF OBJECT_ID('e_save_test_a', 'U') IS NOT NULL drop table e_save_test_a; +IF OBJECT_ID('e_save_test_a_seq', 'SO') IS NOT NULL drop sequence e_save_test_a_seq; + +IF OBJECT_ID('e_save_test_b', 'U') IS NOT NULL drop table e_save_test_b; +IF OBJECT_ID('e_save_test_b_seq', 'SO') IS NOT NULL drop sequence e_save_test_b_seq; + +IF OBJECT_ID('site', 'U') IS NOT NULL drop table site; + +IF OBJECT_ID('site_address', 'U') IS NOT NULL drop table site_address; + +IF OBJECT_ID('some_enum_bean', 'U') IS NOT NULL drop table some_enum_bean; +IF OBJECT_ID('some_enum_bean_seq', 'SO') IS NOT NULL drop sequence some_enum_bean_seq; + +IF OBJECT_ID('some_file_bean', 'U') IS NOT NULL drop table some_file_bean; +IF OBJECT_ID('some_file_bean_seq', 'SO') IS NOT NULL drop sequence some_file_bean_seq; + +IF OBJECT_ID('some_new_types_bean', 'U') IS NOT NULL drop table some_new_types_bean; +IF OBJECT_ID('some_new_types_bean_seq', 'SO') IS NOT NULL drop sequence some_new_types_bean_seq; + +IF OBJECT_ID('some_period_bean', 'U') IS NOT NULL drop table some_period_bean; +IF OBJECT_ID('some_period_bean_seq', 'SO') IS NOT NULL drop sequence some_period_bean_seq; + +IF OBJECT_ID('source_base', 'U') IS NOT NULL drop table source_base; + +IF OBJECT_ID('stockforecast', 'U') IS NOT NULL drop table stockforecast; +IF OBJECT_ID('stockforecast_seq', 'SO') IS NOT NULL drop sequence stockforecast_seq; + +IF OBJECT_ID('sub_section', 'U') IS NOT NULL drop table sub_section; +IF OBJECT_ID('sub_section_seq', 'SO') IS NOT NULL drop sequence sub_section_seq; + +IF OBJECT_ID('sub_type', 'U') IS NOT NULL drop table sub_type; +IF OBJECT_ID('sub_type_seq', 'SO') IS NOT NULL drop sequence sub_type_seq; + +IF OBJECT_ID('survey', 'U') IS NOT NULL drop table survey; +IF OBJECT_ID('survey_seq', 'SO') IS NOT NULL drop sequence survey_seq; + +IF OBJECT_ID('tbytes_only', 'U') IS NOT NULL drop table tbytes_only; +IF OBJECT_ID('tbytes_only_seq', 'SO') IS NOT NULL drop sequence tbytes_only_seq; + +IF OBJECT_ID('tcar', 'U') IS NOT NULL drop table tcar; + +IF OBJECT_ID('tevent', 'U') IS NOT NULL drop table tevent; +IF OBJECT_ID('tevent_seq', 'SO') IS NOT NULL drop sequence tevent_seq; + +IF OBJECT_ID('tevent_many', 'U') IS NOT NULL drop table tevent_many; +IF OBJECT_ID('tevent_many_seq', 'SO') IS NOT NULL drop sequence tevent_many_seq; + +IF OBJECT_ID('tevent_one', 'U') IS NOT NULL drop table tevent_one; +IF OBJECT_ID('tevent_one_seq', 'SO') IS NOT NULL drop sequence tevent_one_seq; + +IF OBJECT_ID('tint_root', 'U') IS NOT NULL drop table tint_root; +IF OBJECT_ID('tint_root_seq', 'SO') IS NOT NULL drop sequence tint_root_seq; + +IF OBJECT_ID('tjoda_entity', 'U') IS NOT NULL drop table tjoda_entity; +IF OBJECT_ID('tjoda_entity_seq', 'SO') IS NOT NULL drop sequence tjoda_entity_seq; + +IF OBJECT_ID('t_mapsuper1', 'U') IS NOT NULL drop table t_mapsuper1; +IF OBJECT_ID('t_mapsuper1_seq', 'SO') IS NOT NULL drop sequence t_mapsuper1_seq; + +IF OBJECT_ID('t_oneb', 'U') IS NOT NULL drop table t_oneb; +IF OBJECT_ID('t_oneb_seq', 'SO') IS NOT NULL drop sequence t_oneb_seq; + +IF OBJECT_ID('t_detail_with_other_namexxxyy', 'U') IS NOT NULL drop table t_detail_with_other_namexxxyy; +IF OBJECT_ID('t_detail_with_other_namexxxyy_seq', 'SO') IS NOT NULL drop sequence t_detail_with_other_namexxxyy_seq; + +IF OBJECT_ID('t_atable_thatisrelatively', 'U') IS NOT NULL drop table t_atable_thatisrelatively; +IF OBJECT_ID('t_atable_thatisrelatively_seq', 'SO') IS NOT NULL drop sequence t_atable_thatisrelatively_seq; + +IF OBJECT_ID('ttruck_holder', 'U') IS NOT NULL drop table ttruck_holder; +IF OBJECT_ID('ttruck_holder_seq', 'SO') IS NOT NULL drop sequence ttruck_holder_seq; + +IF OBJECT_ID('ttruck_holder_item', 'U') IS NOT NULL drop table ttruck_holder_item; +IF OBJECT_ID('ttruck_holder_item_seq', 'SO') IS NOT NULL drop sequence ttruck_holder_item_seq; + +IF OBJECT_ID('tuuid_entity', 'U') IS NOT NULL drop table tuuid_entity; + +IF OBJECT_ID('twheel', 'U') IS NOT NULL drop table twheel; +IF OBJECT_ID('twheel_seq', 'SO') IS NOT NULL drop sequence twheel_seq; + +IF OBJECT_ID('twith_pre_insert', 'U') IS NOT NULL drop table twith_pre_insert; +IF OBJECT_ID('twith_pre_insert_seq', 'SO') IS NOT NULL drop sequence twith_pre_insert_seq; + +IF OBJECT_ID('target_base', 'U') IS NOT NULL drop table target_base; + +IF OBJECT_ID('mt_tenant', 'U') IS NOT NULL drop table mt_tenant; + +IF OBJECT_ID('test_annotation_base_entity', 'U') IS NOT NULL drop table test_annotation_base_entity; + +IF OBJECT_ID('tire', 'U') IS NOT NULL drop table tire; +IF OBJECT_ID('tire_seq', 'SO') IS NOT NULL drop sequence tire_seq; + +IF OBJECT_ID('sa_tire', 'U') IS NOT NULL drop table sa_tire; +IF OBJECT_ID('sa_tire_seq', 'SO') IS NOT NULL drop sequence sa_tire_seq; + +IF OBJECT_ID('tree_entity', 'U') IS NOT NULL drop table tree_entity; +IF OBJECT_ID('tree_entity_seq', 'SO') IS NOT NULL drop sequence tree_entity_seq; + +IF OBJECT_ID('trip', 'U') IS NOT NULL drop table trip; +IF OBJECT_ID('trip_seq', 'SO') IS NOT NULL drop sequence trip_seq; + +IF OBJECT_ID('truck_ref', 'U') IS NOT NULL drop table truck_ref; +IF OBJECT_ID('truck_ref_seq', 'SO') IS NOT NULL drop sequence truck_ref_seq; + +IF OBJECT_ID('tune', 'U') IS NOT NULL drop table tune; +IF OBJECT_ID('tune_seq', 'SO') IS NOT NULL drop sequence tune_seq; + +IF OBJECT_ID('[type]', 'U') IS NOT NULL drop table [type]; + +IF OBJECT_ID('tz_bean', 'U') IS NOT NULL drop table tz_bean; +IF OBJECT_ID('tz_bean_seq', 'SO') IS NOT NULL drop sequence tz_bean_seq; + +IF OBJECT_ID('usib_child', 'U') IS NOT NULL drop table usib_child; + +IF OBJECT_ID('usib_child_sibling', 'U') IS NOT NULL drop table usib_child_sibling; +IF OBJECT_ID('usib_child_sibling_seq', 'SO') IS NOT NULL drop sequence usib_child_sibling_seq; + +IF OBJECT_ID('usib_parent', 'U') IS NOT NULL drop table usib_parent; +IF OBJECT_ID('usib_parent_seq', 'SO') IS NOT NULL drop sequence usib_parent_seq; + +IF OBJECT_ID('ut_detail', 'U') IS NOT NULL drop table ut_detail; +IF OBJECT_ID('ut_detail_seq', 'SO') IS NOT NULL drop sequence ut_detail_seq; + +IF OBJECT_ID('ut_master', 'U') IS NOT NULL drop table ut_master; +IF OBJECT_ID('ut_master_seq', 'SO') IS NOT NULL drop sequence ut_master_seq; + +IF OBJECT_ID('uuone', 'U') IS NOT NULL drop table uuone; + +IF OBJECT_ID('uutwo', 'U') IS NOT NULL drop table uutwo; + +IF OBJECT_ID('oto_user', 'U') IS NOT NULL drop table oto_user; +IF OBJECT_ID('oto_user_seq', 'SO') IS NOT NULL drop sequence oto_user_seq; + +IF OBJECT_ID('c_user', 'U') IS NOT NULL alter table c_user set (system_versioning = off); +IF OBJECT_ID('c_user_history', 'U') IS NOT NULL drop table c_user_history; +IF OBJECT_ID('c_user', 'U') IS NOT NULL drop table c_user; +IF OBJECT_ID('c_user_seq', 'SO') IS NOT NULL drop sequence c_user_seq; + +IF OBJECT_ID('tx_user', 'U') IS NOT NULL drop table tx_user; +IF OBJECT_ID('tx_user_seq', 'SO') IS NOT NULL drop sequence tx_user_seq; + +IF OBJECT_ID('g_user', 'U') IS NOT NULL drop table g_user; +IF OBJECT_ID('g_user_seq', 'SO') IS NOT NULL drop sequence g_user_seq; + +IF OBJECT_ID('em_user', 'U') IS NOT NULL drop table em_user; +IF OBJECT_ID('em_user_seq', 'SO') IS NOT NULL drop sequence em_user_seq; + +IF OBJECT_ID('user_interest_live', 'U') IS NOT NULL drop table user_interest_live; + +IF OBJECT_ID('em_user_role', 'U') IS NOT NULL drop table em_user_role; + +IF OBJECT_ID('vehicle', 'U') IS NOT NULL drop table vehicle; +IF OBJECT_ID('vehicle_seq', 'SO') IS NOT NULL drop sequence vehicle_seq; + +IF OBJECT_ID('vehicle_driver', 'U') IS NOT NULL drop table vehicle_driver; +IF OBJECT_ID('vehicle_driver_seq', 'SO') IS NOT NULL drop sequence vehicle_driver_seq; + +IF OBJECT_ID('vehicle_lease', 'U') IS NOT NULL drop table vehicle_lease; +IF OBJECT_ID('vehicle_lease_seq', 'SO') IS NOT NULL drop sequence vehicle_lease_seq; + +IF OBJECT_ID('warehouses', 'U') IS NOT NULL drop table warehouses; +IF OBJECT_ID('warehouses_seq', 'SO') IS NOT NULL drop sequence warehouses_seq; + +IF OBJECT_ID('warehousesshippingzones', 'U') IS NOT NULL drop table warehousesshippingzones; + +IF OBJECT_ID('wheel', 'U') IS NOT NULL drop table wheel; +IF OBJECT_ID('wheel_seq', 'SO') IS NOT NULL drop sequence wheel_seq; + +IF OBJECT_ID('sa_wheel', 'U') IS NOT NULL drop table sa_wheel; +IF OBJECT_ID('sa_wheel_seq', 'SO') IS NOT NULL drop sequence sa_wheel_seq; + +IF OBJECT_ID('sp_car_wheel', 'U') IS NOT NULL drop table sp_car_wheel; +IF OBJECT_ID('sp_car_wheel_seq', 'SO') IS NOT NULL drop sequence sp_car_wheel_seq; + +IF OBJECT_ID('g_who_props_otm', 'U') IS NOT NULL drop table g_who_props_otm; +IF OBJECT_ID('g_who_props_otm_seq', 'SO') IS NOT NULL drop sequence g_who_props_otm_seq; + +IF OBJECT_ID('with_zero', 'U') IS NOT NULL drop table with_zero; +IF OBJECT_ID('with_zero_seq', 'SO') IS NOT NULL drop sequence with_zero_seq; + +IF OBJECT_ID('parent', 'U') IS NOT NULL drop table parent; +IF OBJECT_ID('parent_seq', 'SO') IS NOT NULL drop sequence parent_seq; + +IF OBJECT_ID('wview', 'U') IS NOT NULL drop table wview; + +IF OBJECT_ID('zones', 'U') IS NOT NULL drop table zones; +IF OBJECT_ID('zones_seq', 'SO') IS NOT NULL drop sequence zones_seq; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('contact','U') AND name = 'ix_contact_last_name_first_name') drop index ix_contact_last_name_first_name ON contact; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('e_basic','U') AND name = 'ix_e_basic_name') drop index ix_e_basic_name ON e_basic; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('efile2_no_fk','U') AND name = 'ix_efile2_no_fk_owner_id') drop index ix_efile2_no_fk_owner_id ON efile2_no_fk; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ecsm_values','U') AND name = 'ix_ecsm_values_host_id') drop index ix_ecsm_values_host_id ON ecsm_values; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('organization_node','U') AND name = 'ix_organization_node_kind') drop index ix_organization_node_kind ON organization_node;