From 815d8466954deaf335fbaaf72a69ad949e2e1110 Mon Sep 17 00:00:00 2001 From: Robin Bygrave Date: Thu, 6 Aug 2015 22:25:35 +1200 Subject: [PATCH] Add ddl-review with sql/ddl for the various databases, can review/diff over time --- src/test/ddl-review/h2-create.sql | 2246 +++++++++++++++++++++++++ src/test/ddl-review/h2-drop.sql | 936 +++++++++++ src/test/ddl-review/ms-create.sql | 2074 ++++++++++++++++++++++++ src/test/ddl-review/ms-drop.sql | 783 +++++++++ src/test/ddl-review/mysql-create.sql | 2074 ++++++++++++++++++++++++ src/test/ddl-review/mysql-drop.sql | 764 +++++++++ src/test/ddl-review/ora-create.sql | 2248 ++++++++++++++++++++++++++ src/test/ddl-review/ora-drop.sql | 938 +++++++++++ src/test/ddl-review/pg-create.sql | 2086 ++++++++++++++++++++++++ src/test/ddl-review/pg-drop.sql | 776 +++++++++ 10 files changed, 14925 insertions(+) create mode 100644 src/test/ddl-review/h2-create.sql create mode 100644 src/test/ddl-review/h2-drop.sql create mode 100644 src/test/ddl-review/ms-create.sql create mode 100644 src/test/ddl-review/ms-drop.sql create mode 100644 src/test/ddl-review/mysql-create.sql create mode 100644 src/test/ddl-review/mysql-drop.sql create mode 100644 src/test/ddl-review/ora-create.sql create mode 100644 src/test/ddl-review/ora-drop.sql create mode 100644 src/test/ddl-review/pg-create.sql create mode 100644 src/test/ddl-review/pg-drop.sql diff --git a/src/test/ddl-review/h2-create.sql b/src/test/ddl-review/h2-create.sql new file mode 100644 index 000000000..660744c0c --- /dev/null +++ b/src/test/ddl-review/h2-create.sql @@ -0,0 +1,2246 @@ +create table asimple_bean ( + id bigint not null, + name varchar(255), + constraint pk_asimple_bean primary key (id) +); +create sequence asimple_bean_seq; + +create table bar ( + bar_type varchar(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; + +create table oto_account ( + id bigint 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 sequence oto_account_seq; + +create table o_address ( + id smallint 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 sequence o_address_seq; + +create table address ( + oid bigint not null, + street varchar(255), + version integer not null, + constraint pk_address primary key (oid) +); +create sequence address_seq; + +create table animals ( + species varchar(31) not null, + id bigint not null, + shelter_id bigint, + version bigint not null, + name varchar(255), + registration_number varchar(255), + date_of_birth date, + constraint pk_animals primary key (id) +); +create sequence animals_seq; + +create table animal_shelter ( + id bigint not null, + name varchar(255), + version bigint not null, + constraint pk_animal_shelter primary key (id) +); +create sequence animal_shelter_seq; + +create table article ( + id integer 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 sequence article_seq; + +create table attribute ( + option_type integer(31) not null, + id integer 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 sequence attribute_seq; + +create table attribute_holder ( + id integer not null, + cretime timestamp not null, + updtime timestamp not null, + version bigint not null, + constraint pk_attribute_holder primary key (id) +); +create sequence attribute_holder_seq; + +create table audit_log ( + id bigint not null, + description varchar(255), + modified_description varchar(255), + constraint pk_audit_log primary key (id) +); +create sequence audit_log_seq; + +create table bbookmark ( + id integer not null, + bookmark_reference varchar(255), + user_id integer, + constraint pk_bbookmark primary key (id) +); +create sequence bbookmark_seq; + +create table bbookmark_user ( + id integer not null, + name varchar(255), + password varchar(255), + email_address varchar(255), + country varchar(255), + constraint pk_bbookmark_user primary key (id) +); +create sequence bbookmark_user_seq; + +create table bsimple_with_gen ( + id integer not null, + name varchar(255), + constraint pk_bsimple_with_gen primary key (id) +); +create sequence bsimple_with_gen_seq; + +create table bwith_qident ( + id integer not null, + "Name" varchar(255), + last_updated timestamp not null, + constraint uq_bwith_qident_name unique ("Name"), + constraint pk_bwith_qident primary key (id) +); +create sequence bwith_qident_seq; + +create table basic_joda_entity ( + id bigint not null, + name varchar(255), + created timestamp not null, + updated timestamp not null, + version timestamp not null, + constraint pk_basic_joda_entity primary key (id) +); +create sequence basic_joda_entity_seq; + +create table bean_with_time_zone ( + id bigint not null, + name varchar(255), + timezone varchar(20), + constraint pk_bean_with_time_zone primary key (id) +); +create sequence bean_with_time_zone_seq; + +create table drel_booking ( + id bigint not null, + agent_invoice bigint, + client_invoice bigint, + version integer not null, + 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; + +create table ckey_assoc ( + id integer not null, + assoc_one varchar(255), + constraint pk_ckey_assoc primary key (id) +); +create sequence ckey_assoc_seq; + +create table ckey_detail ( + id integer not null, + something varchar(255), + one_key integer, + two_key varchar(255), + constraint pk_ckey_detail primary key (id) +); +create sequence ckey_detail_seq; + +create table ckey_parent ( + one_key integer not null, + two_key varchar(255) not null, + name varchar(255), + assoc_id integer, + version integer not null, + constraint pk_ckey_parent primary key (one_key,two_key) +); + +create table calculation_result ( + id integer not null, + charge double, + product_configuration_id integer, + group_configuration_id integer, + constraint pk_calculation_result primary key (id) +); +create sequence calculation_result_seq; + +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 sa_car ( + id bigint not null, + version integer not null, + constraint pk_sa_car primary key (id) +); +create sequence sa_car_seq; + +create table sp_car_car ( + id bigint not null, + version integer not null, + constraint pk_sp_car_car primary key (id) +); +create sequence sp_car_car_seq; + +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 car_accessory ( + id integer not null, + name varchar(255), + car_id integer, + cretime timestamp not null, + updtime timestamp not null, + version bigint not null, + constraint pk_car_accessory primary key (id) +); +create sequence car_accessory_seq; + +create table configuration ( + type varchar(31) not null, + id integer not null, + name varchar(255), + configurations_id integer, + group_name varchar(255), + product_name varchar(255), + constraint pk_configuration primary key (id) +); +create sequence configuration_seq; + +create table configurations ( + id integer not null, + name varchar(255), + constraint pk_configurations primary key (id) +); +create sequence configurations_seq; + +create table contact ( + id integer not null, + first_name varchar(255), + last_name varchar(255), + phone varchar(255), + mobile varchar(255), + email varchar(255), + customer_id integer not null, + group_id integer, + cretime timestamp not null, + updtime timestamp not null, + constraint pk_contact primary key (id) +); +create sequence contact_seq; + +create table contact_group ( + id integer 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 sequence contact_group_seq; + +create table contact_note ( + id integer 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 sequence contact_note_seq; + +create table c_conversation ( + id bigint not null, + title varchar(255), + isopen boolean, + 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 sequence c_conversation_seq; + +create table o_country ( + code varchar(2) not null, + name varchar(60), + constraint pk_o_country primary key (code) +); + +create table o_customer ( + id integer not null, + status varchar(1), + name varchar(40) not null, + smallnote varchar(100), + anniversary date, + billing_address_id smallint, + shipping_address_id smallint, + 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) +); +create sequence o_customer_seq; + +create table dexh_entity ( + oid bigint not null, + exhange_rate decimal(38), + exhange_cmoney_amount decimal(38), + exhange_cmoney_currency varchar(3), + last_updated timestamp not null, + constraint pk_dexh_entity primary key (oid) +); +create sequence dexh_entity_seq; + +create table dperson ( + id bigint not null, + first_name varchar(255), + last_name varchar(255), + salary decimal(38), + a_amt decimal(38), + a_curr varchar(3), + i_start timestamp, + i_end timestamp, + constraint pk_dperson primary key (id) +); +create sequence dperson_seq; + +create table rawinherit_data ( + id bigint not null, + val integer, + constraint pk_rawinherit_data primary key (id) +); +create sequence rawinherit_data_seq; + +create table e_basic ( + id integer not null, + status varchar(1), + name varchar(255), + 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 sequence e_basic_seq; + +create table ebasic_clob ( + id bigint not null, + name varchar(255), + title varchar(255), + description clob, + last_update timestamp not null, + constraint pk_ebasic_clob primary key (id) +); +create sequence ebasic_clob_seq; + +create table ebasic_clob_fetch_eager ( + id bigint 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 sequence ebasic_clob_fetch_eager_seq; + +create table ebasic_clob_no_ver ( + id bigint not null, + name varchar(255), + description clob, + constraint pk_ebasic_clob_no_ver primary key (id) +); +create sequence ebasic_clob_no_ver_seq; + +create table e_basicenc ( + id integer not null, + name varchar(255), + description varbinary(80), + dob varbinary(20), + last_update timestamp, + constraint pk_e_basicenc primary key (id) +); +create sequence e_basicenc_seq; + +create table e_basicenc_bin ( + id integer 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 sequence e_basicenc_bin_seq; + +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 ebasic_json_map ( + id bigint not null, + name varchar(255), + content clob, + version bigint not null, + constraint pk_ebasic_json_map primary key (id) +); +create sequence ebasic_json_map_seq; + +create table ebasic_json_map_blob ( + id bigint not null, + name varchar(255), + content blob, + version bigint not null, + constraint pk_ebasic_json_map_blob primary key (id) +); +create sequence ebasic_json_map_blob_seq; + +create table ebasic_json_map_clob ( + id bigint not null, + name varchar(255), + content clob, + version bigint not null, + constraint pk_ebasic_json_map_clob primary key (id) +); +create sequence ebasic_json_map_clob_seq; + +create table ebasic_json_map_json_b ( + id bigint not null, + name varchar(255), + content clob, + version bigint not null, + constraint pk_ebasic_json_map_json_b primary key (id) +); +create sequence ebasic_json_map_json_b_seq; + +create table ebasic_json_map_varchar ( + id bigint not null, + name varchar(255), + content varchar(3000), + version bigint not null, + constraint pk_ebasic_json_map_varchar primary key (id) +); +create sequence ebasic_json_map_varchar_seq; + +create table ebasic_json_node ( + id bigint not null, + name varchar(255), + content clob, + version bigint not null, + constraint pk_ebasic_json_node primary key (id) +); +create sequence ebasic_json_node_seq; + +create table ebasic_json_node_blob ( + id bigint not null, + name varchar(255), + content blob, + version bigint not null, + constraint pk_ebasic_json_node_blob primary key (id) +); +create sequence ebasic_json_node_blob_seq; + +create table ebasic_json_node_json_b ( + id bigint not null, + name varchar(255), + content clob, + version bigint not null, + constraint pk_ebasic_json_node_json_b primary key (id) +); +create sequence ebasic_json_node_json_b_seq; + +create table ebasic_json_node_varchar ( + id bigint not null, + name varchar(255), + content varchar(1000), + version bigint not null, + constraint pk_ebasic_json_node_varchar primary key (id) +); +create sequence ebasic_json_node_varchar_seq; + +create table e_basic_ndc ( + id integer not null, + name varchar(255), + constraint pk_e_basic_ndc primary key (id) +); +create sequence e_basic_ndc_seq; + +create table e_basicver ( + id integer not null, + name varchar(255), + description varchar(255), + other varchar(255), + last_update timestamp not null, + constraint pk_e_basicver primary key (id) +); +create sequence e_basicver_seq; + +create table e_basic_withlife ( + id bigint not null, + name varchar(255), + version bigint not null, + constraint pk_e_basic_withlife primary key (id) +); +create sequence e_basic_withlife_seq; + +create table e_basicverucon ( + id integer not null, + name varchar(255), + other varchar(255), + other_one varchar(255), + description varchar(255), + last_update timestamp not null, + constraint uq_e_basicverucon_name unique (name), + constraint pk_e_basicverucon primary key (id) +); +create sequence e_basicverucon_seq; + +create table eemb_inner ( + id integer not null, + nome_inner varchar(255), + outer_id integer, + update_count integer not null, + constraint pk_eemb_inner primary key (id) +); +create sequence eemb_inner_seq; + +create table eemb_outer ( + id integer not null, + nome_outer varchar(255), + date1 timestamp, + date2 timestamp, + update_count integer not null, + constraint pk_eemb_outer primary key (id) +); +create sequence eemb_outer_seq; + +create table egen_props ( + id bigint 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, + long_created bigint not null, + long_updated bigint not null, + constraint pk_egen_props primary key (id) +); +create sequence egen_props_seq; + +create table einvoice ( + id bigint not null, + invoice_date timestamp, + state integer, + person_id bigint, + ship_street varchar(255), + ship_suburb varchar(255), + ship_city varchar(255), + street varchar(255), + suburb varchar(255), + city varchar(255), + version bigint not null, + constraint ck_einvoice_state check (state in (0,1,2)), + constraint pk_einvoice primary key (id) +); +create sequence einvoice_seq; + +create table e_main ( + id integer not null, + name varchar(255), + description varchar(255), + version bigint not null, + constraint pk_e_main primary key (id) +); +create sequence e_main_seq; + +create table enull_collection ( + id integer not null, + name varchar(255), + constraint pk_enull_collection primary key (id) +); +create sequence enull_collection_seq; + +create table enull_collection_detail ( + id integer not null, + enull_collection_id integer not null, + something varchar(255), + constraint pk_enull_collection_detail primary key (id) +); +create sequence enull_collection_detail_seq; + +create table eopt_one_a ( + id integer 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 sequence eopt_one_a_seq; + +create table eopt_one_b ( + id integer 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 sequence eopt_one_b_seq; + +create table eopt_one_c ( + id integer 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 sequence eopt_one_c_seq; + +create table eperson ( + id bigint not null, + name varchar(255), + notes varchar(255), + street varchar(255), + suburb varchar(255), + city varchar(255), + version bigint not null, + constraint pk_eperson primary key (id) +); +create sequence eperson_seq; + +create table esimple ( + usertypeid integer auto_increment not null, + name varchar(255), + constraint pk_esimple primary key (usertypeid) +); + +create table esome_type ( + id integer not null, + currency varchar(3), + locale varchar(20), + time_zone varchar(20), + constraint pk_esome_type primary key (id) +); +create sequence esome_type_seq; + +create table etrans_many ( + id integer not null, + name varchar(255), + constraint pk_etrans_many primary key (id) +); +create sequence etrans_many_seq; + +create table evanilla_collection ( + id integer not null, + name varchar(255), + constraint pk_evanilla_collection primary key (id) +); +create sequence evanilla_collection_seq; + +create table evanilla_collection_detail ( + id integer not null, + evanilla_collection_id integer not null, + something varchar(255), + constraint pk_evanilla_collection_detail primary key (id) +); +create sequence evanilla_collection_detail_seq; + +create table ewho_props ( + id bigint not null, + name varchar(255), + who_created varchar(255) not null, + who_modified varchar(255) not null, + version bigint not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_ewho_props primary key (id) +); +create sequence ewho_props_seq; + +create table e_withinet ( + id bigint not null, + name varchar(255), + inet_address varchar(50), + version bigint not null, + constraint pk_e_withinet primary key (id) +); +create sequence e_withinet_seq; + +create table td_child ( + child_id integer not null, + child_name varchar(255), + parent_id integer not null, + constraint pk_td_child primary key (child_id) +); +create sequence td_child_seq; + +create table td_parent ( + parent_type varchar(31) not null, + parent_id integer not null, + parent_name varchar(255), + extended_name varchar(255), + constraint pk_td_parent primary key (parent_id) +); +create sequence td_parent_seq; + +create table feature_desc ( + id integer not null, + name varchar(255), + description varchar(255), + constraint pk_feature_desc primary key (id) +); +create sequence feature_desc_seq; + +create table f_first ( + id bigint not null, + name varchar(255), + constraint pk_f_first primary key (id) +); +create sequence f_first_seq; + +create table foo ( + foo_id integer not null, + important_text varchar(255), + version integer not null, + constraint pk_foo primary key (foo_id) +); +create sequence foo_seq; + +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 not null, + description varchar(255), + constraint pk_gen_key_sequence primary key (id) +); +create sequence seq; + +create table gen_key_table ( + id bigint not null, + description varchar(255), + constraint pk_gen_key_table primary key (id) +); +create sequence gen_key_table_seq; + +create table c_group ( + id bigint not null, + inactive boolean, + 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 sequence c_group_seq; + +create table imrelated ( + id bigint not null, + name varchar(255), + owner_id bigint not null, + constraint pk_imrelated primary key (id) +); +create sequence imrelated_seq; + +create table imroot ( + dtype varchar(10) not null, + id bigint not null, + title varchar(255), + when_title timestamp, + name varchar(255), + constraint pk_imroot primary key (id) +); +create sequence imroot_seq; + +create table ixresource ( + dtype varchar(255), + id binary(16) not null, + name varchar(255), + constraint pk_ixresource primary key (id) +); + +create table info_company ( + id bigint not null, + name varchar(255), + version bigint not null, + constraint pk_info_company primary key (id) +); +create sequence info_company_seq; + +create table info_contact ( + id bigint not null, + name varchar(255), + company_id bigint not null, + version bigint not null, + constraint pk_info_contact primary key (id) +); +create sequence info_contact_seq; + +create table info_customer ( + id bigint 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 sequence info_customer_seq; + +create table inner_report ( + id bigint 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 sequence inner_report_seq; + +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; + +create table item ( + customer integer not null, + itemnumber varchar(255) not null, + description varchar(255), + units varchar(255), + type integer, + region integer, + 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 level1 ( + id bigint not null, + name varchar(255), + constraint pk_level1 primary key (id) +); +create sequence level1_seq; + +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 not null, + name varchar(255), + constraint pk_level2 primary key (id) +); +create sequence level2_seq; + +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 not null, + name varchar(255), + constraint pk_level3 primary key (id) +); +create sequence level3_seq; + +create table level4 ( + id bigint not null, + name varchar(255), + constraint pk_level4 primary key (id) +); +create sequence level4_seq; + +create table la_attr_value ( + id integer 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 sequence la_attr_value_seq; + +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 mmedia ( + type varchar(31) not null, + id bigint not null, + url varchar(255), + note varchar(255), + constraint pk_mmedia primary key (id) +); +create sequence mmedia_seq; + +create table non_updateprop ( + id integer 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 sequence non_updateprop_seq; + +create table mprinter ( + id bigint 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_2 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 sequence mprinter_seq; + +create table mprinter_state ( + id bigint not null, + flags bigint, + printer_id bigint, + version bigint not null, + constraint pk_mprinter_state primary key (id) +); +create sequence mprinter_state_seq; + +create table mprofile ( + id bigint not null, + picture_id bigint, + name varchar(255), + constraint pk_mprofile primary key (id) +); +create sequence mprofile_seq; + +create table mprotected_construct_bean ( + id bigint not null, + name varchar(255), + constraint pk_mprotected_construct_bean primary key (id) +); +create sequence mprotected_construct_bean_seq; + +create table mrole ( + roleid integer not null, + role_name varchar(255), + constraint pk_mrole primary key (roleid) +); +create sequence mrole_seq; + +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 not null, + name varchar(255), + constraint pk_msome_other primary key (id) +); +create sequence msome_other_seq; + +create table muser ( + userid integer not null, + user_name varchar(255), + user_type_id integer, + constraint pk_muser primary key (userid) +); +create sequence muser_seq; + +create table muser_type ( + id integer not null, + name varchar(255), + constraint pk_muser_type primary key (id) +); +create sequence muser_type_seq; + +create table map_super_actual ( + id bigint not null, + name varchar(255), + when_created timestamp not null, + when_updated timestamp not null, + constraint pk_map_super_actual primary key (id) +); +create sequence map_super_actual_seq; + +create table c_message ( + id bigint 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 sequence c_message_seq; + +create table mnoc_role ( + role_id integer not null, + role_name varchar(255), + version integer not null, + constraint pk_mnoc_role primary key (role_id) +); +create sequence mnoc_role_seq; + +create table mnoc_user ( + user_id integer not null, + user_name varchar(255), + version integer not null, + constraint pk_mnoc_user primary key (user_id) +); +create sequence mnoc_user_seq; + +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 mp_role ( + id bigint not null, + mp_user_id bigint not null, + code varchar(255), + organization_id bigint, + constraint pk_mp_role primary key (id) +); +create sequence mp_role_seq; + +create table mp_user ( + id bigint not null, + name varchar(255), + constraint pk_mp_user primary key (id) +); +create sequence mp_user_seq; + +create table my_lob_size ( + id integer not null, + name varchar(255), + my_count integer, + my_lob clob, + constraint pk_my_lob_size primary key (id) +); +create sequence my_lob_size_seq; + +create table my_lob_size_join_many ( + id integer not null, + something varchar(255), + other varchar(255), + parent_id integer, + constraint pk_my_lob_size_join_many primary key (id) +); +create sequence my_lob_size_join_many_seq; + +create table noidbean ( + name varchar(255), + subject varchar(255), + when_created timestamp not null +); + +create table o_cached_bean ( + id bigint not null, + name varchar(255), + constraint pk_o_cached_bean primary key (id) +); +create sequence o_cached_bean_seq; + +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 not null, + cached_bean_id bigint, + constraint pk_o_cached_bean_child primary key (id) +); +create sequence o_cached_bean_child_seq; + +create table ocar ( + id integer 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 sequence ocar_seq; + +create table oengine ( + engine_id binary(16) 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 binary(16) 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 o_order ( + id integer 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 sequence o_order_seq; + +create table o_order_detail ( + id integer not null, + order_id integer, + 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 sequence o_order_detail_seq; + +create table s_orders ( + uuid varchar(255) not null, + constraint pk_s_orders primary key (uuid) +); + +create table s_order_items ( + uuid varchar(255) not null, + product_variant_uuid varchar(255), + order_uuid varchar(255), + quantity integer, + amount decimal(38), + constraint pk_s_order_items primary key (uuid) +); + +create table or_order_ship ( + id integer 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 sequence or_order_ship_seq; + +create table oto_child ( + id integer 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 sequence oto_child_seq; + +create table oto_master ( + id bigint not null, + name varchar(255), + constraint pk_oto_master primary key (id) +); +create sequence oto_master_seq; + +create table pfile ( + id integer 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 sequence pfile_seq; + +create table pfile_content ( + id integer not null, + content blob, + cretime timestamp not null, + updtime timestamp not null, + version bigint not null, + constraint pk_pfile_content primary key (id) +); +create sequence pfile_content_seq; + +create table paggview ( + pview_id binary(16), + amount integer not null, + constraint uq_paggview_pview_id unique (pview_id) +); + +create table pallet_location ( + type varchar(31) not null, + id integer not null, + zone_sid integer not null, + attribute varchar(255), + constraint pk_pallet_location primary key (id) +); +create sequence pallet_location_seq; + +create table parcel ( + parcelid bigint not null, + description varchar(255), + constraint pk_parcel primary key (parcelid) +); +create sequence parcel_seq; + +create table parcel_location ( + parcellocid bigint not null, + location varchar(255), + parcelid bigint, + constraint uq_parcel_location_parcelid unique (parcelid), + constraint pk_parcel_location primary key (parcellocid) +); +create sequence parcel_location_seq; + +create table rawinherit_parent ( + type varchar(31) not null, + id bigint not null, + val integer, + constraint pk_rawinherit_parent primary key (id) +); +create sequence rawinherit_parent_seq; + +create table rawinherit_parent_rawinherit_dat ( + rawinherit_parent_id bigint not null, + rawinherit_data_id bigint not null, + constraint pk_rawinherit_parent_rawinher_0 primary key (rawinherit_parent_id,rawinherit_data_id) +); + +create table c_participation ( + id bigint 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 sequence c_participation_seq; + +create table mt_permission ( + id binary(16) not null, + name varchar(255), + constraint pk_mt_permission primary key (id) +); + +create table persistent_file ( + id integer 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 sequence persistent_file_seq; + +create table persistent_file_content ( + id integer 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_pe_1 unique (persistent_file_id), + constraint pk_persistent_file_content primary key (id) +); +create sequence persistent_file_content_seq; + +create table persons ( + id bigint not null, + surname varchar(64) not null, + name varchar(64) not null, + constraint pk_persons primary key (id) +); +create sequence persons_seq start with 1000 increment by 40; + +create table person ( + oid bigint not null, + default_address_oid bigint, + version integer not null, + constraint pk_person primary key (oid) +); +create sequence person_seq; + +create table phones ( + id bigint 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 sequence phones_seq; + +create table o_product ( + id integer not null, + sku varchar(20), + name varchar(255), + cretime timestamp not null, + updtime timestamp not null, + constraint pk_o_product primary key (id) +); +create sequence o_product_seq; + +create table pp ( + id binary(16) not null, + name varchar(255), + value varchar(100) not null, + constraint pk_pp primary key (id) +); + +create table pp_to_ww ( + pp_id binary(16) not null, + ww_id binary(16) not null, + constraint pk_pp_to_ww primary key (pp_id,ww_id) +); + +create table rcustomer ( + company varchar(255) not null, + name varchar(255) not null, + description varchar(255), + constraint pk_rcustomer primary key (company,name) +); + +create table r_orders ( + company varchar(255) not null, + order_number integer not null, + customername varchar(255), + item varchar(255), + constraint pk_r_orders primary key (company,order_number) +); + +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 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 binary(16) not null, + name varchar(50), + tenant_id binary(16), + version bigint not null, + constraint pk_mt_role primary key (id) +); + +create table mt_role_permission ( + mt_role_id binary(16) not null, + mt_permission_id binary(16) not null, + constraint pk_mt_role_permission primary key (mt_role_id,mt_permission_id) +); + +create table em_role ( + id bigint not null, + name varchar(255), + constraint pk_em_role primary key (id) +); +create sequence em_role_seq; + +create table f_second ( + id bigint not null, + first bigint, + title varchar(255), + constraint uq_f_second_first unique (first), + constraint pk_f_second primary key (id) +); +create sequence f_second_seq; + +create table section ( + id integer 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 sequence section_seq; + +create table self_parent ( + id bigint not null, + name varchar(255), + parent_id bigint, + version bigint not null, + constraint pk_self_parent primary key (id) +); +create sequence self_parent_seq; + +create table self_ref_customer ( + id bigint not null, + name varchar(255), + referred_by_id bigint, + constraint pk_self_ref_customer primary key (id) +); +create sequence self_ref_customer_seq; + +create table self_ref_example ( + id bigint not null, + name varchar(255) not null, + parent_id bigint, + constraint pk_self_ref_example primary key (id) +); +create sequence self_ref_example_seq; + +create table some_enum_bean ( + id bigint 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 sequence some_enum_bean_seq; + +create table some_file_bean ( + id bigint not null, + name varchar(255), + content blob, + version bigint not null, + constraint pk_some_file_bean primary key (id) +); +create sequence some_file_bean_seq; + +create table some_new_types_bean ( + id bigint not null, + dow integer(1), + mth integer(1), + yr integer, + yr_mth date, + local_date date, + local_date_time timestamp, + offset_date_time timestamp, + zoned_date_time timestamp, + instant timestamp, + zone_id varchar(60), + zone_offset varchar(60), + 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 sequence some_new_types_bean_seq; + +create table some_period_bean ( + id bigint not null, + period_years integer, + period_months integer, + period_days integer, + anniversary date, + version bigint not null, + constraint pk_some_period_bean primary key (id) +); +create sequence some_period_bean_seq; + +create table stockforecast ( + type varchar(31) not null, + id bigint not null, + inner_report_id bigint, + constraint pk_stockforecast primary key (id) +); +create sequence stockforecast_seq; + +create table sub_section ( + id integer 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 sequence sub_section_seq; + +create table sub_type ( + sub_type_id integer not null, + description varchar(255), + version bigint not null, + constraint pk_sub_type primary key (sub_type_id) +); +create sequence sub_type_seq; + +create table tbytes_only ( + id integer not null, + content blob, + constraint pk_tbytes_only primary key (id) +); +create sequence tbytes_only_seq; + +create table tcar ( + type varchar(31) not null, + plate_no varchar(255) not null, + truckload bigint, + constraint pk_tcar primary key (plate_no) +); + +create table tint_root ( + my_type integer(3) not null, + id integer not null, + name varchar(255), + child_property varchar(255), + constraint pk_tint_root primary key (id) +); +create sequence tint_root_seq; + +create table tjoda_entity ( + id integer not null, + local_time time, + constraint pk_tjoda_entity primary key (id) +); +create sequence tjoda_entity_seq; + +create table t_mapsuper1 ( + id integer not null, + something varchar(255), + name varchar(255), + version integer not null, + constraint pk_t_mapsuper1 primary key (id) +); +create sequence t_mapsuper1_seq; + +create table t_oneb ( + id integer not null, + name varchar(255), + description varchar(255), + active boolean, + constraint pk_t_oneb primary key (id) +); +create sequence t_oneb_seq; + +create table t_detail_with_other_namexxxyy ( + id integer not null, + name varchar(255), + description varchar(255), + active boolean, + master_id integer, + constraint pk_t_detail_with_other_namexx_0 primary key (id) +); +create sequence t_atable_detail_seq; + +create table ts_detail_two ( + id integer not null, + name varchar(255), + description varchar(255), + active boolean, + master_id integer, + constraint pk_ts_detail_two primary key (id) +); +create sequence ts_detail_two_seq; + +create table t_atable_thatisrelatively ( + id integer not null, + name varchar(255), + description varchar(255), + active boolean, + constraint pk_t_atable_thatisrelatively primary key (id) +); +create sequence t_atable_master_seq; + +create table ts_master_two ( + id integer not null, + name varchar(255), + description varchar(255), + active boolean, + constraint pk_ts_master_two primary key (id) +); +create sequence ts_master_two_seq; + +create table tuuid_entity ( + id binary(16) not null, + name varchar(255), + constraint pk_tuuid_entity primary key (id) +); + +create table twheel ( + id bigint not null, + owner_plate_no varchar(255) not null, + constraint pk_twheel primary key (id) +); +create sequence twheel_seq; + +create table twith_pre_insert ( + id integer not null, + name varchar(255) not null, + title varchar(255), + constraint pk_twith_pre_insert primary key (id) +); +create sequence twith_pre_insert_seq; + +create table mt_tenant ( + id binary(16) not null, + name varchar(255), + version bigint not null, + constraint pk_mt_tenant primary key (id) +); + +create table sa_tire ( + id bigint not null, + version integer not null, + constraint pk_sa_tire primary key (id) +); +create sequence sa_tire_seq; + +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; + +create table trip ( + id integer not null, + vehicle_driver_id integer, + destination varchar(255), + address_id smallint, + star_date timestamp, + cretime timestamp not null, + updtime timestamp not null, + version bigint not null, + constraint pk_trip primary key (id) +); +create sequence trip_seq; + +create table truck_ref ( + id integer not null, + something varchar(255), + constraint pk_truck_ref primary key (id) +); +create sequence truck_ref_seq; + +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 ut_detail ( + id integer 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 sequence ut_detail_seq; + +create table ut_master ( + id integer not null, + name varchar(255), + description varchar(255), + version integer not null, + constraint pk_ut_master primary key (id) +); +create sequence ut_master_seq; + +create table uuone ( + id binary(16) not null, + name varchar(255), + constraint pk_uuone primary key (id) +); + +create table uutwo ( + id binary(16) not null, + name varchar(255), + master_id binary(16), + constraint pk_uutwo primary key (id) +); + +create table em_user ( + id bigint not null, + name varchar(255), + constraint pk_em_user primary key (id) +); +create sequence em_user_seq; + +create table tx_user ( + id bigint not null, + name varchar(255), + constraint pk_tx_user primary key (id) +); +create sequence tx_user_seq; + +create table c_user ( + id bigint not null, + inactive boolean, + name varchar(255), + email 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 sequence c_user_seq; + +create table oto_user ( + id bigint 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 sequence oto_user_seq; + +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 not null, + license_number varchar(255), + registration_date timestamp, + cretime timestamp not null, + updtime timestamp not null, + version bigint not null, + truck_ref_id integer, + capacity double, + driver varchar(255), + car_ref_id integer, + constraint pk_vehicle primary key (id) +); +create sequence vehicle_seq; + +create table vehicle_driver ( + id integer not null, + name varchar(255), + vehicle_id integer, + address_id smallint, + license_issued_on timestamp, + cretime timestamp not null, + updtime timestamp not null, + version bigint not null, + constraint pk_vehicle_driver primary key (id) +); +create sequence vehicle_driver_seq; + +create table warehouses ( + id integer not null, + officezoneid integer, + constraint pk_warehouses primary key (id) +); +create sequence warehouses_seq; + +create table warehousesshippingzones ( + warehouseid integer not null, + shippingzoneid integer not null, + constraint pk_warehousesshippingzones primary key (warehouseid,shippingzoneid) +); + +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; + +create table sp_car_wheel ( + id bigint not null, + version integer not null, + constraint pk_sp_car_wheel primary key (id) +); +create sequence sp_car_wheel_seq; + +create table wheel ( + id bigint not null, + version integer not null, + constraint pk_wheel primary key (id) +); +create sequence wheel_seq; + +create table with_zero ( + id bigint not null, + name varchar(255), + parent_id integer, + version bigint not null, + constraint pk_with_zero primary key (id) +); +create sequence with_zero_seq; + +create table parent ( + id integer not null, + name varchar(255), + constraint pk_parent primary key (id) +); +create sequence parent_seq; + +create table wview ( + id binary(16) not null, + name varchar(255) not null, + constraint uq_wview_name unique (name), + constraint pk_wview primary key (id) +); + +create table zones ( + type varchar(31) not null, + id integer not null, + attribute varchar(255), + constraint pk_zones primary key (id) +); +create sequence zones_seq; + +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_bar_foo_id on bar (foo_id); + +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; +create index ix_o_address_country_code on o_address (country_code); + +alter table animals add constraint fk_animals_shelter_id foreign key (shelter_id) references animal_shelter (id) on delete restrict on update restrict; +create index ix_animals_shelter_id on animals (shelter_id); + +alter table attribute add constraint fk_attribute_attribute_holder_1 foreign key (attribute_holder_id) references attribute_holder (id) on delete restrict on update restrict; +create index ix_attribute_attribute_holder_1 on attribute (attribute_holder_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_id on bbookmark (user_id); + +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; + +alter table ckey_detail add constraint fk_ckey_detail_ckey_parent foreign key (one_key,two_key) references ckey_parent (one_key,two_key) on delete restrict on update restrict; +create index ix_ckey_detail_one_key_two_key on ckey_detail (one_key,two_key); + +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_ckey_parent_assoc_id on ckey_parent (assoc_id); + +alter table calculation_result add constraint fk_calculation_result_product_1 foreign key (product_configuration_id) references configuration (id) on delete restrict on update restrict; +create index ix_calculation_result_product_1 on calculation_result (product_configuration_id); + +alter table calculation_result add constraint fk_calculation_result_group_c_2 foreign key (group_configuration_id) references configuration (id) on delete restrict on update restrict; +create index ix_calculation_result_group_c_2 on calculation_result (group_configuration_id); + +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_car on sp_car_car_wheels (car); + +alter table sp_car_car_wheels add constraint fk_sp_car_car_wheels_sp_car_w_2 foreign key (wheel) references sp_car_wheel (id) on delete restrict on update restrict; +create index ix_sp_car_car_wheels_wheel on sp_car_car_wheels (wheel); + +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_car_accessory_car_id on car_accessory (car_id); + +alter table configuration add constraint fk_configuration_configuratio_1 foreign key (configurations_id) references configurations (id) on delete restrict on update restrict; +create index ix_configuration_configuratio_1 on configuration (configurations_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_customer_id on contact (customer_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_group_id on contact (group_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_contact_note_contact_id on contact_note (contact_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_c_conversation_group_id on c_conversation (group_id); + +alter table o_customer add constraint fk_o_customer_billing_address_1 foreign key (billing_address_id) references o_address (id) on delete restrict on update restrict; +create index ix_o_customer_billing_address_1 on o_customer (billing_address_id); + +alter table o_customer add constraint fk_o_customer_shipping_addres_2 foreign key (shipping_address_id) references o_address (id) on delete restrict on update restrict; +create index ix_o_customer_shipping_addres_2 on o_customer (shipping_address_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_eemb_inner_outer_id on eemb_inner (outer_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_einvoice_person_id on einvoice (person_id); + +alter table enull_collection_detail add constraint fk_enull_collection_detail_en_1 foreign key (enull_collection_id) references enull_collection (id) on delete restrict on update restrict; +create index ix_enull_collection_detail_en_1 on enull_collection_detail (enull_collection_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_a_b_id on eopt_one_a (b_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_eopt_one_b_c_id on eopt_one_b (c_id); + +alter table evanilla_collection_detail add constraint fk_evanilla_collection_detail_1 foreign key (evanilla_collection_id) references evanilla_collection (id) on delete restrict on update restrict; +create index ix_evanilla_collection_detail_1 on evanilla_collection_detail (evanilla_collection_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_td_child_parent_id on td_child (parent_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_imrelated_owner_id on imrelated (owner_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; +create index ix_info_contact_company_id on info_contact (company_id); + +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; + +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_drel_invoice_booking on drel_invoice (booking); + +alter table item add constraint fk_item_type foreign key (customer,type) references type (customer,type) on delete restrict on update restrict; +create index ix_item_customer_type on item (customer,type); + +alter table item add constraint fk_item_region foreign key (customer,region) references region (customer,type) on delete restrict on update restrict; +create index ix_item_customer_region on item (customer,region); + +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_level1_id on level1_level4 (level1_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_level4_level4_id on level1_level4 (level4_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_level1_id on level1_level2 (level1_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_level1_level2_level2_id on level1_level2 (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_level2_id on level2_level3 (level2_id); + +alter table level2_level3 add constraint fk_level2_level3_level3 foreign key (level3_id) references level3 (id) on delete restrict on update restrict; +create index ix_level2_level3_level3_id on level2_level3 (level3_id); + +alter table la_attr_value_attribute add constraint fk_la_attr_value_attribute_la_1 foreign key (la_attr_value_id) references la_attr_value (id) on delete restrict on update restrict; +create index ix_la_attr_value_attribute_la_1 on la_attr_value_attribute (la_attr_value_id); + +alter table la_attr_value_attribute add constraint fk_la_attr_value_attribute_at_2 foreign key (attribute_id) references attribute (id) on delete restrict on update restrict; +create index ix_la_attr_value_attribute_at_2 on la_attr_value_attribute (attribute_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; +create index ix_mprinter_current_state_id on mprinter (current_state_id); + +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_3 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; + +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_mprinter_state_printer_id on mprinter_state (printer_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_mprofile_picture_id on mprofile (picture_id); + +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_mrole_roleid on mrole_muser (mrole_roleid); + +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_mrole_muser_muser_userid on mrole_muser (muser_userid); + +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_muser_user_type_id on muser (user_type_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_conversation_id on c_message (conversation_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; +create index ix_c_message_user_id on c_message (user_id); + +alter table mnoc_user_mnoc_role add constraint fk_mnoc_user_mnoc_role_mnoc_u_1 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_u_1 on mnoc_user_mnoc_role (mnoc_user_user_id); + +alter table mnoc_user_mnoc_role add constraint fk_mnoc_user_mnoc_role_mnoc_r_2 foreign key (mnoc_role_role_id) references mnoc_role (role_id) on delete restrict on update restrict; +create index ix_mnoc_user_mnoc_role_mnoc_r_2 on mnoc_user_mnoc_role (mnoc_role_role_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_mp_role_mp_user_id on mp_role (mp_user_id); + +alter table my_lob_size_join_many add constraint fk_my_lob_size_join_many_pare_1 foreign key (parent_id) references my_lob_size (id) on delete restrict on update restrict; +create index ix_my_lob_size_join_many_pare_1 on my_lob_size_join_many (parent_id); + +alter table o_cached_bean_country add constraint fk_o_cached_bean_country_o_ca_1 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_ca_1 on o_cached_bean_country (o_cached_bean_id); + +alter table o_cached_bean_country add constraint fk_o_cached_bean_country_o_co_2 foreign key (o_country_code) references o_country (code) on delete restrict on update restrict; +create index ix_o_cached_bean_country_o_co_2 on o_cached_bean_country (o_country_code); + +alter table o_cached_bean_child add constraint fk_o_cached_bean_child_cached_1 foreign key (cached_bean_id) references o_cached_bean (id) on delete restrict on update restrict; +create index ix_o_cached_bean_child_cached_1 on o_cached_bean_child (cached_bean_id); + +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; + +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_kcustomer_id on o_order (kcustomer_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_order_id on o_order_detail (order_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_o_order_detail_product_id on o_order_detail (product_id); + +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_s_order_items_order_uuid on s_order_items (order_uuid); + +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_or_order_ship_order_id on or_order_ship (order_id); + +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 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; + +alter table pallet_location add constraint fk_pallet_location_zone_sid foreign key (zone_sid) references zones (id) on delete restrict on update restrict; +create index ix_pallet_location_zone_sid on pallet_location (zone_sid); + +alter table parcel_location add constraint fk_parcel_location_parcelid foreign key (parcelid) references parcel (parcelid) on delete restrict on update restrict; + +alter table rawinherit_parent_rawinherit_dat add constraint fk_rawinherit_parent_rawinher_1 foreign key (rawinherit_parent_id) references rawinherit_parent (id) on delete restrict on update restrict; +create index ix_rawinherit_parent_rawinher_1 on rawinherit_parent_rawinherit_dat (rawinherit_parent_id); + +alter table rawinherit_parent_rawinherit_dat add constraint fk_rawinherit_parent_rawinher_2 foreign key (rawinherit_data_id) references rawinherit_data (id) on delete restrict on update restrict; +create index ix_rawinherit_parent_rawinher_2 on rawinherit_parent_rawinherit_dat (rawinherit_data_id); + +alter table c_participation add constraint fk_c_participation_conversati_1 foreign key (conversation_id) references c_conversation (id) on delete restrict on update restrict; +create index ix_c_participation_conversati_1 on c_participation (conversation_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_c_participation_user_id on c_participation (user_id); + +alter table persistent_file_content add constraint fk_persistent_file_content_pe_1 foreign key (persistent_file_id) references persistent_file (id) on delete restrict on update restrict; + +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_default_address_oid on person (default_address_oid); + +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_phones_person_id on phones (person_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_pp_id on pp_to_ww (pp_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_pp_to_ww_ww_id on pp_to_ww (ww_id); + +alter table r_orders add constraint fk_r_orders_rcustomer foreign key (company,customername) references rcustomer (company,name) on delete restrict on update restrict; +create index ix_r_orders_company_customern_1 on r_orders (company,customername); + +alter table resourcefile add constraint fk_resourcefile_parentresourc_1 foreign key (parentresourcefileid) references resourcefile (id) on delete restrict on update restrict; +create index ix_resourcefile_parentresourc_1 on resourcefile (parentresourcefileid); + +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_tenant_id on mt_role (tenant_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_role_1 on mt_role_permission (mt_role_id); + +alter table mt_role_permission add constraint fk_mt_role_permission_mt_perm_2 foreign key (mt_permission_id) references mt_permission (id) on delete restrict on update restrict; +create index ix_mt_role_permission_mt_perm_2 on mt_role_permission (mt_permission_id); + +alter table f_second add constraint fk_f_second_first foreign key (first) references f_first (id) on delete restrict on update restrict; + +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_section_article_id on section (article_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_parent_parent_id on self_parent (parent_id); + +alter table self_ref_customer add constraint fk_self_ref_customer_referred_1 foreign key (referred_by_id) references self_ref_customer (id) on delete restrict on update restrict; +create index ix_self_ref_customer_referred_1 on self_ref_customer (referred_by_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; +create index ix_self_ref_example_parent_id on self_ref_example (parent_id); + +alter table stockforecast add constraint fk_stockforecast_inner_report_1 foreign key (inner_report_id) references inner_report (id) on delete restrict on update restrict; +create index ix_stockforecast_inner_report_1 on stockforecast (inner_report_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_sub_section_section_id on sub_section (section_id); + +alter table t_detail_with_other_namexxxyy add constraint fk_t_detail_with_other_namexx_1 foreign key (master_id) references t_atable_thatisrelatively (id) on delete restrict on update restrict; +create index ix_t_detail_with_other_namexx_1 on t_detail_with_other_namexxxyy (master_id); + +alter table ts_detail_two add constraint fk_ts_detail_two_master_id foreign key (master_id) references ts_master_two (id) on delete restrict on update restrict; +create index ix_ts_detail_two_master_id on ts_detail_two (master_id); + +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; +create index ix_twheel_owner_plate_no on twheel (owner_plate_no); + +alter table tire add constraint fk_tire_wheel foreign key (wheel) references wheel (id) on delete restrict on update restrict; + +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_vehicle_driver_id on trip (vehicle_driver_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_trip_address_id on trip (address_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_type_sub_type_id on type (sub_type_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_ut_detail_utmaster_id on ut_detail (utmaster_id); + +alter table uutwo add constraint fk_uutwo_master_id foreign key (master_id) references uuone (id) on delete restrict on update restrict; +create index ix_uutwo_master_id on uutwo (master_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_c_user_group_id on c_user (group_id); + +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; + +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_user_id on em_user_role (user_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_em_user_role_role_id on em_user_role (role_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_truck_ref_id on vehicle (truck_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_car_ref_id on vehicle (car_ref_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_vehicle_id on vehicle_driver (vehicle_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_vehicle_driver_address_id on vehicle_driver (address_id); + +alter table warehouses add constraint fk_warehouses_officezoneid foreign key (officezoneid) references zones (id) on delete restrict on update restrict; +create index ix_warehouses_officezoneid on warehouses (officezoneid); + +alter table warehousesshippingzones add constraint fk_warehousesshippingzones_wa_1 foreign key (warehouseid) references warehouses (id) on delete restrict on update restrict; +create index ix_warehousesshippingzones_wa_1 on warehousesshippingzones (warehouseid); + +alter table warehousesshippingzones add constraint fk_warehousesshippingzones_zo_2 foreign key (shippingzoneid) references zones (id) on delete restrict on update restrict; +create index ix_warehousesshippingzones_sh_2 on warehousesshippingzones (shippingzoneid); + +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_tire on sa_wheel (tire); + +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_sa_wheel_car on sa_wheel (car); + +alter table with_zero add constraint fk_with_zero_parent_id foreign key (parent_id) references parent (id) on delete restrict on update restrict; +create index ix_with_zero_parent_id on with_zero (parent_id); + diff --git a/src/test/ddl-review/h2-drop.sql b/src/test/ddl-review/h2-drop.sql new file mode 100644 index 000000000..080923655 --- /dev/null +++ b/src/test/ddl-review/h2-drop.sql @@ -0,0 +1,936 @@ +alter table bar drop constraint fk_bar_foo_id; +drop index ix_bar_foo_id; + +alter table o_address drop constraint fk_o_address_country_code; +drop index ix_o_address_country_code; + +alter table animals drop constraint fk_animals_shelter_id; +drop index ix_animals_shelter_id; + +alter table attribute drop constraint fk_attribute_attribute_holder_1; +drop index ix_attribute_attribute_holder_1; + +alter table bbookmark drop constraint fk_bbookmark_user_id; +drop index ix_bbookmark_user_id; + +alter table drel_booking drop constraint fk_drel_booking_agent_invoice; + +alter table drel_booking drop constraint fk_drel_booking_client_invoice; + +alter table ckey_detail drop constraint fk_ckey_detail_ckey_parent; +drop index ix_ckey_detail_one_key_two_key; + +alter table ckey_parent drop constraint fk_ckey_parent_assoc_id; +drop index ix_ckey_parent_assoc_id; + +alter table calculation_result drop constraint fk_calculation_result_product_1; +drop index ix_calculation_result_product_1; + +alter table calculation_result drop constraint fk_calculation_result_group_c_2; +drop index ix_calculation_result_group_c_2; + +alter table sp_car_car_wheels drop constraint fk_sp_car_car_wheels_sp_car_car; +drop index ix_sp_car_car_wheels_car; + +alter table sp_car_car_wheels drop constraint fk_sp_car_car_wheels_sp_car_w_2; +drop index ix_sp_car_car_wheels_wheel; + +alter table car_accessory drop constraint fk_car_accessory_car_id; +drop index ix_car_accessory_car_id; + +alter table configuration drop constraint fk_configuration_configuratio_1; +drop index ix_configuration_configuratio_1; + +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 c_conversation drop constraint fk_c_conversation_group_id; +drop index ix_c_conversation_group_id; + +alter table o_customer drop constraint fk_o_customer_billing_address_1; +drop index ix_o_customer_billing_address_1; + +alter table o_customer drop constraint fk_o_customer_shipping_addres_2; +drop index ix_o_customer_shipping_addres_2; + +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_enull_collection_detail_en_1; +drop index ix_enull_collection_detail_en_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 evanilla_collection_detail drop constraint fk_evanilla_collection_detail_1; +drop index ix_evanilla_collection_detail_1; + +alter table td_child drop constraint fk_td_child_parent_id; +drop index ix_td_child_parent_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_type; +drop index ix_item_customer_type; + +alter table item drop constraint fk_item_region; +drop index ix_item_customer_region; + +alter table level1_level4 drop constraint fk_level1_level4_level1; +drop index ix_level1_level4_level1_id; + +alter table level1_level4 drop constraint fk_level1_level4_level4; +drop index ix_level1_level4_level4_id; + +alter table level1_level2 drop constraint fk_level1_level2_level1; +drop index ix_level1_level2_level1_id; + +alter table level1_level2 drop constraint fk_level1_level2_level2; +drop index ix_level1_level2_level2_id; + +alter table level2_level3 drop constraint fk_level2_level3_level2; +drop index ix_level2_level3_level2_id; + +alter table level2_level3 drop constraint fk_level2_level3_level3; +drop index ix_level2_level3_level3_id; + +alter table la_attr_value_attribute drop constraint fk_la_attr_value_attribute_la_1; +drop index ix_la_attr_value_attribute_la_1; + +alter table la_attr_value_attribute drop constraint fk_la_attr_value_attribute_at_2; +drop index ix_la_attr_value_attribute_at_2; + +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_mprinter_last_swap_magenta_3; + +alter table mprinter drop constraint fk_mprinter_last_swap_yellow_id; + +alter table mprinter drop constraint fk_mprinter_last_swap_black_id; + +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_roleid; + +alter table mrole_muser drop constraint fk_mrole_muser_muser; +drop index ix_mrole_muser_muser_userid; + +alter table muser drop constraint fk_muser_user_type_id; +drop index ix_muser_user_type_id; + +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 mnoc_user_mnoc_role drop constraint fk_mnoc_user_mnoc_role_mnoc_u_1; +drop index ix_mnoc_user_mnoc_role_mnoc_u_1; + +alter table mnoc_user_mnoc_role drop constraint fk_mnoc_user_mnoc_role_mnoc_r_2; +drop index ix_mnoc_user_mnoc_role_mnoc_r_2; + +alter table mp_role drop constraint fk_mp_role_mp_user_id; +drop index ix_mp_role_mp_user_id; + +alter table my_lob_size_join_many drop constraint fk_my_lob_size_join_many_pare_1; +drop index ix_my_lob_size_join_many_pare_1; + +alter table o_cached_bean_country drop constraint fk_o_cached_bean_country_o_ca_1; +drop index ix_o_cached_bean_country_o_ca_1; + +alter table o_cached_bean_country drop constraint fk_o_cached_bean_country_o_co_2; +drop index ix_o_cached_bean_country_o_co_2; + +alter table o_cached_bean_child drop constraint fk_o_cached_bean_child_cached_1; +drop index ix_o_cached_bean_child_cached_1; + +alter table oengine drop constraint fk_oengine_car_id; + +alter table ogear_box drop constraint fk_ogear_box_car_id; + +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 oto_child drop constraint fk_oto_child_master_id; + +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_dat drop constraint fk_rawinherit_parent_rawinher_1; +drop index ix_rawinherit_parent_rawinher_1; + +alter table rawinherit_parent_rawinherit_dat drop constraint fk_rawinherit_parent_rawinher_2; +drop index ix_rawinherit_parent_rawinher_2; + +alter table c_participation drop constraint fk_c_participation_conversati_1; +drop index ix_c_participation_conversati_1; + +alter table c_participation drop constraint fk_c_participation_user_id; +drop index ix_c_participation_user_id; + +alter table persistent_file_content drop constraint fk_persistent_file_content_pe_1; + +alter table person drop constraint fk_person_default_address_oid; +drop index ix_person_default_address_oid; + +alter table phones drop constraint fk_phones_person_id; +drop index ix_phones_person_id; + +alter table pp_to_ww drop constraint fk_pp_to_ww_pp; +drop index ix_pp_to_ww_pp_id; + +alter table pp_to_ww drop constraint fk_pp_to_ww_wview; +drop index ix_pp_to_ww_ww_id; + +alter table r_orders drop constraint fk_r_orders_rcustomer; +drop index ix_r_orders_company_customern_1; + +alter table resourcefile drop constraint fk_resourcefile_parentresourc_1; +drop index ix_resourcefile_parentresourc_1; + +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_1; + +alter table mt_role_permission drop constraint fk_mt_role_permission_mt_perm_2; +drop index ix_mt_role_permission_mt_perm_2; + +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_self_ref_customer_referred_1; +drop index ix_self_ref_customer_referred_1; + +alter table self_ref_example drop constraint fk_self_ref_example_parent_id; +drop index ix_self_ref_example_parent_id; + +alter table stockforecast drop constraint fk_stockforecast_inner_report_1; +drop index ix_stockforecast_inner_report_1; + +alter table sub_section drop constraint fk_sub_section_section_id; +drop index ix_sub_section_section_id; + +alter table t_detail_with_other_namexxxyy drop constraint fk_t_detail_with_other_namexx_1; +drop index ix_t_detail_with_other_namexx_1; + +alter table ts_detail_two drop constraint fk_ts_detail_two_master_id; +drop index ix_ts_detail_two_master_id; + +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 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 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 c_user drop constraint fk_c_user_group_id; +drop index ix_c_user_group_id; + +alter table oto_user drop constraint fk_oto_user_account_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_truck_ref_id; +drop index ix_vehicle_truck_ref_id; + +alter table vehicle drop constraint fk_vehicle_car_ref_id; +drop index ix_vehicle_car_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_warehousesshippingzones_wa_1; +drop index ix_warehousesshippingzones_wa_1; + +alter table warehousesshippingzones drop constraint fk_warehousesshippingzones_zo_2; +drop index ix_warehousesshippingzones_sh_2; + +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 with_zero drop constraint fk_with_zero_parent_id; +drop index ix_with_zero_parent_id; + +drop table if exists asimple_bean; +drop sequence if exists asimple_bean_seq; + +drop table if exists bar; +drop sequence if exists bar_seq; + +drop table if exists oto_account; +drop sequence if exists oto_account_seq; + +drop table if exists o_address; +drop sequence if exists o_address_seq; + +drop table if exists address; +drop sequence if exists address_seq; + +drop table if exists animals; +drop sequence if exists animals_seq; + +drop table if exists animal_shelter; +drop sequence if exists animal_shelter_seq; + +drop table if exists article; +drop sequence if exists article_seq; + +drop table if exists attribute; +drop sequence if exists attribute_seq; + +drop table if exists attribute_holder; +drop sequence if exists attribute_holder_seq; + +drop table if exists audit_log; +drop sequence if exists audit_log_seq; + +drop table if exists bbookmark; +drop sequence if exists bbookmark_seq; + +drop table if exists bbookmark_user; +drop sequence if exists bbookmark_user_seq; + +drop table if exists bsimple_with_gen; +drop sequence if exists bsimple_with_gen_seq; + +drop table if exists bwith_qident; +drop sequence if exists bwith_qident_seq; + +drop table if exists basic_joda_entity; +drop sequence if exists basic_joda_entity_seq; + +drop table if exists bean_with_time_zone; +drop sequence if exists bean_with_time_zone_seq; + +drop table if exists drel_booking; +drop sequence if exists drel_booking_seq; + +drop table if exists ckey_assoc; +drop sequence if exists ckey_assoc_seq; + +drop table if exists ckey_detail; +drop sequence if exists ckey_detail_seq; + +drop table if exists ckey_parent; + +drop table if exists calculation_result; +drop sequence if exists calculation_result_seq; + +drop table if exists cao_bean; + +drop table if exists sa_car; +drop sequence if exists sa_car_seq; + +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 car_accessory; +drop sequence if exists car_accessory_seq; + +drop table if exists configuration; +drop sequence if exists configuration_seq; + +drop table if exists configurations; +drop sequence if exists configurations_seq; + +drop table if exists contact; +drop sequence if exists contact_seq; + +drop table if exists contact_group; +drop sequence if exists contact_group_seq; + +drop table if exists contact_note; +drop sequence if exists contact_note_seq; + +drop table if exists c_conversation; +drop sequence if exists c_conversation_seq; + +drop table if exists o_country; + +drop table if exists o_customer; +drop sequence if exists o_customer_seq; + +drop table if exists dexh_entity; +drop sequence if exists dexh_entity_seq; + +drop table if exists dperson; +drop sequence if exists dperson_seq; + +drop table if exists rawinherit_data; +drop sequence if exists rawinherit_data_seq; + +drop table if exists e_basic; +drop sequence if exists e_basic_seq; + +drop table if exists ebasic_clob; +drop sequence if exists ebasic_clob_seq; + +drop table if exists ebasic_clob_fetch_eager; +drop sequence if exists ebasic_clob_fetch_eager_seq; + +drop table if exists ebasic_clob_no_ver; +drop sequence if exists ebasic_clob_no_ver_seq; + +drop table if exists e_basicenc; +drop sequence if exists e_basicenc_seq; + +drop table if exists e_basicenc_bin; +drop sequence if exists e_basicenc_bin_seq; + +drop table if exists e_basic_enum_id; + +drop table if exists ebasic_json_map; +drop sequence if exists ebasic_json_map_seq; + +drop table if exists ebasic_json_map_blob; +drop sequence if exists ebasic_json_map_blob_seq; + +drop table if exists ebasic_json_map_clob; +drop sequence if exists ebasic_json_map_clob_seq; + +drop table if exists ebasic_json_map_json_b; +drop sequence if exists ebasic_json_map_json_b_seq; + +drop table if exists ebasic_json_map_varchar; +drop sequence if exists ebasic_json_map_varchar_seq; + +drop table if exists ebasic_json_node; +drop sequence if exists ebasic_json_node_seq; + +drop table if exists ebasic_json_node_blob; +drop sequence if exists ebasic_json_node_blob_seq; + +drop table if exists ebasic_json_node_json_b; +drop sequence if exists ebasic_json_node_json_b_seq; + +drop table if exists ebasic_json_node_varchar; +drop sequence if exists ebasic_json_node_varchar_seq; + +drop table if exists e_basic_ndc; +drop sequence if exists e_basic_ndc_seq; + +drop table if exists e_basicver; +drop sequence if exists e_basicver_seq; + +drop table if exists e_basic_withlife; +drop sequence if exists e_basic_withlife_seq; + +drop table if exists e_basicverucon; +drop sequence if exists e_basicverucon_seq; + +drop table if exists eemb_inner; +drop sequence if exists eemb_inner_seq; + +drop table if exists eemb_outer; +drop sequence if exists eemb_outer_seq; + +drop table if exists egen_props; +drop sequence if exists egen_props_seq; + +drop table if exists einvoice; +drop sequence if exists einvoice_seq; + +drop table if exists e_main; +drop sequence if exists e_main_seq; + +drop table if exists enull_collection; +drop sequence if exists enull_collection_seq; + +drop table if exists enull_collection_detail; +drop sequence if exists enull_collection_detail_seq; + +drop table if exists eopt_one_a; +drop sequence if exists eopt_one_a_seq; + +drop table if exists eopt_one_b; +drop sequence if exists eopt_one_b_seq; + +drop table if exists eopt_one_c; +drop sequence if exists eopt_one_c_seq; + +drop table if exists eperson; +drop sequence if exists eperson_seq; + +drop table if exists esimple; + +drop table if exists esome_type; +drop sequence if exists esome_type_seq; + +drop table if exists etrans_many; +drop sequence if exists etrans_many_seq; + +drop table if exists evanilla_collection; +drop sequence if exists evanilla_collection_seq; + +drop table if exists evanilla_collection_detail; +drop sequence if exists evanilla_collection_detail_seq; + +drop table if exists ewho_props; +drop sequence if exists ewho_props_seq; + +drop table if exists e_withinet; +drop sequence if exists e_withinet_seq; + +drop table if exists td_child; +drop sequence if exists td_child_seq; + +drop table if exists td_parent; +drop sequence if exists td_parent_seq; + +drop table if exists feature_desc; +drop sequence if exists feature_desc_seq; + +drop table if exists f_first; +drop sequence if exists f_first_seq; + +drop table if exists foo; +drop sequence if exists foo_seq; + +drop table if exists gen_key_identity; + +drop table if exists gen_key_sequence; +drop sequence if exists seq; + +drop table if exists gen_key_table; +drop sequence if exists gen_key_table_seq; + +drop table if exists c_group; +drop sequence if exists c_group_seq; + +drop table if exists imrelated; +drop sequence if exists imrelated_seq; + +drop table if exists imroot; +drop sequence if exists imroot_seq; + +drop table if exists ixresource; + +drop table if exists info_company; +drop sequence if exists info_company_seq; + +drop table if exists info_contact; +drop sequence if exists info_contact_seq; + +drop table if exists info_customer; +drop sequence if exists info_customer_seq; + +drop table if exists inner_report; +drop sequence if exists inner_report_seq; + +drop table if exists drel_invoice; +drop sequence if exists drel_invoice_seq; + +drop table if exists item; + +drop table if exists level1; +drop sequence if exists level1_seq; + +drop table if exists level1_level4; + +drop table if exists level1_level2; + +drop table if exists level2; +drop sequence if exists level2_seq; + +drop table if exists level2_level3; + +drop table if exists level3; +drop sequence if exists level3_seq; + +drop table if exists level4; +drop sequence if exists level4_seq; + +drop table if exists la_attr_value; +drop sequence if exists la_attr_value_seq; + +drop table if exists la_attr_value_attribute; + +drop table if exists mmedia; +drop sequence if exists mmedia_seq; + +drop table if exists non_updateprop; +drop sequence if exists non_updateprop_seq; + +drop table if exists mprinter; +drop sequence if exists mprinter_seq; + +drop table if exists mprinter_state; +drop sequence if exists mprinter_state_seq; + +drop table if exists mprofile; +drop sequence if exists mprofile_seq; + +drop table if exists mprotected_construct_bean; +drop sequence if exists mprotected_construct_bean_seq; + +drop table if exists mrole; +drop sequence if exists mrole_seq; + +drop table if exists mrole_muser; + +drop table if exists msome_other; +drop sequence if exists msome_other_seq; + +drop table if exists muser; +drop sequence if exists muser_seq; + +drop table if exists muser_type; +drop sequence if exists muser_type_seq; + +drop table if exists map_super_actual; +drop sequence if exists map_super_actual_seq; + +drop table if exists c_message; +drop sequence if exists c_message_seq; + +drop table if exists mnoc_role; +drop sequence if exists mnoc_role_seq; + +drop table if exists mnoc_user; +drop sequence if exists mnoc_user_seq; + +drop table if exists mnoc_user_mnoc_role; + +drop table if exists mp_role; +drop sequence if exists mp_role_seq; + +drop table if exists mp_user; +drop sequence if exists mp_user_seq; + +drop table if exists my_lob_size; +drop sequence if exists my_lob_size_seq; + +drop table if exists my_lob_size_join_many; +drop sequence if exists my_lob_size_join_many_seq; + +drop table if exists noidbean; + +drop table if exists o_cached_bean; +drop sequence if exists o_cached_bean_seq; + +drop table if exists o_cached_bean_country; + +drop table if exists o_cached_bean_child; +drop sequence if exists o_cached_bean_child_seq; + +drop table if exists ocar; +drop sequence if exists ocar_seq; + +drop table if exists oengine; + +drop table if exists ogear_box; + +drop table if exists o_order; +drop sequence if exists o_order_seq; + +drop table if exists o_order_detail; +drop sequence if exists o_order_detail_seq; + +drop table if exists s_orders; + +drop table if exists s_order_items; + +drop table if exists or_order_ship; +drop sequence if exists or_order_ship_seq; + +drop table if exists oto_child; +drop sequence if exists oto_child_seq; + +drop table if exists oto_master; +drop sequence if exists oto_master_seq; + +drop table if exists pfile; +drop sequence if exists pfile_seq; + +drop table if exists pfile_content; +drop sequence if exists pfile_content_seq; + +drop table if exists paggview; + +drop table if exists pallet_location; +drop sequence if exists pallet_location_seq; + +drop table if exists parcel; +drop sequence if exists parcel_seq; + +drop table if exists parcel_location; +drop sequence if exists parcel_location_seq; + +drop table if exists rawinherit_parent; +drop sequence if exists rawinherit_parent_seq; + +drop table if exists rawinherit_parent_rawinherit_dat; + +drop table if exists c_participation; +drop sequence if exists c_participation_seq; + +drop table if exists mt_permission; + +drop table if exists persistent_file; +drop sequence if exists persistent_file_seq; + +drop table if exists persistent_file_content; +drop sequence if exists persistent_file_content_seq; + +drop table if exists persons; +drop sequence if exists persons_seq; + +drop table if exists person; +drop sequence if exists person_seq; + +drop table if exists phones; +drop sequence if exists phones_seq; + +drop table if exists o_product; +drop sequence if exists o_product_seq; + +drop table if exists pp; + +drop table if exists pp_to_ww; + +drop table if exists rcustomer; + +drop table if exists r_orders; + +drop table if exists region; + +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 sequence if exists em_role_seq; + +drop table if exists f_second; +drop sequence if exists f_second_seq; + +drop table if exists section; +drop sequence if exists section_seq; + +drop table if exists self_parent; +drop sequence if exists self_parent_seq; + +drop table if exists self_ref_customer; +drop sequence if exists self_ref_customer_seq; + +drop table if exists self_ref_example; +drop sequence if exists self_ref_example_seq; + +drop table if exists some_enum_bean; +drop sequence if exists some_enum_bean_seq; + +drop table if exists some_file_bean; +drop sequence if exists some_file_bean_seq; + +drop table if exists some_new_types_bean; +drop sequence if exists some_new_types_bean_seq; + +drop table if exists some_period_bean; +drop sequence if exists some_period_bean_seq; + +drop table if exists stockforecast; +drop sequence if exists stockforecast_seq; + +drop table if exists sub_section; +drop sequence if exists sub_section_seq; + +drop table if exists sub_type; +drop sequence if exists sub_type_seq; + +drop table if exists tbytes_only; +drop sequence if exists tbytes_only_seq; + +drop table if exists tcar; + +drop table if exists tint_root; +drop sequence if exists tint_root_seq; + +drop table if exists tjoda_entity; +drop sequence if exists tjoda_entity_seq; + +drop table if exists t_mapsuper1; +drop sequence if exists t_mapsuper1_seq; + +drop table if exists t_oneb; +drop sequence if exists t_oneb_seq; + +drop table if exists t_detail_with_other_namexxxyy; +drop sequence if exists t_atable_detail_seq; + +drop table if exists ts_detail_two; +drop sequence if exists ts_detail_two_seq; + +drop table if exists t_atable_thatisrelatively; +drop sequence if exists t_atable_master_seq; + +drop table if exists ts_master_two; +drop sequence if exists ts_master_two_seq; + +drop table if exists tuuid_entity; + +drop table if exists twheel; +drop sequence if exists twheel_seq; + +drop table if exists twith_pre_insert; +drop sequence if exists twith_pre_insert_seq; + +drop table if exists mt_tenant; + +drop table if exists sa_tire; +drop sequence if exists sa_tire_seq; + +drop table if exists tire; +drop sequence if exists tire_seq; + +drop table if exists trip; +drop sequence if exists trip_seq; + +drop table if exists truck_ref; +drop sequence if exists truck_ref_seq; + +drop table if exists type; + +drop table if exists ut_detail; +drop sequence if exists ut_detail_seq; + +drop table if exists ut_master; +drop sequence if exists ut_master_seq; + +drop table if exists uuone; + +drop table if exists uutwo; + +drop table if exists em_user; +drop sequence if exists em_user_seq; + +drop table if exists tx_user; +drop sequence if exists tx_user_seq; + +drop table if exists c_user; +drop sequence if exists c_user_seq; + +drop table if exists oto_user; +drop sequence if exists oto_user_seq; + +drop table if exists em_user_role; + +drop table if exists vehicle; +drop sequence if exists vehicle_seq; + +drop table if exists vehicle_driver; +drop sequence if exists vehicle_driver_seq; + +drop table if exists warehouses; +drop sequence if exists warehouses_seq; + +drop table if exists warehousesshippingzones; + +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 wheel; +drop sequence if exists wheel_seq; + +drop table if exists with_zero; +drop sequence if exists with_zero_seq; + +drop table if exists parent; +drop sequence if exists parent_seq; + +drop table if exists wview; + +drop table if exists zones; +drop sequence if exists zones_seq; + diff --git a/src/test/ddl-review/ms-create.sql b/src/test/ddl-review/ms-create.sql new file mode 100644 index 000000000..0ae653fbe --- /dev/null +++ b/src/test/ddl-review/ms-create.sql @@ -0,0 +1,2074 @@ +create table asimple_bean ( + id numeric(19) identity(1,1) not null, + name varchar(255), + constraint pk_asimple_bean primary key (id) +); + +create table bar ( + bar_type varchar(31) not null, + bar_id integer identity(1,1) not null, + foo_id integer not null, + version integer not null, + constraint pk_bar primary key (bar_id) +); + +create table oto_account ( + id numeric(19) identity(1,1) not null, + name varchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_oto_account primary key (id) +); + +create table o_address ( + id smallint identity(1,1) not null, + line_1 varchar(100), + line_2 varchar(100), + city varchar(100), + cretime datetime2, + country_code varchar(2), + updtime datetime2 not null, + constraint pk_o_address primary key (id) +); + +create table address ( + oid numeric(19) identity(1,1) not null, + street varchar(255), + version integer not null, + constraint pk_address primary key (oid) +); + +create table animals ( + species varchar(31) not null, + id numeric(19) identity(1,1) not null, + shelter_id numeric(19), + version numeric(19) not null, + name varchar(255), + registration_number varchar(255), + date_of_birth date, + constraint pk_animals primary key (id) +); + +create table animal_shelter ( + id numeric(19) identity(1,1) not null, + name varchar(255), + version numeric(19) not null, + constraint pk_animal_shelter primary key (id) +); + +create table article ( + id integer identity(1,1) not null, + name varchar(255), + author varchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_article primary key (id) +); + +create table attribute ( + option_type integer not null, + id integer identity(1,1) 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 table attribute_holder ( + id integer identity(1,1) not null, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_attribute_holder primary key (id) +); + +create table audit_log ( + id numeric(19) identity(1,1) not null, + description varchar(255), + modified_description varchar(255), + constraint pk_audit_log primary key (id) +); + +create table bbookmark ( + id integer identity(1,1) not null, + bookmark_reference varchar(255), + user_id integer, + constraint pk_bbookmark primary key (id) +); + +create table bbookmark_user ( + id integer identity(1,1) not null, + name varchar(255), + password varchar(255), + email_address varchar(255), + country varchar(255), + constraint pk_bbookmark_user primary key (id) +); + +create table bsimple_with_gen ( + id integer identity(1,1) not null, + name varchar(255), + constraint pk_bsimple_with_gen primary key (id) +); + +create table bwith_qident ( + id integer identity(1,1) not null, + [Name] varchar(255), + last_updated datetime2 not null, + constraint uq_bwith_qident_name unique ([Name]), + constraint pk_bwith_qident primary key (id) +); + +create table basic_joda_entity ( + id numeric(19) identity(1,1) not null, + name varchar(255), + created datetime2 not null, + updated datetime2 not null, + version datetime2 not null, + constraint pk_basic_joda_entity primary key (id) +); + +create table bean_with_time_zone ( + id numeric(19) identity(1,1) not null, + name varchar(255), + timezone varchar(20), + constraint pk_bean_with_time_zone primary key (id) +); + +create table drel_booking ( + id numeric(19) identity(1,1) not null, + 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_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 table ckey_assoc ( + id integer identity(1,1) not null, + assoc_one varchar(255), + constraint pk_ckey_assoc primary key (id) +); + +create table ckey_detail ( + id integer identity(1,1) not null, + something varchar(255), + one_key integer, + two_key varchar(255), + constraint pk_ckey_detail primary key (id) +); + +create table ckey_parent ( + one_key integer not null, + two_key varchar(255) not null, + name varchar(255), + assoc_id integer, + version integer not null, + constraint pk_ckey_parent primary key (one_key,two_key) +); + +create table calculation_result ( + id integer identity(1,1) not null, + charge float(32), + 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 numeric(19) not null, + constraint pk_cao_bean primary key (x_cust_id,x_type_id) +); + +create table sa_car ( + id numeric(19) identity(1,1) not null, + version integer not null, + constraint pk_sa_car primary key (id) +); + +create table sp_car_car ( + id numeric(19) identity(1,1) not null, + version integer not null, + constraint pk_sp_car_car primary key (id) +); + +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 car_accessory ( + id integer identity(1,1) not null, + name varchar(255), + car_id integer, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_car_accessory primary key (id) +); + +create table configuration ( + type varchar(31) not null, + id integer identity(1,1) 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 identity(1,1) not null, + name varchar(255), + constraint pk_configurations primary key (id) +); + +create table contact ( + id integer identity(1,1) not null, + first_name varchar(255), + last_name varchar(255), + phone varchar(255), + mobile varchar(255), + email varchar(255), + customer_id integer not null, + group_id integer, + cretime datetime2 not null, + updtime datetime2 not null, + constraint pk_contact primary key (id) +); + +create table contact_group ( + id integer identity(1,1) not null, + name varchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_contact_group primary key (id) +); + +create table contact_note ( + id integer identity(1,1) not null, + contact_id integer, + title varchar(255), + note text, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_contact_note primary key (id) +); + +create table c_conversation ( + id numeric(19) identity(1,1) not null, + title varchar(255), + isopen bit default 0, + 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 table o_country ( + code varchar(2) not null, + name varchar(60), + constraint pk_o_country primary key (code) +); + +create table o_customer ( + id integer identity(1,1) not null, + status varchar(1), + name varchar(40) not null, + smallnote varchar(100), + anniversary date, + billing_address_id smallint, + shipping_address_id smallint, + 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 table dexh_entity ( + oid numeric(19) identity(1,1) not null, + exhange_rate numeric(38), + exhange_cmoney_amount numeric(38), + exhange_cmoney_currency varchar(3), + last_updated datetime2 not null, + constraint pk_dexh_entity primary key (oid) +); + +create table dperson ( + id numeric(19) identity(1,1) not null, + first_name varchar(255), + last_name varchar(255), + salary numeric(38), + a_amt numeric(38), + a_curr varchar(3), + i_start datetime2, + i_end datetime2, + constraint pk_dperson primary key (id) +); + +create table rawinherit_data ( + id numeric(19) identity(1,1) not null, + val integer, + constraint pk_rawinherit_data primary key (id) +); + +create table e_basic ( + id integer identity(1,1) not null, + status varchar(1), + name varchar(255), + description varchar(255), + some_date datetime2, + constraint ck_e_basic_status check (status in ('N','A','I')), + constraint pk_e_basic primary key (id) +); + +create table ebasic_clob ( + id numeric(19) identity(1,1) not null, + name varchar(255), + title varchar(255), + description text, + last_update datetime2 not null, + constraint pk_ebasic_clob primary key (id) +); + +create table ebasic_clob_fetch_eager ( + id numeric(19) identity(1,1) not null, + name varchar(255), + title varchar(255), + description text, + last_update datetime2 not null, + constraint pk_ebasic_clob_fetch_eager primary key (id) +); + +create table ebasic_clob_no_ver ( + id numeric(19) identity(1,1) not null, + name varchar(255), + description text, + constraint pk_ebasic_clob_no_ver primary key (id) +); + +create table e_basicenc ( + id integer identity(1,1) not null, + name varchar(255), + description varbinary(80), + dob varbinary(20), + last_update datetime2, + constraint pk_e_basicenc primary key (id) +); + +create table e_basicenc_bin ( + id integer identity(1,1) not null, + name varchar(255), + description varchar(255), + data image, + some_time varbinary(255), + last_update datetime2 not null, + constraint pk_e_basicenc_bin 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 ebasic_json_map ( + id numeric(19) identity(1,1) not null, + name varchar(255), + content text, + version numeric(19) not null, + constraint pk_ebasic_json_map primary key (id) +); + +create table ebasic_json_map_blob ( + id numeric(19) identity(1,1) not null, + name varchar(255), + content image, + version numeric(19) not null, + constraint pk_ebasic_json_map_blob primary key (id) +); + +create table ebasic_json_map_clob ( + id numeric(19) identity(1,1) not null, + name varchar(255), + content text, + version numeric(19) not null, + constraint pk_ebasic_json_map_clob primary key (id) +); + +create table ebasic_json_map_json_b ( + id numeric(19) identity(1,1) not null, + name varchar(255), + content text, + version numeric(19) not null, + constraint pk_ebasic_json_map_json_b primary key (id) +); + +create table ebasic_json_map_varchar ( + id numeric(19) identity(1,1) not null, + name varchar(255), + content varchar(3000), + version numeric(19) not null, + constraint pk_ebasic_json_map_varchar primary key (id) +); + +create table ebasic_json_node ( + id numeric(19) identity(1,1) not null, + name varchar(255), + content text, + version numeric(19) not null, + constraint pk_ebasic_json_node primary key (id) +); + +create table ebasic_json_node_blob ( + id numeric(19) identity(1,1) not null, + name varchar(255), + content image, + version numeric(19) not null, + constraint pk_ebasic_json_node_blob primary key (id) +); + +create table ebasic_json_node_json_b ( + id numeric(19) identity(1,1) not null, + name varchar(255), + content text, + version numeric(19) not null, + constraint pk_ebasic_json_node_json_b primary key (id) +); + +create table ebasic_json_node_varchar ( + id numeric(19) identity(1,1) not null, + name varchar(255), + content varchar(1000), + version numeric(19) not null, + constraint pk_ebasic_json_node_varchar primary key (id) +); + +create table e_basic_ndc ( + id integer identity(1,1) not null, + name varchar(255), + constraint pk_e_basic_ndc primary key (id) +); + +create table e_basicver ( + id integer identity(1,1) not null, + name varchar(255), + description varchar(255), + other varchar(255), + last_update datetime2 not null, + constraint pk_e_basicver primary key (id) +); + +create table e_basic_withlife ( + id numeric(19) identity(1,1) not null, + name varchar(255), + version numeric(19) not null, + constraint pk_e_basic_withlife primary key (id) +); + +create table e_basicverucon ( + id integer identity(1,1) not null, + name varchar(255), + other varchar(255), + other_one varchar(255), + description varchar(255), + last_update datetime2 not null, + constraint uq_e_basicverucon_name unique (name), + constraint pk_e_basicverucon primary key (id) +); + +create table eemb_inner ( + id integer identity(1,1) 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 identity(1,1) not null, + nome_outer varchar(255), + date1 datetime2, + date2 datetime2, + update_count integer not null, + constraint pk_eemb_outer primary key (id) +); + +create table egen_props ( + id numeric(19) identity(1,1) not null, + name varchar(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, + long_created numeric(19) not null, + long_updated numeric(19) not null, + constraint pk_egen_props primary key (id) +); + +create table einvoice ( + id numeric(19) identity(1,1) not null, + invoice_date datetime2, + state integer, + person_id numeric(19), + ship_street varchar(255), + ship_suburb varchar(255), + ship_city varchar(255), + street varchar(255), + suburb varchar(255), + city varchar(255), + version numeric(19) not null, + constraint ck_einvoice_state check (state in (0,1,2)), + constraint pk_einvoice primary key (id) +); + +create table e_main ( + id integer identity(1,1) not null, + name varchar(255), + description varchar(255), + version numeric(19) not null, + constraint pk_e_main primary key (id) +); + +create table enull_collection ( + id integer identity(1,1) not null, + name varchar(255), + constraint pk_enull_collection primary key (id) +); + +create table enull_collection_detail ( + id integer identity(1,1) 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 identity(1,1) not null, + name_for_a varchar(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 table eopt_one_b ( + id integer identity(1,1) not null, + name_for_b varchar(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 table eopt_one_c ( + id integer identity(1,1) not null, + name_for_c varchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_eopt_one_c primary key (id) +); + +create table eperson ( + id numeric(19) identity(1,1) not null, + name varchar(255), + notes varchar(255), + street varchar(255), + suburb varchar(255), + city varchar(255), + version numeric(19) not null, + constraint pk_eperson primary key (id) +); + +create table esimple ( + usertypeid integer identity(1,1) not null, + name varchar(255), + constraint pk_esimple primary key (usertypeid) +); + +create table esome_type ( + id integer identity(1,1) 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 identity(1,1) not null, + name varchar(255), + constraint pk_etrans_many primary key (id) +); + +create table evanilla_collection ( + id integer identity(1,1) not null, + name varchar(255), + constraint pk_evanilla_collection primary key (id) +); + +create table evanilla_collection_detail ( + id integer identity(1,1) not null, + evanilla_collection_id integer not null, + something varchar(255), + constraint pk_evanilla_collection_detail primary key (id) +); + +create table ewho_props ( + id numeric(19) identity(1,1) not null, + name varchar(255), + who_created varchar(255) not null, + who_modified varchar(255) not null, + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_ewho_props primary key (id) +); + +create table e_withinet ( + id numeric(19) identity(1,1) not null, + name varchar(255), + inet_address varchar(50), + version numeric(19) not null, + constraint pk_e_withinet primary key (id) +); + +create table td_child ( + child_id integer identity(1,1) 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 identity(1,1) not null, + parent_name varchar(255), + extended_name varchar(255), + constraint pk_td_parent primary key (parent_id) +); + +create table feature_desc ( + id integer identity(1,1) not null, + name varchar(255), + description varchar(255), + constraint pk_feature_desc primary key (id) +); + +create table f_first ( + id numeric(19) identity(1,1) not null, + name varchar(255), + constraint pk_f_first primary key (id) +); + +create table foo ( + foo_id integer identity(1,1) not null, + important_text varchar(255), + version integer not null, + constraint pk_foo primary key (foo_id) +); + +create table gen_key_identity ( + id numeric(19) identity(1,1) not null, + description varchar(255), + constraint pk_gen_key_identity primary key (id) +); + +create table gen_key_sequence ( + id numeric(19) identity(1,1) not null, + description varchar(255), + constraint pk_gen_key_sequence primary key (id) +); + +create table gen_key_table ( + id numeric(19) identity(1,1) not null, + description varchar(255), + constraint pk_gen_key_table primary key (id) +); + +create table c_group ( + id numeric(19) identity(1,1) not null, + inactive bit default 0, + name varchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_c_group primary key (id) +); + +create table imrelated ( + id numeric(19) identity(1,1) not null, + name varchar(255), + owner_id numeric(19) not null, + constraint pk_imrelated primary key (id) +); + +create table imroot ( + dtype varchar(10) not null, + id numeric(19) identity(1,1) not null, + title varchar(255), + when_title datetime2, + name varchar(255), + constraint pk_imroot primary key (id) +); + +create table ixresource ( + dtype varchar(255), + id binary(16) not null, + name varchar(255), + constraint pk_ixresource primary key (id) +); + +create table info_company ( + id numeric(19) identity(1,1) not null, + name varchar(255), + version numeric(19) not null, + constraint pk_info_company primary key (id) +); + +create table info_contact ( + id numeric(19) identity(1,1) not null, + name varchar(255), + company_id numeric(19) not null, + version numeric(19) not null, + constraint pk_info_contact primary key (id) +); + +create table info_customer ( + id numeric(19) identity(1,1) not null, + name varchar(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 table inner_report ( + id numeric(19) identity(1,1) not null, + name varchar(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 table drel_invoice ( + id numeric(19) identity(1,1) not null, + booking numeric(19), + version integer not null, + constraint pk_drel_invoice primary key (id) +); + +create table item ( + customer integer not null, + itemnumber varchar(255) not null, + description varchar(255), + units varchar(255), + type integer, + region integer, + date_modified datetime2, + date_created datetime2, + modified_by varchar(255), + created_by varchar(255), + version numeric(19) not null, + constraint pk_item primary key (customer,itemnumber) +); + +create table level1 ( + id numeric(19) identity(1,1) not null, + name varchar(255), + constraint pk_level1 primary key (id) +); + +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) identity(1,1) not null, + name varchar(255), + constraint pk_level2 primary key (id) +); + +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) identity(1,1) not null, + name varchar(255), + constraint pk_level3 primary key (id) +); + +create table level4 ( + id numeric(19) identity(1,1) not null, + name varchar(255), + constraint pk_level4 primary key (id) +); + +create table la_attr_value ( + id integer identity(1,1) not null, + name varchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) 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 mmedia ( + type varchar(31) not null, + id numeric(19) identity(1,1) not null, + url varchar(255), + note varchar(255), + constraint pk_mmedia primary key (id) +); + +create table non_updateprop ( + id integer identity(1,1) 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 numeric(19) identity(1,1) not null, + name varchar(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_2 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 table mprinter_state ( + id numeric(19) identity(1,1) not null, + flags numeric(19), + printer_id numeric(19), + version numeric(19) not null, + constraint pk_mprinter_state primary key (id) +); + +create table mprofile ( + id numeric(19) identity(1,1) not null, + picture_id numeric(19), + name varchar(255), + constraint pk_mprofile primary key (id) +); + +create table mprotected_construct_bean ( + id numeric(19) identity(1,1) not null, + name varchar(255), + constraint pk_mprotected_construct_bean primary key (id) +); + +create table mrole ( + roleid integer identity(1,1) 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 numeric(19) identity(1,1) not null, + name varchar(255), + constraint pk_msome_other primary key (id) +); + +create table muser ( + userid integer identity(1,1) not null, + user_name varchar(255), + user_type_id integer, + constraint pk_muser primary key (userid) +); + +create table muser_type ( + id integer identity(1,1) not null, + name varchar(255), + constraint pk_muser_type primary key (id) +); + +create table map_super_actual ( + id numeric(19) identity(1,1) not null, + name varchar(255), + when_created datetime2 not null, + when_updated datetime2 not null, + constraint pk_map_super_actual primary key (id) +); + +create table c_message ( + id numeric(19) identity(1,1) not null, + title varchar(255), + body varchar(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 table mnoc_role ( + role_id integer identity(1,1) 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 identity(1,1) 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 mp_role ( + id numeric(19) identity(1,1) not null, + mp_user_id numeric(19) not null, + code varchar(255), + organization_id numeric(19), + constraint pk_mp_role primary key (id) +); + +create table mp_user ( + id numeric(19) identity(1,1) not null, + name varchar(255), + constraint pk_mp_user primary key (id) +); + +create table my_lob_size ( + id integer identity(1,1) not null, + name varchar(255), + my_count integer, + my_lob text, + constraint pk_my_lob_size primary key (id) +); + +create table my_lob_size_join_many ( + id integer identity(1,1) 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 datetime2 not null +); + +create table o_cached_bean ( + id numeric(19) identity(1,1) not null, + name varchar(255), + constraint pk_o_cached_bean primary key (id) +); + +create table o_cached_bean_country ( + o_cached_bean_id numeric(19) 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 numeric(19) identity(1,1) not null, + cached_bean_id numeric(19), + constraint pk_o_cached_bean_child primary key (id) +); + +create table ocar ( + id integer identity(1,1) not null, + vin varchar(255), + name varchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_ocar primary key (id) +); + +create table oengine ( + engine_id binary(16) not null, + short_desc varchar(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 binary(16) not null, + box_desc varchar(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 o_order ( + id integer identity(1,1) 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 table o_order_detail ( + id integer identity(1,1) not null, + order_id integer, + 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 table s_orders ( + uuid varchar(255) not null, + constraint pk_s_orders primary key (uuid) +); + +create table s_order_items ( + uuid varchar(255) not null, + product_variant_uuid varchar(255), + order_uuid varchar(255), + quantity integer, + amount numeric(38), + constraint pk_s_order_items primary key (uuid) +); + +create table or_order_ship ( + id integer identity(1,1) 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 table oto_child ( + id integer identity(1,1) not null, + name varchar(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 table oto_master ( + id numeric(19) identity(1,1) not null, + name varchar(255), + constraint pk_oto_master primary key (id) +); + +create table pfile ( + id integer identity(1,1) not null, + name varchar(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 table pfile_content ( + id integer identity(1,1) 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 table paggview ( + pview_id binary(16), + 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 varchar(31) not null, + id integer identity(1,1) not null, + zone_sid integer not null, + attribute varchar(255), + constraint pk_pallet_location primary key (id) +); + +create table parcel ( + parcelid numeric(19) identity(1,1) not null, + description varchar(255), + constraint pk_parcel primary key (parcelid) +); + +create table parcel_location ( + parcellocid numeric(19) identity(1,1) not null, + location varchar(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 table rawinherit_parent ( + type varchar(31) not null, + id numeric(19) identity(1,1) not null, + val integer, + constraint pk_rawinherit_parent primary key (id) +); + +create table rawinherit_parent_rawinherit_dat ( + rawinherit_parent_id numeric(19) not null, + rawinherit_data_id numeric(19) not null, + constraint pk_rawinherit_parent_rawinher_0 primary key (rawinherit_parent_id,rawinherit_data_id) +); + +create table c_participation ( + id numeric(19) identity(1,1) 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 table mt_permission ( + id binary(16) not null, + name varchar(255), + constraint pk_mt_permission primary key (id) +); + +create table persistent_file ( + id integer identity(1,1) not null, + name varchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_persistent_file primary key (id) +); + +create table persistent_file_content ( + id integer identity(1,1) 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_pe_1 on persistent_file_content(persistent_file_id) where persistent_file_id is not null; + +create table persons ( + id numeric(19) identity(1,1) not null, + surname varchar(64) not null, + name varchar(64) not null, + constraint pk_persons primary key (id) +); + +create table person ( + oid numeric(19) identity(1,1) not null, + default_address_oid numeric(19), + version integer not null, + constraint pk_person primary key (oid) +); + +create table phones ( + id numeric(19) identity(1,1) not null, + phone_number varchar(7) not null, + person_id numeric(19) not null, + constraint uq_phones_phone_number unique (phone_number), + constraint pk_phones primary key (id) +); + +create table o_product ( + id integer identity(1,1) not null, + sku varchar(20), + name varchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + constraint pk_o_product primary key (id) +); + +create table pp ( + id binary(16) not null, + name varchar(255), + value varchar(100) not null, + constraint pk_pp primary key (id) +); + +create table pp_to_ww ( + pp_id binary(16) not null, + ww_id binary(16) not null, + constraint pk_pp_to_ww primary key (pp_id,ww_id) +); + +create table rcustomer ( + company varchar(255) not null, + name varchar(255) not null, + description varchar(255), + constraint pk_rcustomer primary key (company,name) +); + +create table r_orders ( + company varchar(255) not null, + order_number integer not null, + customername varchar(255), + item varchar(255), + constraint pk_r_orders primary key (company,order_number) +); + +create table region ( + customer integer not null, + type integer not null, + description varchar(255), + version numeric(19) not null, + constraint pk_region primary key (customer,type) +); + +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 binary(16) not null, + name varchar(50), + tenant_id binary(16), + version numeric(19) not null, + constraint pk_mt_role primary key (id) +); + +create table mt_role_permission ( + mt_role_id binary(16) not null, + mt_permission_id binary(16) not null, + constraint pk_mt_role_permission primary key (mt_role_id,mt_permission_id) +); + +create table em_role ( + id numeric(19) identity(1,1) not null, + name varchar(255), + constraint pk_em_role primary key (id) +); + +create table f_second ( + id numeric(19) identity(1,1) not null, + first numeric(19), + title varchar(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 table section ( + id integer identity(1,1) not null, + article_id integer, + type integer, + content text, + 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 table self_parent ( + id numeric(19) identity(1,1) not null, + name varchar(255), + parent_id numeric(19), + version numeric(19) not null, + constraint pk_self_parent primary key (id) +); + +create table self_ref_customer ( + id numeric(19) identity(1,1) not null, + name varchar(255), + referred_by_id numeric(19), + constraint pk_self_ref_customer primary key (id) +); + +create table self_ref_example ( + id numeric(19) identity(1,1) not null, + name varchar(255) not null, + parent_id numeric(19), + constraint pk_self_ref_example primary key (id) +); + +create table some_enum_bean ( + id numeric(19) identity(1,1) 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 numeric(19) identity(1,1) not null, + name varchar(255), + content image, + version numeric(19) not null, + constraint pk_some_file_bean primary key (id) +); + +create table some_new_types_bean ( + id numeric(19) identity(1,1) not null, + dow integer, + mth integer, + yr integer, + yr_mth date, + local_date date, + local_date_time datetime2, + offset_date_time datetime2, + zoned_date_time datetime2, + instant datetime2, + zone_id varchar(60), + zone_offset varchar(60), + 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 table some_period_bean ( + id numeric(19) identity(1,1) not null, + period_years integer, + period_months integer, + period_days integer, + anniversary date, + version numeric(19) not null, + constraint pk_some_period_bean primary key (id) +); + +create table stockforecast ( + type varchar(31) not null, + id numeric(19) identity(1,1) not null, + inner_report_id numeric(19), + constraint pk_stockforecast primary key (id) +); + +create table sub_section ( + id integer identity(1,1) not null, + section_id integer, + title varchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_sub_section primary key (id) +); + +create table sub_type ( + sub_type_id integer identity(1,1) not null, + description varchar(255), + version numeric(19) not null, + constraint pk_sub_type primary key (sub_type_id) +); + +create table tbytes_only ( + id integer identity(1,1) not null, + content image, + constraint pk_tbytes_only primary key (id) +); + +create table tcar ( + type varchar(31) not null, + plate_no varchar(255) not null, + truckload numeric(19), + constraint pk_tcar primary key (plate_no) +); + +create table tint_root ( + my_type integer not null, + id integer identity(1,1) not null, + name varchar(255), + child_property varchar(255), + constraint pk_tint_root primary key (id) +); + +create table tjoda_entity ( + id integer identity(1,1) not null, + local_time time, + constraint pk_tjoda_entity primary key (id) +); + +create table t_mapsuper1 ( + id integer identity(1,1) 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 identity(1,1) not null, + name varchar(255), + description varchar(255), + active bit default 0, + constraint pk_t_oneb primary key (id) +); + +create table t_detail_with_other_namexxxyy ( + id integer identity(1,1) not null, + name varchar(255), + description varchar(255), + active bit default 0, + master_id integer, + constraint pk_t_detail_with_other_namexx_0 primary key (id) +); + +create table ts_detail_two ( + id integer identity(1,1) not null, + name varchar(255), + description varchar(255), + active bit default 0, + master_id integer, + constraint pk_ts_detail_two primary key (id) +); + +create table t_atable_thatisrelatively ( + id integer identity(1,1) not null, + name varchar(255), + description varchar(255), + active bit default 0, + constraint pk_t_atable_thatisrelatively primary key (id) +); + +create table ts_master_two ( + id integer identity(1,1) not null, + name varchar(255), + description varchar(255), + active bit default 0, + constraint pk_ts_master_two primary key (id) +); + +create table tuuid_entity ( + id binary(16) not null, + name varchar(255), + constraint pk_tuuid_entity primary key (id) +); + +create table twheel ( + id numeric(19) identity(1,1) not null, + owner_plate_no varchar(255) not null, + constraint pk_twheel primary key (id) +); + +create table twith_pre_insert ( + id integer identity(1,1) not null, + name varchar(255) not null, + title varchar(255), + constraint pk_twith_pre_insert primary key (id) +); + +create table mt_tenant ( + id binary(16) not null, + name varchar(255), + version numeric(19) not null, + constraint pk_mt_tenant primary key (id) +); + +create table sa_tire ( + id numeric(19) identity(1,1) not null, + version integer not null, + constraint pk_sa_tire primary key (id) +); + +create table tire ( + id numeric(19) identity(1,1) 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 table trip ( + id integer identity(1,1) not null, + vehicle_driver_id integer, + destination varchar(255), + address_id smallint, + star_date datetime2, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_trip primary key (id) +); + +create table truck_ref ( + id integer identity(1,1) not null, + something varchar(255), + constraint pk_truck_ref primary key (id) +); + +create table type ( + customer integer not null, + type integer not null, + description varchar(255), + sub_type_id integer, + version numeric(19) not null, + constraint pk_type primary key (customer,type) +); + +create table ut_detail ( + id integer identity(1,1) not null, + utmaster_id integer not null, + name varchar(255), + qty integer, + amount float(32), + version integer not null, + constraint pk_ut_detail primary key (id) +); + +create table ut_master ( + id integer identity(1,1) not null, + name varchar(255), + description varchar(255), + version integer not null, + constraint pk_ut_master primary key (id) +); + +create table uuone ( + id binary(16) not null, + name varchar(255), + constraint pk_uuone primary key (id) +); + +create table uutwo ( + id binary(16) not null, + name varchar(255), + master_id binary(16), + constraint pk_uutwo primary key (id) +); + +create table em_user ( + id numeric(19) identity(1,1) not null, + name varchar(255), + constraint pk_em_user primary key (id) +); + +create table tx_user ( + id numeric(19) identity(1,1) not null, + name varchar(255), + constraint pk_tx_user primary key (id) +); + +create table c_user ( + id numeric(19) identity(1,1) not null, + inactive bit default 0, + name varchar(255), + email varchar(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 table oto_user ( + id numeric(19) identity(1,1) not null, + name varchar(255), + account_id numeric(19) not null, + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_oto_user primary key (id) +); +create unique nonclustered index uq_oto_user_account_id on oto_user(account_id) where account_id is not null; + +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 varchar(3) not null, + id integer identity(1,1) not null, + license_number varchar(255), + registration_date datetime2, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + truck_ref_id integer, + capacity float(32), + driver varchar(255), + car_ref_id integer, + constraint pk_vehicle primary key (id) +); + +create table vehicle_driver ( + id integer identity(1,1) not null, + name varchar(255), + vehicle_id integer, + address_id smallint, + 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 table warehouses ( + id integer identity(1,1) 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 sa_wheel ( + id numeric(19) identity(1,1) not null, + tire numeric(19), + car numeric(19), + version integer not null, + constraint pk_sa_wheel primary key (id) +); + +create table sp_car_wheel ( + id numeric(19) identity(1,1) not null, + version integer not null, + constraint pk_sp_car_wheel primary key (id) +); + +create table wheel ( + id numeric(19) identity(1,1) not null, + version integer not null, + constraint pk_wheel primary key (id) +); + +create table with_zero ( + id numeric(19) identity(1,1) not null, + name varchar(255), + parent_id integer, + version numeric(19) not null, + constraint pk_with_zero primary key (id) +); + +create table parent ( + id integer identity(1,1) not null, + name varchar(255), + constraint pk_parent primary key (id) +); + +create table wview ( + id binary(16) not null, + name varchar(255) not null, + constraint uq_wview_name unique (name), + constraint pk_wview primary key (id) +); + +create table zones ( + type varchar(31) not null, + id integer identity(1,1) not null, + attribute varchar(255), + constraint pk_zones primary key (id) +); + +alter table bar add constraint fk_bar_foo_id foreign key (foo_id) references foo (foo_id); +create index ix_bar_foo_id on bar (foo_id); + +alter table o_address add constraint fk_o_address_country_code foreign key (country_code) references o_country (code); +create index ix_o_address_country_code on o_address (country_code); + +alter table animals add constraint fk_animals_shelter_id foreign key (shelter_id) references animal_shelter (id); +create index ix_animals_shelter_id on animals (shelter_id); + +alter table attribute add constraint fk_attribute_attribute_holder_1 foreign key (attribute_holder_id) references attribute_holder (id); +create index ix_attribute_attribute_holder_1 on attribute (attribute_holder_id); + +alter table bbookmark add constraint fk_bbookmark_user_id foreign key (user_id) references bbookmark_user (id); +create index ix_bbookmark_user_id on bbookmark (user_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); + +alter table ckey_detail add constraint fk_ckey_detail_ckey_parent foreign key (one_key,two_key) references ckey_parent (one_key,two_key); +create index ix_ckey_detail_one_key_two_key on ckey_detail (one_key,two_key); + +alter table ckey_parent add constraint fk_ckey_parent_assoc_id foreign key (assoc_id) references ckey_assoc (id); +create index ix_ckey_parent_assoc_id on ckey_parent (assoc_id); + +alter table calculation_result add constraint fk_calculation_result_product_1 foreign key (product_configuration_id) references configuration (id); +create index ix_calculation_result_product_1 on calculation_result (product_configuration_id); + +alter table calculation_result add constraint fk_calculation_result_group_c_2 foreign key (group_configuration_id) references configuration (id); +create index ix_calculation_result_group_c_2 on calculation_result (group_configuration_id); + +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_car on sp_car_car_wheels (car); + +alter table sp_car_car_wheels add constraint fk_sp_car_car_wheels_sp_car_w_2 foreign key (wheel) references sp_car_wheel (id); +create index ix_sp_car_car_wheels_wheel on sp_car_car_wheels (wheel); + +alter table car_accessory add constraint fk_car_accessory_car_id foreign key (car_id) references vehicle (id); +create index ix_car_accessory_car_id on car_accessory (car_id); + +alter table configuration add constraint fk_configuration_configuratio_1 foreign key (configurations_id) references configurations (id); +create index ix_configuration_configuratio_1 on configuration (configurations_id); + +alter table contact add constraint fk_contact_customer_id foreign key (customer_id) references o_customer (id); +create index ix_contact_customer_id on contact (customer_id); + +alter table contact add constraint fk_contact_group_id foreign key (group_id) references contact_group (id); +create index ix_contact_group_id on contact (group_id); + +alter table contact_note add constraint fk_contact_note_contact_id foreign key (contact_id) references contact (id); +create index ix_contact_note_contact_id on contact_note (contact_id); + +alter table c_conversation add constraint fk_c_conversation_group_id foreign key (group_id) references c_group (id); +create index ix_c_conversation_group_id on c_conversation (group_id); + +alter table o_customer add constraint fk_o_customer_billing_address_1 foreign key (billing_address_id) references o_address (id); +create index ix_o_customer_billing_address_1 on o_customer (billing_address_id); + +alter table o_customer add constraint fk_o_customer_shipping_addres_2 foreign key (shipping_address_id) references o_address (id); +create index ix_o_customer_shipping_addres_2 on o_customer (shipping_address_id); + +alter table eemb_inner add constraint fk_eemb_inner_outer_id foreign key (outer_id) references eemb_outer (id); +create index ix_eemb_inner_outer_id on eemb_inner (outer_id); + +alter table einvoice add constraint fk_einvoice_person_id foreign key (person_id) references eperson (id); +create index ix_einvoice_person_id on einvoice (person_id); + +alter table enull_collection_detail add constraint fk_enull_collection_detail_en_1 foreign key (enull_collection_id) references enull_collection (id); +create index ix_enull_collection_detail_en_1 on enull_collection_detail (enull_collection_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_a_b_id on eopt_one_a (b_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_eopt_one_b_c_id on eopt_one_b (c_id); + +alter table evanilla_collection_detail add constraint fk_evanilla_collection_detail_1 foreign key (evanilla_collection_id) references evanilla_collection (id); +create index ix_evanilla_collection_detail_1 on evanilla_collection_detail (evanilla_collection_id); + +alter table td_child add constraint fk_td_child_parent_id foreign key (parent_id) references td_parent (parent_id); +create index ix_td_child_parent_id on td_child (parent_id); + +alter table imrelated add constraint fk_imrelated_owner_id foreign key (owner_id) references imroot (id); +create index ix_imrelated_owner_id on imrelated (owner_id); + +alter table info_contact add constraint fk_info_contact_company_id foreign key (company_id) references info_company (id); +create index ix_info_contact_company_id on info_contact (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); + +alter table drel_invoice add constraint fk_drel_invoice_booking foreign key (booking) references drel_booking (id); +create index ix_drel_invoice_booking on drel_invoice (booking); + +alter table item add constraint fk_item_type foreign key (customer,type) references type (customer,type); +create index ix_item_customer_type on item (customer,type); + +alter table item add constraint fk_item_region foreign key (customer,region) references region (customer,type); +create index ix_item_customer_region on item (customer,region); + +alter table level1_level4 add constraint fk_level1_level4_level1 foreign key (level1_id) references level1 (id); +create index ix_level1_level4_level1_id on level1_level4 (level1_id); + +alter table level1_level4 add constraint fk_level1_level4_level4 foreign key (level4_id) references level4 (id); +create index ix_level1_level4_level4_id on level1_level4 (level4_id); + +alter table level1_level2 add constraint fk_level1_level2_level1 foreign key (level1_id) references level1 (id); +create index ix_level1_level2_level1_id on level1_level2 (level1_id); + +alter table level1_level2 add constraint fk_level1_level2_level2 foreign key (level2_id) references level2 (id); +create index ix_level1_level2_level2_id on level1_level2 (level2_id); + +alter table level2_level3 add constraint fk_level2_level3_level2 foreign key (level2_id) references level2 (id); +create index ix_level2_level3_level2_id on level2_level3 (level2_id); + +alter table level2_level3 add constraint fk_level2_level3_level3 foreign key (level3_id) references level3 (id); +create index ix_level2_level3_level3_id on level2_level3 (level3_id); + +alter table la_attr_value_attribute add constraint fk_la_attr_value_attribute_la_1 foreign key (la_attr_value_id) references la_attr_value (id); +create index ix_la_attr_value_attribute_la_1 on la_attr_value_attribute (la_attr_value_id); + +alter table la_attr_value_attribute add constraint fk_la_attr_value_attribute_at_2 foreign key (attribute_id) references attribute (id); +create index ix_la_attr_value_attribute_at_2 on la_attr_value_attribute (attribute_id); + +alter table mprinter add constraint fk_mprinter_current_state_id foreign key (current_state_id) references mprinter_state (id); +create index ix_mprinter_current_state_id on mprinter (current_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_3 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); + +alter table mprinter_state add constraint fk_mprinter_state_printer_id foreign key (printer_id) references mprinter (id); +create index ix_mprinter_state_printer_id on mprinter_state (printer_id); + +alter table mprofile add constraint fk_mprofile_picture_id foreign key (picture_id) references mmedia (id); +create index ix_mprofile_picture_id on mprofile (picture_id); + +alter table mrole_muser add constraint fk_mrole_muser_mrole foreign key (mrole_roleid) references mrole (roleid); +create index ix_mrole_muser_mrole_roleid on mrole_muser (mrole_roleid); + +alter table mrole_muser add constraint fk_mrole_muser_muser foreign key (muser_userid) references muser (userid); +create index ix_mrole_muser_muser_userid on mrole_muser (muser_userid); + +alter table muser add constraint fk_muser_user_type_id foreign key (user_type_id) references muser_type (id); +create index ix_muser_user_type_id on muser (user_type_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_conversation_id on c_message (conversation_id); + +alter table c_message add constraint fk_c_message_user_id foreign key (user_id) references c_user (id); +create index ix_c_message_user_id on c_message (user_id); + +alter table mnoc_user_mnoc_role add constraint fk_mnoc_user_mnoc_role_mnoc_u_1 foreign key (mnoc_user_user_id) references mnoc_user (user_id); +create index ix_mnoc_user_mnoc_role_mnoc_u_1 on mnoc_user_mnoc_role (mnoc_user_user_id); + +alter table mnoc_user_mnoc_role add constraint fk_mnoc_user_mnoc_role_mnoc_r_2 foreign key (mnoc_role_role_id) references mnoc_role (role_id); +create index ix_mnoc_user_mnoc_role_mnoc_r_2 on mnoc_user_mnoc_role (mnoc_role_role_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_mp_role_mp_user_id on mp_role (mp_user_id); + +alter table my_lob_size_join_many add constraint fk_my_lob_size_join_many_pare_1 foreign key (parent_id) references my_lob_size (id); +create index ix_my_lob_size_join_many_pare_1 on my_lob_size_join_many (parent_id); + +alter table o_cached_bean_country add constraint fk_o_cached_bean_country_o_ca_1 foreign key (o_cached_bean_id) references o_cached_bean (id); +create index ix_o_cached_bean_country_o_ca_1 on o_cached_bean_country (o_cached_bean_id); + +alter table o_cached_bean_country add constraint fk_o_cached_bean_country_o_co_2 foreign key (o_country_code) references o_country (code); +create index ix_o_cached_bean_country_o_co_2 on o_cached_bean_country (o_country_code); + +alter table o_cached_bean_child add constraint fk_o_cached_bean_child_cached_1 foreign key (cached_bean_id) references o_cached_bean (id); +create index ix_o_cached_bean_child_cached_1 on o_cached_bean_child (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); + +alter table o_order add constraint fk_o_order_kcustomer_id foreign key (kcustomer_id) references o_customer (id); +create index ix_o_order_kcustomer_id on o_order (kcustomer_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_order_id on o_order_detail (order_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_o_order_detail_product_id on o_order_detail (product_id); + +alter table s_order_items add constraint fk_s_order_items_order_uuid foreign key (order_uuid) references s_orders (uuid); +create index ix_s_order_items_order_uuid on s_order_items (order_uuid); + +alter table or_order_ship add constraint fk_or_order_ship_order_id foreign key (order_id) references o_order (id); +create index ix_or_order_ship_order_id on or_order_ship (order_id); + +alter table oto_child add constraint fk_oto_child_master_id foreign key (master_id) references oto_master (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); + +alter table pallet_location add constraint fk_pallet_location_zone_sid foreign key (zone_sid) references zones (id); +create index ix_pallet_location_zone_sid on pallet_location (zone_sid); + +alter table parcel_location add constraint fk_parcel_location_parcelid foreign key (parcelid) references parcel (parcelid); + +alter table rawinherit_parent_rawinherit_dat add constraint fk_rawinherit_parent_rawinher_1 foreign key (rawinherit_parent_id) references rawinherit_parent (id); +create index ix_rawinherit_parent_rawinher_1 on rawinherit_parent_rawinherit_dat (rawinherit_parent_id); + +alter table rawinherit_parent_rawinherit_dat add constraint fk_rawinherit_parent_rawinher_2 foreign key (rawinherit_data_id) references rawinherit_data (id); +create index ix_rawinherit_parent_rawinher_2 on rawinherit_parent_rawinherit_dat (rawinherit_data_id); + +alter table c_participation add constraint fk_c_participation_conversati_1 foreign key (conversation_id) references c_conversation (id); +create index ix_c_participation_conversati_1 on c_participation (conversation_id); + +alter table c_participation add constraint fk_c_participation_user_id foreign key (user_id) references c_user (id); +create index ix_c_participation_user_id on c_participation (user_id); + +alter table persistent_file_content add constraint fk_persistent_file_content_pe_1 foreign key (persistent_file_id) references persistent_file (id); + +alter table person add constraint fk_person_default_address_oid foreign key (default_address_oid) references address (oid); +create index ix_person_default_address_oid on person (default_address_oid); + +alter table phones add constraint fk_phones_person_id foreign key (person_id) references persons (id); +create index ix_phones_person_id on phones (person_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_pp_id on pp_to_ww (pp_id); + +alter table pp_to_ww add constraint fk_pp_to_ww_wview foreign key (ww_id) references wview (id); +create index ix_pp_to_ww_ww_id on pp_to_ww (ww_id); + +alter table r_orders add constraint fk_r_orders_rcustomer foreign key (company,customername) references rcustomer (company,name); +create index ix_r_orders_company_customern_1 on r_orders (company,customername); + +alter table resourcefile add constraint fk_resourcefile_parentresourc_1 foreign key (parentresourcefileid) references resourcefile (id); +create index ix_resourcefile_parentresourc_1 on resourcefile (parentresourcefileid); + +alter table mt_role add constraint fk_mt_role_tenant_id foreign key (tenant_id) references mt_tenant (id); +create index ix_mt_role_tenant_id on mt_role (tenant_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_role_1 on mt_role_permission (mt_role_id); + +alter table mt_role_permission add constraint fk_mt_role_permission_mt_perm_2 foreign key (mt_permission_id) references mt_permission (id); +create index ix_mt_role_permission_mt_perm_2 on mt_role_permission (mt_permission_id); + +alter table f_second add constraint fk_f_second_first foreign key (first) references f_first (id); + +alter table section add constraint fk_section_article_id foreign key (article_id) references article (id); +create index ix_section_article_id on section (article_id); + +alter table self_parent add constraint fk_self_parent_parent_id foreign key (parent_id) references self_parent (id); +create index ix_self_parent_parent_id on self_parent (parent_id); + +alter table self_ref_customer add constraint fk_self_ref_customer_referred_1 foreign key (referred_by_id) references self_ref_customer (id); +create index ix_self_ref_customer_referred_1 on self_ref_customer (referred_by_id); + +alter table self_ref_example add constraint fk_self_ref_example_parent_id foreign key (parent_id) references self_ref_example (id); +create index ix_self_ref_example_parent_id on self_ref_example (parent_id); + +alter table stockforecast add constraint fk_stockforecast_inner_report_1 foreign key (inner_report_id) references inner_report (id); +create index ix_stockforecast_inner_report_1 on stockforecast (inner_report_id); + +alter table sub_section add constraint fk_sub_section_section_id foreign key (section_id) references section (id); +create index ix_sub_section_section_id on sub_section (section_id); + +alter table t_detail_with_other_namexxxyy add constraint fk_t_detail_with_other_namexx_1 foreign key (master_id) references t_atable_thatisrelatively (id); +create index ix_t_detail_with_other_namexx_1 on t_detail_with_other_namexxxyy (master_id); + +alter table ts_detail_two add constraint fk_ts_detail_two_master_id foreign key (master_id) references ts_master_two (id); +create index ix_ts_detail_two_master_id on ts_detail_two (master_id); + +alter table twheel add constraint fk_twheel_owner_plate_no foreign key (owner_plate_no) references tcar (plate_no); +create index ix_twheel_owner_plate_no on twheel (owner_plate_no); + +alter table tire add constraint fk_tire_wheel foreign key (wheel) references wheel (id); + +alter table trip add constraint fk_trip_vehicle_driver_id foreign key (vehicle_driver_id) references vehicle_driver (id); +create index ix_trip_vehicle_driver_id on trip (vehicle_driver_id); + +alter table trip add constraint fk_trip_address_id foreign key (address_id) references o_address (id); +create index ix_trip_address_id on trip (address_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_type_sub_type_id on type (sub_type_id); + +alter table ut_detail add constraint fk_ut_detail_utmaster_id foreign key (utmaster_id) references ut_master (id); +create index ix_ut_detail_utmaster_id on ut_detail (utmaster_id); + +alter table uutwo add constraint fk_uutwo_master_id foreign key (master_id) references uuone (id); +create index ix_uutwo_master_id on uutwo (master_id); + +alter table c_user add constraint fk_c_user_group_id foreign key (group_id) references c_group (id); +create index ix_c_user_group_id on c_user (group_id); + +alter table oto_user add constraint fk_oto_user_account_id foreign key (account_id) references oto_account (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_user_id on em_user_role (user_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_em_user_role_role_id on em_user_role (role_id); + +alter table vehicle add constraint fk_vehicle_truck_ref_id foreign key (truck_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_car_ref_id foreign key (car_ref_id) references truck_ref (id); +create index ix_vehicle_car_ref_id on vehicle (car_ref_id); + +alter table vehicle_driver add constraint fk_vehicle_driver_vehicle_id foreign key (vehicle_id) references vehicle (id); +create index ix_vehicle_driver_vehicle_id on vehicle_driver (vehicle_id); + +alter table vehicle_driver add constraint fk_vehicle_driver_address_id foreign key (address_id) references o_address (id); +create index ix_vehicle_driver_address_id on vehicle_driver (address_id); + +alter table warehouses add constraint fk_warehouses_officezoneid foreign key (officezoneid) references zones (id); +create index ix_warehouses_officezoneid on warehouses (officezoneid); + +alter table warehousesshippingzones add constraint fk_warehousesshippingzones_wa_1 foreign key (warehouseid) references warehouses (id); +create index ix_warehousesshippingzones_wa_1 on warehousesshippingzones (warehouseid); + +alter table warehousesshippingzones add constraint fk_warehousesshippingzones_zo_2 foreign key (shippingzoneid) references zones (id); +create index ix_warehousesshippingzones_sh_2 on warehousesshippingzones (shippingzoneid); + +alter table sa_wheel add constraint fk_sa_wheel_tire foreign key (tire) references sa_tire (id); +create index ix_sa_wheel_tire on sa_wheel (tire); + +alter table sa_wheel add constraint fk_sa_wheel_car foreign key (car) references sa_car (id); +create index ix_sa_wheel_car on sa_wheel (car); + +alter table with_zero add constraint fk_with_zero_parent_id foreign key (parent_id) references parent (id); +create index ix_with_zero_parent_id on with_zero (parent_id); + diff --git a/src/test/ddl-review/ms-drop.sql b/src/test/ddl-review/ms-drop.sql new file mode 100644 index 000000000..4938e0fd4 --- /dev/null +++ b/src/test/ddl-review/ms-drop.sql @@ -0,0 +1,783 @@ +IF OBJECT_ID('fk_bar_foo_id', 'F') IS NOT NULL alter table bar drop constraint fk_bar_foo_id; +drop index ix_bar_foo_id; + +IF OBJECT_ID('fk_o_address_country_code', 'F') IS NOT NULL alter table o_address drop constraint fk_o_address_country_code; +drop index ix_o_address_country_code; + +IF OBJECT_ID('fk_animals_shelter_id', 'F') IS NOT NULL alter table animals drop constraint fk_animals_shelter_id; +drop index ix_animals_shelter_id; + +IF OBJECT_ID('fk_attribute_attribute_holder_1', 'F') IS NOT NULL alter table attribute drop constraint fk_attribute_attribute_holder_1; +drop index ix_attribute_attribute_holder_1; + +IF OBJECT_ID('fk_bbookmark_user_id', 'F') IS NOT NULL alter table bbookmark drop constraint fk_bbookmark_user_id; +drop index ix_bbookmark_user_id; + +drop index uq_drel_booking_agent_invoice; +drop index uq_drel_booking_client_invoice; +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_ckey_detail_ckey_parent', 'F') IS NOT NULL alter table ckey_detail drop constraint fk_ckey_detail_ckey_parent; +drop index ix_ckey_detail_one_key_two_key; + +IF OBJECT_ID('fk_ckey_parent_assoc_id', 'F') IS NOT NULL alter table ckey_parent drop constraint fk_ckey_parent_assoc_id; +drop index ix_ckey_parent_assoc_id; + +IF OBJECT_ID('fk_calculation_result_product_1', 'F') IS NOT NULL alter table calculation_result drop constraint fk_calculation_result_product_1; +drop index ix_calculation_result_product_1; + +IF OBJECT_ID('fk_calculation_result_group_c_2', 'F') IS NOT NULL alter table calculation_result drop constraint fk_calculation_result_group_c_2; +drop index ix_calculation_result_group_c_2; + +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; +drop index ix_sp_car_car_wheels_car; + +IF OBJECT_ID('fk_sp_car_car_wheels_sp_car_w_2', 'F') IS NOT NULL alter table sp_car_car_wheels drop constraint fk_sp_car_car_wheels_sp_car_w_2; +drop index ix_sp_car_car_wheels_wheel; + +IF OBJECT_ID('fk_car_accessory_car_id', 'F') IS NOT NULL alter table car_accessory drop constraint fk_car_accessory_car_id; +drop index ix_car_accessory_car_id; + +IF OBJECT_ID('fk_configuration_configuratio_1', 'F') IS NOT NULL alter table configuration drop constraint fk_configuration_configuratio_1; +drop index ix_configuration_configuratio_1; + +IF OBJECT_ID('fk_contact_customer_id', 'F') IS NOT NULL alter table contact drop constraint fk_contact_customer_id; +drop index ix_contact_customer_id; + +IF OBJECT_ID('fk_contact_group_id', 'F') IS NOT NULL alter table contact drop constraint fk_contact_group_id; +drop index ix_contact_group_id; + +IF OBJECT_ID('fk_contact_note_contact_id', 'F') IS NOT NULL alter table contact_note drop constraint fk_contact_note_contact_id; +drop index ix_contact_note_contact_id; + +IF OBJECT_ID('fk_c_conversation_group_id', 'F') IS NOT NULL alter table c_conversation drop constraint fk_c_conversation_group_id; +drop index ix_c_conversation_group_id; + +IF OBJECT_ID('fk_o_customer_billing_address_1', 'F') IS NOT NULL alter table o_customer drop constraint fk_o_customer_billing_address_1; +drop index ix_o_customer_billing_address_1; + +IF OBJECT_ID('fk_o_customer_shipping_addres_2', 'F') IS NOT NULL alter table o_customer drop constraint fk_o_customer_shipping_addres_2; +drop index ix_o_customer_shipping_addres_2; + +IF OBJECT_ID('fk_eemb_inner_outer_id', 'F') IS NOT NULL alter table eemb_inner drop constraint fk_eemb_inner_outer_id; +drop index ix_eemb_inner_outer_id; + +IF OBJECT_ID('fk_einvoice_person_id', 'F') IS NOT NULL alter table einvoice drop constraint fk_einvoice_person_id; +drop index ix_einvoice_person_id; + +IF OBJECT_ID('fk_enull_collection_detail_en_1', 'F') IS NOT NULL alter table enull_collection_detail drop constraint fk_enull_collection_detail_en_1; +drop index ix_enull_collection_detail_en_1; + +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; +drop index ix_eopt_one_a_b_id; + +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; +drop index ix_eopt_one_b_c_id; + +IF OBJECT_ID('fk_evanilla_collection_detail_1', 'F') IS NOT NULL alter table evanilla_collection_detail drop constraint fk_evanilla_collection_detail_1; +drop index ix_evanilla_collection_detail_1; + +IF OBJECT_ID('fk_td_child_parent_id', 'F') IS NOT NULL alter table td_child drop constraint fk_td_child_parent_id; +drop index ix_td_child_parent_id; + +IF OBJECT_ID('fk_imrelated_owner_id', 'F') IS NOT NULL alter table imrelated drop constraint fk_imrelated_owner_id; +drop index ix_imrelated_owner_id; + +IF OBJECT_ID('fk_info_contact_company_id', 'F') IS NOT NULL alter table info_contact drop constraint fk_info_contact_company_id; +drop index ix_info_contact_company_id; + +drop index uq_info_customer_company_id; +IF OBJECT_ID('fk_info_customer_company_id', 'F') IS NOT NULL alter table info_customer drop constraint fk_info_customer_company_id; + +drop index uq_inner_report_forecast_id; +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; +drop index ix_drel_invoice_booking; + +IF OBJECT_ID('fk_item_type', 'F') IS NOT NULL alter table item drop constraint fk_item_type; +drop index ix_item_customer_type; + +IF OBJECT_ID('fk_item_region', 'F') IS NOT NULL alter table item drop constraint fk_item_region; +drop index ix_item_customer_region; + +IF OBJECT_ID('fk_level1_level4_level1', 'F') IS NOT NULL alter table level1_level4 drop constraint fk_level1_level4_level1; +drop index ix_level1_level4_level1_id; + +IF OBJECT_ID('fk_level1_level4_level4', 'F') IS NOT NULL alter table level1_level4 drop constraint fk_level1_level4_level4; +drop index ix_level1_level4_level4_id; + +IF OBJECT_ID('fk_level1_level2_level1', 'F') IS NOT NULL alter table level1_level2 drop constraint fk_level1_level2_level1; +drop index ix_level1_level2_level1_id; + +IF OBJECT_ID('fk_level1_level2_level2', 'F') IS NOT NULL alter table level1_level2 drop constraint fk_level1_level2_level2; +drop index ix_level1_level2_level2_id; + +IF OBJECT_ID('fk_level2_level3_level2', 'F') IS NOT NULL alter table level2_level3 drop constraint fk_level2_level3_level2; +drop index ix_level2_level3_level2_id; + +IF OBJECT_ID('fk_level2_level3_level3', 'F') IS NOT NULL alter table level2_level3 drop constraint fk_level2_level3_level3; +drop index ix_level2_level3_level3_id; + +IF OBJECT_ID('fk_la_attr_value_attribute_la_1', 'F') IS NOT NULL alter table la_attr_value_attribute drop constraint fk_la_attr_value_attribute_la_1; +drop index ix_la_attr_value_attribute_la_1; + +IF OBJECT_ID('fk_la_attr_value_attribute_at_2', 'F') IS NOT NULL alter table la_attr_value_attribute drop constraint fk_la_attr_value_attribute_at_2; +drop index ix_la_attr_value_attribute_at_2; + +drop index uq_mprinter_last_swap_cyan_id; +drop index uq_mprinter_last_swap_magenta_2; +drop index uq_mprinter_last_swap_yellow_id; +drop index uq_mprinter_last_swap_black_id; +IF OBJECT_ID('fk_mprinter_current_state_id', 'F') IS NOT NULL alter table mprinter drop constraint fk_mprinter_current_state_id; +drop index ix_mprinter_current_state_id; + +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_3', 'F') IS NOT NULL alter table mprinter drop constraint fk_mprinter_last_swap_magenta_3; + +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; +drop index ix_mprinter_state_printer_id; + +IF OBJECT_ID('fk_mprofile_picture_id', 'F') IS NOT NULL alter table mprofile drop constraint fk_mprofile_picture_id; +drop index ix_mprofile_picture_id; + +IF OBJECT_ID('fk_mrole_muser_mrole', 'F') IS NOT NULL alter table mrole_muser drop constraint fk_mrole_muser_mrole; +drop index ix_mrole_muser_mrole_roleid; + +IF OBJECT_ID('fk_mrole_muser_muser', 'F') IS NOT NULL alter table mrole_muser drop constraint fk_mrole_muser_muser; +drop index ix_mrole_muser_muser_userid; + +IF OBJECT_ID('fk_muser_user_type_id', 'F') IS NOT NULL alter table muser drop constraint fk_muser_user_type_id; +drop index ix_muser_user_type_id; + +IF OBJECT_ID('fk_c_message_conversation_id', 'F') IS NOT NULL alter table c_message drop constraint fk_c_message_conversation_id; +drop index ix_c_message_conversation_id; + +IF OBJECT_ID('fk_c_message_user_id', 'F') IS NOT NULL alter table c_message drop constraint fk_c_message_user_id; +drop index ix_c_message_user_id; + +IF OBJECT_ID('fk_mnoc_user_mnoc_role_mnoc_u_1', 'F') IS NOT NULL alter table mnoc_user_mnoc_role drop constraint fk_mnoc_user_mnoc_role_mnoc_u_1; +drop index ix_mnoc_user_mnoc_role_mnoc_u_1; + +IF OBJECT_ID('fk_mnoc_user_mnoc_role_mnoc_r_2', 'F') IS NOT NULL alter table mnoc_user_mnoc_role drop constraint fk_mnoc_user_mnoc_role_mnoc_r_2; +drop index ix_mnoc_user_mnoc_role_mnoc_r_2; + +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; +drop index ix_mp_role_mp_user_id; + +IF OBJECT_ID('fk_my_lob_size_join_many_pare_1', 'F') IS NOT NULL alter table my_lob_size_join_many drop constraint fk_my_lob_size_join_many_pare_1; +drop index ix_my_lob_size_join_many_pare_1; + +IF OBJECT_ID('fk_o_cached_bean_country_o_ca_1', 'F') IS NOT NULL alter table o_cached_bean_country drop constraint fk_o_cached_bean_country_o_ca_1; +drop index ix_o_cached_bean_country_o_ca_1; + +IF OBJECT_ID('fk_o_cached_bean_country_o_co_2', 'F') IS NOT NULL alter table o_cached_bean_country drop constraint fk_o_cached_bean_country_o_co_2; +drop index ix_o_cached_bean_country_o_co_2; + +IF OBJECT_ID('fk_o_cached_bean_child_cached_1', 'F') IS NOT NULL alter table o_cached_bean_child drop constraint fk_o_cached_bean_child_cached_1; +drop index ix_o_cached_bean_child_cached_1; + +drop index uq_oengine_car_id; +IF OBJECT_ID('fk_oengine_car_id', 'F') IS NOT NULL alter table oengine drop constraint fk_oengine_car_id; + +drop index uq_ogear_box_car_id; +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_o_order_kcustomer_id', 'F') IS NOT NULL alter table o_order drop constraint fk_o_order_kcustomer_id; +drop index ix_o_order_kcustomer_id; + +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; +drop index ix_o_order_detail_order_id; + +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; +drop index ix_o_order_detail_product_id; + +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; +drop index ix_s_order_items_order_uuid; + +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; +drop index ix_or_order_ship_order_id; + +drop index uq_oto_child_master_id; +IF OBJECT_ID('fk_oto_child_master_id', 'F') IS NOT NULL alter table oto_child drop constraint fk_oto_child_master_id; + +drop index uq_pfile_file_content_id; +drop index uq_pfile_file_content2_id; +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; + +drop index uq_paggview_pview_id; +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; +drop index ix_pallet_location_zone_sid; + +drop index uq_parcel_location_parcelid; +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_rawinher_1', 'F') IS NOT NULL alter table rawinherit_parent_rawinherit_dat drop constraint fk_rawinherit_parent_rawinher_1; +drop index ix_rawinherit_parent_rawinher_1; + +IF OBJECT_ID('fk_rawinherit_parent_rawinher_2', 'F') IS NOT NULL alter table rawinherit_parent_rawinherit_dat drop constraint fk_rawinherit_parent_rawinher_2; +drop index ix_rawinherit_parent_rawinher_2; + +IF OBJECT_ID('fk_c_participation_conversati_1', 'F') IS NOT NULL alter table c_participation drop constraint fk_c_participation_conversati_1; +drop index ix_c_participation_conversati_1; + +IF OBJECT_ID('fk_c_participation_user_id', 'F') IS NOT NULL alter table c_participation drop constraint fk_c_participation_user_id; +drop index ix_c_participation_user_id; + +drop index uq_persistent_file_content_pe_1; +IF OBJECT_ID('fk_persistent_file_content_pe_1', 'F') IS NOT NULL alter table persistent_file_content drop constraint fk_persistent_file_content_pe_1; + +IF OBJECT_ID('fk_person_default_address_oid', 'F') IS NOT NULL alter table person drop constraint fk_person_default_address_oid; +drop index ix_person_default_address_oid; + +IF OBJECT_ID('fk_phones_person_id', 'F') IS NOT NULL alter table phones drop constraint fk_phones_person_id; +drop index ix_phones_person_id; + +IF OBJECT_ID('fk_pp_to_ww_pp', 'F') IS NOT NULL alter table pp_to_ww drop constraint fk_pp_to_ww_pp; +drop index ix_pp_to_ww_pp_id; + +IF OBJECT_ID('fk_pp_to_ww_wview', 'F') IS NOT NULL alter table pp_to_ww drop constraint fk_pp_to_ww_wview; +drop index ix_pp_to_ww_ww_id; + +IF OBJECT_ID('fk_r_orders_rcustomer', 'F') IS NOT NULL alter table r_orders drop constraint fk_r_orders_rcustomer; +drop index ix_r_orders_company_customern_1; + +IF OBJECT_ID('fk_resourcefile_parentresourc_1', 'F') IS NOT NULL alter table resourcefile drop constraint fk_resourcefile_parentresourc_1; +drop index ix_resourcefile_parentresourc_1; + +IF OBJECT_ID('fk_mt_role_tenant_id', 'F') IS NOT NULL alter table mt_role drop constraint fk_mt_role_tenant_id; +drop index ix_mt_role_tenant_id; + +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; +drop index ix_mt_role_permission_mt_role_1; + +IF OBJECT_ID('fk_mt_role_permission_mt_perm_2', 'F') IS NOT NULL alter table mt_role_permission drop constraint fk_mt_role_permission_mt_perm_2; +drop index ix_mt_role_permission_mt_perm_2; + +drop index uq_f_second_first; +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; +drop index ix_section_article_id; + +IF OBJECT_ID('fk_self_parent_parent_id', 'F') IS NOT NULL alter table self_parent drop constraint fk_self_parent_parent_id; +drop index ix_self_parent_parent_id; + +IF OBJECT_ID('fk_self_ref_customer_referred_1', 'F') IS NOT NULL alter table self_ref_customer drop constraint fk_self_ref_customer_referred_1; +drop index ix_self_ref_customer_referred_1; + +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; +drop index ix_self_ref_example_parent_id; + +IF OBJECT_ID('fk_stockforecast_inner_report_1', 'F') IS NOT NULL alter table stockforecast drop constraint fk_stockforecast_inner_report_1; +drop index ix_stockforecast_inner_report_1; + +IF OBJECT_ID('fk_sub_section_section_id', 'F') IS NOT NULL alter table sub_section drop constraint fk_sub_section_section_id; +drop index ix_sub_section_section_id; + +IF OBJECT_ID('fk_t_detail_with_other_namexx_1', 'F') IS NOT NULL alter table t_detail_with_other_namexxxyy drop constraint fk_t_detail_with_other_namexx_1; +drop index ix_t_detail_with_other_namexx_1; + +IF OBJECT_ID('fk_ts_detail_two_master_id', 'F') IS NOT NULL alter table ts_detail_two drop constraint fk_ts_detail_two_master_id; +drop index ix_ts_detail_two_master_id; + +IF OBJECT_ID('fk_twheel_owner_plate_no', 'F') IS NOT NULL alter table twheel drop constraint fk_twheel_owner_plate_no; +drop index ix_twheel_owner_plate_no; + +drop index uq_tire_wheel; +IF OBJECT_ID('fk_tire_wheel', 'F') IS NOT NULL alter table tire drop constraint fk_tire_wheel; + +IF OBJECT_ID('fk_trip_vehicle_driver_id', 'F') IS NOT NULL alter table trip drop constraint fk_trip_vehicle_driver_id; +drop index ix_trip_vehicle_driver_id; + +IF OBJECT_ID('fk_trip_address_id', 'F') IS NOT NULL alter table trip drop constraint fk_trip_address_id; +drop index ix_trip_address_id; + +IF OBJECT_ID('fk_type_sub_type_id', 'F') IS NOT NULL alter table type drop constraint fk_type_sub_type_id; +drop index ix_type_sub_type_id; + +IF OBJECT_ID('fk_ut_detail_utmaster_id', 'F') IS NOT NULL alter table ut_detail drop constraint fk_ut_detail_utmaster_id; +drop index ix_ut_detail_utmaster_id; + +IF OBJECT_ID('fk_uutwo_master_id', 'F') IS NOT NULL alter table uutwo drop constraint fk_uutwo_master_id; +drop index ix_uutwo_master_id; + +IF OBJECT_ID('fk_c_user_group_id', 'F') IS NOT NULL alter table c_user drop constraint fk_c_user_group_id; +drop index ix_c_user_group_id; + +drop index uq_oto_user_account_id; +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_em_user_role_user_id', 'F') IS NOT NULL alter table em_user_role drop constraint fk_em_user_role_user_id; +drop index ix_em_user_role_user_id; + +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; +drop index ix_em_user_role_role_id; + +IF OBJECT_ID('fk_vehicle_truck_ref_id', 'F') IS NOT NULL alter table vehicle drop constraint fk_vehicle_truck_ref_id; +drop index ix_vehicle_truck_ref_id; + +IF OBJECT_ID('fk_vehicle_car_ref_id', 'F') IS NOT NULL alter table vehicle drop constraint fk_vehicle_car_ref_id; +drop index ix_vehicle_car_ref_id; + +IF OBJECT_ID('fk_vehicle_driver_vehicle_id', 'F') IS NOT NULL alter table vehicle_driver drop constraint fk_vehicle_driver_vehicle_id; +drop index ix_vehicle_driver_vehicle_id; + +IF OBJECT_ID('fk_vehicle_driver_address_id', 'F') IS NOT NULL alter table vehicle_driver drop constraint fk_vehicle_driver_address_id; +drop index ix_vehicle_driver_address_id; + +IF OBJECT_ID('fk_warehouses_officezoneid', 'F') IS NOT NULL alter table warehouses drop constraint fk_warehouses_officezoneid; +drop index ix_warehouses_officezoneid; + +IF OBJECT_ID('fk_warehousesshippingzones_wa_1', 'F') IS NOT NULL alter table warehousesshippingzones drop constraint fk_warehousesshippingzones_wa_1; +drop index ix_warehousesshippingzones_wa_1; + +IF OBJECT_ID('fk_warehousesshippingzones_zo_2', 'F') IS NOT NULL alter table warehousesshippingzones drop constraint fk_warehousesshippingzones_zo_2; +drop index ix_warehousesshippingzones_sh_2; + +IF OBJECT_ID('fk_sa_wheel_tire', 'F') IS NOT NULL alter table sa_wheel drop constraint fk_sa_wheel_tire; +drop index ix_sa_wheel_tire; + +IF OBJECT_ID('fk_sa_wheel_car', 'F') IS NOT NULL alter table sa_wheel drop constraint fk_sa_wheel_car; +drop index ix_sa_wheel_car; + +IF OBJECT_ID('fk_with_zero_parent_id', 'F') IS NOT NULL alter table with_zero drop constraint fk_with_zero_parent_id; +drop index ix_with_zero_parent_id; + +IF OBJECT_ID('asimple_bean', 'U') IS NOT NULL drop table asimple_bean; + +IF OBJECT_ID('bar', 'U') IS NOT NULL drop table bar; + +IF OBJECT_ID('oto_account', 'U') IS NOT NULL drop table oto_account; + +IF OBJECT_ID('o_address', 'U') IS NOT NULL drop table o_address; + +IF OBJECT_ID('address', 'U') IS NOT NULL drop table address; + +IF OBJECT_ID('animals', 'U') IS NOT NULL drop table animals; + +IF OBJECT_ID('animal_shelter', 'U') IS NOT NULL drop table animal_shelter; + +IF OBJECT_ID('article', 'U') IS NOT NULL drop table article; + +IF OBJECT_ID('attribute', 'U') IS NOT NULL drop table attribute; + +IF OBJECT_ID('attribute_holder', 'U') IS NOT NULL drop table attribute_holder; + +IF OBJECT_ID('audit_log', 'U') IS NOT NULL drop table audit_log; + +IF OBJECT_ID('bbookmark', 'U') IS NOT NULL drop table bbookmark; + +IF OBJECT_ID('bbookmark_user', 'U') IS NOT NULL drop table bbookmark_user; + +IF OBJECT_ID('bsimple_with_gen', 'U') IS NOT NULL drop table bsimple_with_gen; + +IF OBJECT_ID('bwith_qident', 'U') IS NOT NULL drop table bwith_qident; + +IF OBJECT_ID('basic_joda_entity', 'U') IS NOT NULL drop table basic_joda_entity; + +IF OBJECT_ID('bean_with_time_zone', 'U') IS NOT NULL drop table bean_with_time_zone; + +IF OBJECT_ID('drel_booking', 'U') IS NOT NULL drop table drel_booking; + +IF OBJECT_ID('ckey_assoc', 'U') IS NOT NULL drop table ckey_assoc; + +IF OBJECT_ID('ckey_detail', 'U') IS NOT NULL drop table ckey_detail; + +IF OBJECT_ID('ckey_parent', 'U') IS NOT NULL drop table ckey_parent; + +IF OBJECT_ID('calculation_result', 'U') IS NOT NULL drop table calculation_result; + +IF OBJECT_ID('cao_bean', 'U') IS NOT NULL drop table cao_bean; + +IF OBJECT_ID('sa_car', 'U') IS NOT NULL drop table sa_car; + +IF OBJECT_ID('sp_car_car', 'U') IS NOT NULL drop table sp_car_car; + +IF OBJECT_ID('sp_car_car_wheels', 'U') IS NOT NULL drop table sp_car_car_wheels; + +IF OBJECT_ID('car_accessory', 'U') IS NOT NULL drop table car_accessory; + +IF OBJECT_ID('configuration', 'U') IS NOT NULL drop table configuration; + +IF OBJECT_ID('configurations', 'U') IS NOT NULL drop table configurations; + +IF OBJECT_ID('contact', 'U') IS NOT NULL drop table contact; + +IF OBJECT_ID('contact_group', 'U') IS NOT NULL drop table contact_group; + +IF OBJECT_ID('contact_note', 'U') IS NOT NULL drop table contact_note; + +IF OBJECT_ID('c_conversation', 'U') IS NOT NULL drop table c_conversation; + +IF OBJECT_ID('o_country', 'U') IS NOT NULL drop table o_country; + +IF OBJECT_ID('o_customer', 'U') IS NOT NULL drop table o_customer; + +IF OBJECT_ID('dexh_entity', 'U') IS NOT NULL drop table dexh_entity; + +IF OBJECT_ID('dperson', 'U') IS NOT NULL drop table dperson; + +IF OBJECT_ID('rawinherit_data', 'U') IS NOT NULL drop table rawinherit_data; + +IF OBJECT_ID('e_basic', 'U') IS NOT NULL drop table e_basic; + +IF OBJECT_ID('ebasic_clob', 'U') IS NOT NULL drop table ebasic_clob; + +IF OBJECT_ID('ebasic_clob_fetch_eager', 'U') IS NOT NULL drop table ebasic_clob_fetch_eager; + +IF OBJECT_ID('ebasic_clob_no_ver', 'U') IS NOT NULL drop table ebasic_clob_no_ver; + +IF OBJECT_ID('e_basicenc', 'U') IS NOT NULL drop table e_basicenc; + +IF OBJECT_ID('e_basicenc_bin', 'U') IS NOT NULL drop table e_basicenc_bin; + +IF OBJECT_ID('e_basic_enum_id', 'U') IS NOT NULL drop table e_basic_enum_id; + +IF OBJECT_ID('ebasic_json_map', 'U') IS NOT NULL drop table ebasic_json_map; + +IF OBJECT_ID('ebasic_json_map_blob', 'U') IS NOT NULL drop table ebasic_json_map_blob; + +IF OBJECT_ID('ebasic_json_map_clob', 'U') IS NOT NULL drop table ebasic_json_map_clob; + +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_varchar', 'U') IS NOT NULL drop table ebasic_json_map_varchar; + +IF OBJECT_ID('ebasic_json_node', 'U') IS NOT NULL drop table ebasic_json_node; + +IF OBJECT_ID('ebasic_json_node_blob', 'U') IS NOT NULL drop table ebasic_json_node_blob; + +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_varchar', 'U') IS NOT NULL drop table ebasic_json_node_varchar; + +IF OBJECT_ID('e_basic_ndc', 'U') IS NOT NULL drop table e_basic_ndc; + +IF OBJECT_ID('e_basicver', 'U') IS NOT NULL drop table e_basicver; + +IF OBJECT_ID('e_basic_withlife', 'U') IS NOT NULL drop table e_basic_withlife; + +IF OBJECT_ID('e_basicverucon', 'U') IS NOT NULL drop table e_basicverucon; + +IF OBJECT_ID('eemb_inner', 'U') IS NOT NULL drop table eemb_inner; + +IF OBJECT_ID('eemb_outer', 'U') IS NOT NULL drop table eemb_outer; + +IF OBJECT_ID('egen_props', 'U') IS NOT NULL drop table egen_props; + +IF OBJECT_ID('einvoice', 'U') IS NOT NULL drop table einvoice; + +IF OBJECT_ID('e_main', 'U') IS NOT NULL drop table e_main; + +IF OBJECT_ID('enull_collection', 'U') IS NOT NULL drop table enull_collection; + +IF OBJECT_ID('enull_collection_detail', 'U') IS NOT NULL drop table enull_collection_detail; + +IF OBJECT_ID('eopt_one_a', 'U') IS NOT NULL drop table eopt_one_a; + +IF OBJECT_ID('eopt_one_b', 'U') IS NOT NULL drop table eopt_one_b; + +IF OBJECT_ID('eopt_one_c', 'U') IS NOT NULL drop table eopt_one_c; + +IF OBJECT_ID('eperson', 'U') IS NOT NULL drop table eperson; + +IF OBJECT_ID('esimple', 'U') IS NOT NULL drop table esimple; + +IF OBJECT_ID('esome_type', 'U') IS NOT NULL drop table esome_type; + +IF OBJECT_ID('etrans_many', 'U') IS NOT NULL drop table etrans_many; + +IF OBJECT_ID('evanilla_collection', 'U') IS NOT NULL drop table evanilla_collection; + +IF OBJECT_ID('evanilla_collection_detail', 'U') IS NOT NULL drop table evanilla_collection_detail; + +IF OBJECT_ID('ewho_props', 'U') IS NOT NULL drop table ewho_props; + +IF OBJECT_ID('e_withinet', 'U') IS NOT NULL drop table e_withinet; + +IF OBJECT_ID('td_child', 'U') IS NOT NULL drop table td_child; + +IF OBJECT_ID('td_parent', 'U') IS NOT NULL drop table td_parent; + +IF OBJECT_ID('feature_desc', 'U') IS NOT NULL drop table feature_desc; + +IF OBJECT_ID('f_first', 'U') IS NOT NULL drop table f_first; + +IF OBJECT_ID('foo', 'U') IS NOT NULL drop table foo; + +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_table', 'U') IS NOT NULL drop table gen_key_table; + +IF OBJECT_ID('c_group', 'U') IS NOT NULL drop table c_group; + +IF OBJECT_ID('imrelated', 'U') IS NOT NULL drop table imrelated; + +IF OBJECT_ID('imroot', 'U') IS NOT NULL drop table imroot; + +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_contact', 'U') IS NOT NULL drop table info_contact; + +IF OBJECT_ID('info_customer', 'U') IS NOT NULL drop table info_customer; + +IF OBJECT_ID('inner_report', 'U') IS NOT NULL drop table inner_report; + +IF OBJECT_ID('drel_invoice', 'U') IS NOT NULL drop table drel_invoice; + +IF OBJECT_ID('item', 'U') IS NOT NULL drop table item; + +IF OBJECT_ID('level1', 'U') IS NOT NULL drop table level1; + +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_level3', 'U') IS NOT NULL drop table level2_level3; + +IF OBJECT_ID('level3', 'U') IS NOT NULL drop table level3; + +IF OBJECT_ID('level4', 'U') IS NOT NULL drop table level4; + +IF OBJECT_ID('la_attr_value', 'U') IS NOT NULL drop table la_attr_value; + +IF OBJECT_ID('la_attr_value_attribute', 'U') IS NOT NULL drop table la_attr_value_attribute; + +IF OBJECT_ID('mmedia', 'U') IS NOT NULL drop table mmedia; + +IF OBJECT_ID('non_updateprop', 'U') IS NOT NULL drop table non_updateprop; + +IF OBJECT_ID('mprinter', 'U') IS NOT NULL drop table mprinter; + +IF OBJECT_ID('mprinter_state', 'U') IS NOT NULL drop table mprinter_state; + +IF OBJECT_ID('mprofile', 'U') IS NOT NULL drop table mprofile; + +IF OBJECT_ID('mprotected_construct_bean', 'U') IS NOT NULL drop table mprotected_construct_bean; + +IF OBJECT_ID('mrole', 'U') IS NOT NULL drop table mrole; + +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('muser', 'U') IS NOT NULL drop table muser; + +IF OBJECT_ID('muser_type', 'U') IS NOT NULL drop table muser_type; + +IF OBJECT_ID('map_super_actual', 'U') IS NOT NULL drop table map_super_actual; + +IF OBJECT_ID('c_message', 'U') IS NOT NULL drop table c_message; + +IF OBJECT_ID('mnoc_role', 'U') IS NOT NULL drop table mnoc_role; + +IF OBJECT_ID('mnoc_user', 'U') IS NOT NULL drop table mnoc_user; + +IF OBJECT_ID('mnoc_user_mnoc_role', 'U') IS NOT NULL drop table mnoc_user_mnoc_role; + +IF OBJECT_ID('mp_role', 'U') IS NOT NULL drop table mp_role; + +IF OBJECT_ID('mp_user', 'U') IS NOT NULL drop table mp_user; + +IF OBJECT_ID('my_lob_size', 'U') IS NOT NULL drop table my_lob_size; + +IF OBJECT_ID('my_lob_size_join_many', 'U') IS NOT NULL drop table my_lob_size_join_many; + +IF OBJECT_ID('noidbean', 'U') IS NOT NULL drop table noidbean; + +IF OBJECT_ID('o_cached_bean', 'U') IS NOT NULL drop table o_cached_bean; + +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('ocar', 'U') IS NOT NULL drop table ocar; + +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('o_order', 'U') IS NOT NULL drop table o_order; + +IF OBJECT_ID('o_order_detail', 'U') IS NOT NULL drop table o_order_detail; + +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('oto_child', 'U') IS NOT NULL drop table oto_child; + +IF OBJECT_ID('oto_master', 'U') IS NOT NULL drop table oto_master; + +IF OBJECT_ID('pfile', 'U') IS NOT NULL drop table pfile; + +IF OBJECT_ID('pfile_content', 'U') IS NOT NULL drop table pfile_content; + +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('parcel', 'U') IS NOT NULL drop table parcel; + +IF OBJECT_ID('parcel_location', 'U') IS NOT NULL drop table parcel_location; + +IF OBJECT_ID('rawinherit_parent', 'U') IS NOT NULL drop table rawinherit_parent; + +IF OBJECT_ID('rawinherit_parent_rawinherit_dat', 'U') IS NOT NULL drop table rawinherit_parent_rawinherit_dat; + +IF OBJECT_ID('c_participation', 'U') IS NOT NULL drop table c_participation; + +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_content', 'U') IS NOT NULL drop table persistent_file_content; + +IF OBJECT_ID('persons', 'U') IS NOT NULL drop table persons; + +IF OBJECT_ID('person', 'U') IS NOT NULL drop table person; + +IF OBJECT_ID('phones', 'U') IS NOT NULL drop table phones; + +IF OBJECT_ID('o_product', 'U') IS NOT NULL drop table o_product; + +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('rcustomer', 'U') IS NOT NULL drop table rcustomer; + +IF OBJECT_ID('r_orders', 'U') IS NOT NULL drop table r_orders; + +IF OBJECT_ID('region', 'U') IS NOT NULL drop table region; + +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('f_second', 'U') IS NOT NULL drop table f_second; + +IF OBJECT_ID('section', 'U') IS NOT NULL drop table section; + +IF OBJECT_ID('self_parent', 'U') IS NOT NULL drop table self_parent; + +IF OBJECT_ID('self_ref_customer', 'U') IS NOT NULL drop table self_ref_customer; + +IF OBJECT_ID('self_ref_example', 'U') IS NOT NULL drop table self_ref_example; + +IF OBJECT_ID('some_enum_bean', 'U') IS NOT NULL drop table some_enum_bean; + +IF OBJECT_ID('some_file_bean', 'U') IS NOT NULL drop table some_file_bean; + +IF OBJECT_ID('some_new_types_bean', 'U') IS NOT NULL drop table some_new_types_bean; + +IF OBJECT_ID('some_period_bean', 'U') IS NOT NULL drop table some_period_bean; + +IF OBJECT_ID('stockforecast', 'U') IS NOT NULL drop table stockforecast; + +IF OBJECT_ID('sub_section', 'U') IS NOT NULL drop table sub_section; + +IF OBJECT_ID('sub_type', 'U') IS NOT NULL drop table sub_type; + +IF OBJECT_ID('tbytes_only', 'U') IS NOT NULL drop table tbytes_only; + +IF OBJECT_ID('tcar', 'U') IS NOT NULL drop table tcar; + +IF OBJECT_ID('tint_root', 'U') IS NOT NULL drop table tint_root; + +IF OBJECT_ID('tjoda_entity', 'U') IS NOT NULL drop table tjoda_entity; + +IF OBJECT_ID('t_mapsuper1', 'U') IS NOT NULL drop table t_mapsuper1; + +IF OBJECT_ID('t_oneb', 'U') IS NOT NULL drop table t_oneb; + +IF OBJECT_ID('t_detail_with_other_namexxxyy', 'U') IS NOT NULL drop table t_detail_with_other_namexxxyy; + +IF OBJECT_ID('ts_detail_two', 'U') IS NOT NULL drop table ts_detail_two; + +IF OBJECT_ID('t_atable_thatisrelatively', 'U') IS NOT NULL drop table t_atable_thatisrelatively; + +IF OBJECT_ID('ts_master_two', 'U') IS NOT NULL drop table ts_master_two; + +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('twith_pre_insert', 'U') IS NOT NULL drop table twith_pre_insert; + +IF OBJECT_ID('mt_tenant', 'U') IS NOT NULL drop table mt_tenant; + +IF OBJECT_ID('sa_tire', 'U') IS NOT NULL drop table sa_tire; + +IF OBJECT_ID('tire', 'U') IS NOT NULL drop table tire; + +IF OBJECT_ID('trip', 'U') IS NOT NULL drop table trip; + +IF OBJECT_ID('truck_ref', 'U') IS NOT NULL drop table truck_ref; + +IF OBJECT_ID('type', 'U') IS NOT NULL drop table type; + +IF OBJECT_ID('ut_detail', 'U') IS NOT NULL drop table ut_detail; + +IF OBJECT_ID('ut_master', 'U') IS NOT NULL drop table ut_master; + +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('em_user', 'U') IS NOT NULL drop table em_user; + +IF OBJECT_ID('tx_user', 'U') IS NOT NULL drop table tx_user; + +IF OBJECT_ID('c_user', 'U') IS NOT NULL drop table c_user; + +IF OBJECT_ID('oto_user', 'U') IS NOT NULL drop table oto_user; + +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_driver', 'U') IS NOT NULL drop table vehicle_driver; + +IF OBJECT_ID('warehouses', 'U') IS NOT NULL drop table warehouses; + +IF OBJECT_ID('warehousesshippingzones', 'U') IS NOT NULL drop table warehousesshippingzones; + +IF OBJECT_ID('sa_wheel', 'U') IS NOT NULL drop table sa_wheel; + +IF OBJECT_ID('sp_car_wheel', 'U') IS NOT NULL drop table sp_car_wheel; + +IF OBJECT_ID('wheel', 'U') IS NOT NULL drop table wheel; + +IF OBJECT_ID('with_zero', 'U') IS NOT NULL drop table with_zero; + +IF OBJECT_ID('parent', 'U') IS NOT NULL drop table parent; + +IF OBJECT_ID('wview', 'U') IS NOT NULL drop table wview; + +IF OBJECT_ID('zones', 'U') IS NOT NULL drop table zones; + diff --git a/src/test/ddl-review/mysql-create.sql b/src/test/ddl-review/mysql-create.sql new file mode 100644 index 000000000..f81a883cd --- /dev/null +++ b/src/test/ddl-review/mysql-create.sql @@ -0,0 +1,2074 @@ +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 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 o_address ( + id smallint 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 address ( + oid bigint auto_increment not null, + street varchar(255), + version integer not null, + constraint pk_address primary key (oid) +); + +create table animals ( + species varchar(31) 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, + constraint pk_animals 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_user ( + id integer auto_increment not null, + name varchar(255), + password varchar(255), + email_address varchar(255), + country varchar(255), + 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 bwith_qident ( + id integer auto_increment not null, + `Name` 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_joda_entity ( + id bigint auto_increment not null, + name varchar(255), + 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, + agent_invoice bigint, + client_invoice bigint, + version integer not null, + 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 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(255), + constraint pk_ckey_detail primary key (id) +); + +create table ckey_parent ( + one_key integer not null, + two_key varchar(255) not null, + name varchar(255), + assoc_id integer, + version integer not null, + constraint pk_ckey_parent primary key (one_key,two_key) +); + +create table calculation_result ( + id integer auto_increment not null, + charge double, + 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 sa_car ( + id bigint auto_increment not null, + version integer not null, + constraint pk_sa_car primary key (id) +); + +create table sp_car_car ( + id bigint auto_increment not null, + 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 car_accessory ( + id integer auto_increment not null, + name varchar(255), + 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 configuration ( + type varchar(31) 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(255), + last_name varchar(255), + phone varchar(255), + mobile varchar(255), + email varchar(255), + 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 c_conversation ( + id bigint auto_increment not null, + title varchar(255), + isopen tinyint(1) default 0, + 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 o_customer ( + id integer auto_increment not null, + status varchar(1), + name varchar(40) not null, + smallnote varchar(100), + anniversary date, + billing_address_id smallint, + shipping_address_id smallint, + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + constraint ck_o_customer_status check (status in ('N','A','I')), + constraint pk_o_customer primary key (id) +); + +create table dexh_entity ( + oid bigint auto_increment not null, + exhange_rate decimal(38), + exhange_cmoney_amount decimal(38), + exhange_cmoney_currency varchar(3), + last_updated datetime(6) not null, + constraint pk_dexh_entity primary key (oid) +); + +create table dperson ( + id bigint auto_increment not null, + first_name varchar(255), + last_name varchar(255), + salary decimal(38), + a_amt decimal(38), + a_curr varchar(3), + i_start datetime(6), + i_end datetime(6), + constraint pk_dperson primary key (id) +); + +create table rawinherit_data ( + id bigint auto_increment not null, + val integer, + constraint pk_rawinherit_data primary key (id) +); + +create table e_basic ( + id integer auto_increment not null, + status varchar(1), + name varchar(255), + description varchar(255), + some_date datetime(6), + constraint ck_e_basic_status check (status in ('N','A','I')), + constraint pk_e_basic 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), + 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_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 ebasic_json_map ( + id bigint auto_increment not null, + name varchar(255), + content longtext, + 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_json_b ( + id bigint auto_increment not null, + name varchar(255), + content longtext, + 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 longtext, + 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 longtext, + 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 e_basic_ndc ( + id integer auto_increment not null, + name varchar(255), + constraint pk_e_basic_ndc 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), + version bigint not null, + constraint pk_e_basic_withlife primary key (id) +); + +create table e_basicverucon ( + id integer auto_increment not null, + name varchar(255), + other varchar(255), + other_one varchar(255), + description varchar(255), + last_update datetime(6) not null, + constraint uq_e_basicverucon_name unique (name), + constraint pk_e_basicverucon 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 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, + long_created bigint not null, + long_updated bigint not null, + constraint pk_egen_props 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), + street varchar(255), + suburb varchar(255), + city varchar(255), + version bigint not null, + constraint ck_einvoice_state check (state in (0,1,2)), + 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 eperson ( + id bigint auto_increment not null, + name varchar(255), + notes varchar(255), + street varchar(255), + suburb varchar(255), + city varchar(255), + version bigint not null, + constraint pk_eperson primary key (id) +); + +create table esimple ( + usertypeid integer auto_increment not null, + name varchar(255), + constraint pk_esimple primary key (usertypeid) +); + +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 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), + who_created varchar(255) not null, + who_modified varchar(255) not null, + version bigint not null, + when_created datetime(6) not null, + when_modified datetime(6) 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), + version bigint not null, + constraint pk_e_withinet 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 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 c_group ( + id bigint auto_increment not null, + inactive tinyint(1) default 0, + 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 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(10) not null, + id bigint auto_increment not null, + title varchar(255), + when_title datetime(6), + name varchar(255), + constraint pk_imroot primary key (id) +); + +create table ixresource ( + dtype varchar(255), + id binary(16) 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(255) not null, + description varchar(255), + units varchar(255), + type integer, + region integer, + 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 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 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 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 ck_non_updateprop_non_enum check (non_enum in ('BEGIN','END')), + 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, + 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 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 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 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 my_lob_size ( + id integer auto_increment not null, + name varchar(255), + my_count integer, + 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_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 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 oengine ( + engine_id binary(16) 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 binary(16) 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 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 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 auto_increment not null, + order_id integer, + 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(255) not null, + constraint pk_s_orders primary key (uuid) +); + +create table s_order_items ( + uuid varchar(255) not null, + product_variant_uuid varchar(255), + order_uuid varchar(255), + quantity integer, + 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 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_master ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_oto_master 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 binary(16), + 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, + 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 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 ck_c_participation_type check (type in (0,1)), + constraint pk_c_participation primary key (id) +); + +create table mt_permission ( + id binary(16) 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 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 ( + oid bigint auto_increment not null, + default_address_oid bigint, + version integer not null, + constraint pk_person primary key (oid) +); + +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 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 binary(16) not null, + name varchar(255), + value varchar(100) not null, + constraint pk_pp primary key (id) +); + +create table pp_to_ww ( + pp_id binary(16) not null, + ww_id binary(16) not null, + constraint pk_pp_to_ww primary key (pp_id,ww_id) +); + +create table rcustomer ( + company varchar(255) not null, + name varchar(255) not null, + description varchar(255), + constraint pk_rcustomer primary key (company,name) +); + +create table r_orders ( + company varchar(255) not null, + order_number integer not null, + customername varchar(255), + item varchar(255), + constraint pk_r_orders primary key (company,order_number) +); + +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 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 binary(16) not null, + name varchar(50), + tenant_id binary(16), + version bigint not null, + constraint pk_mt_role primary key (id) +); + +create table mt_role_permission ( + mt_role_id binary(16) not null, + mt_permission_id binary(16) 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 f_second ( + id bigint auto_increment not null, + 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 ck_section_type check (type in (0,1)), + 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 some_enum_bean ( + id bigint auto_increment 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 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, + local_date date, + local_date_time datetime(6), + offset_date_time datetime(6), + zoned_date_time datetime(6), + instant datetime(6), + zone_id varchar(60), + zone_offset varchar(60), + 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 auto_increment not null, + period_years integer, + period_months integer, + period_days integer, + anniversary date, + version bigint not null, + constraint pk_some_period_bean 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 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(255) not null, + truckload bigint, + constraint pk_tcar primary key (plate_no) +); + +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, + 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), + active tinyint(1) default 0, + master_id integer, + constraint pk_t_detail_with_other_namexxxyy primary key (id) +); + +create table ts_detail_two ( + id integer auto_increment not null, + name varchar(255), + description varchar(255), + active tinyint(1) default 0, + master_id integer, + constraint pk_ts_detail_two 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, + constraint pk_t_atable_thatisrelatively primary key (id) +); + +create table ts_master_two ( + id integer auto_increment not null, + name varchar(255), + description varchar(255), + active tinyint(1) default 0, + constraint pk_ts_master_two primary key (id) +); + +create table tuuid_entity ( + id binary(16) 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(255) 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 mt_tenant ( + id binary(16) not null, + name varchar(255), + version bigint not null, + constraint pk_mt_tenant 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 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 trip ( + id integer auto_increment not null, + vehicle_driver_id integer, + destination varchar(255), + address_id smallint, + 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 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 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), + version integer not null, + constraint pk_ut_master primary key (id) +); + +create table uuone ( + id binary(16) not null, + name varchar(255), + constraint pk_uuone primary key (id) +); + +create table uutwo ( + id binary(16) not null, + name varchar(255), + master_id binary(16), + constraint pk_uutwo 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 tx_user ( + id bigint auto_increment not null, + name varchar(255), + constraint pk_tx_user primary key (id) +); + +create table c_user ( + id bigint auto_increment not null, + inactive tinyint(1) default 0, + name varchar(255), + email 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 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 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), + cretime datetime(6) not null, + updtime datetime(6) not null, + version bigint not null, + truck_ref_id integer, + capacity double, + driver varchar(255), + car_ref_id integer, + constraint pk_vehicle primary key (id) +); + +create table vehicle_driver ( + id integer auto_increment not null, + name varchar(255), + vehicle_id integer, + address_id smallint, + 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 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 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, + version integer not null, + constraint pk_sp_car_wheel primary key (id) +); + +create table wheel ( + id bigint auto_increment not null, + version integer not null, + constraint pk_wheel primary key (id) +); + +create table with_zero ( + id bigint auto_increment not null, + name varchar(255), + parent_id integer, + 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 binary(16) not null, + name varchar(255) 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) +); + +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_bar_foo_id on bar (foo_id); + +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; +create index ix_o_address_country_code on o_address (country_code); + +alter table animals add constraint fk_animals_shelter_id foreign key (shelter_id) references animal_shelter (id) on delete restrict on update restrict; +create index ix_animals_shelter_id on animals (shelter_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_attribute_attribute_holder_id on attribute (attribute_holder_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_id on bbookmark (user_id); + +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; + +alter table ckey_detail add constraint fk_ckey_detail_ckey_parent foreign key (one_key,two_key) references ckey_parent (one_key,two_key) on delete restrict on update restrict; +create index ix_ckey_detail_one_key_two_key on ckey_detail (one_key,two_key); + +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_ckey_parent_assoc_id on ckey_parent (assoc_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_product_configuration_id on calculation_result (product_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_calculation_result_group_configuration_id on calculation_result (group_configuration_id); + +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_car on sp_car_car_wheels (car); + +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_wheels_wheel on sp_car_car_wheels (wheel); + +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_car_accessory_car_id on car_accessory (car_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_configuration_configurations_id on configuration (configurations_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_customer_id on contact (customer_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_group_id on contact (group_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_contact_note_contact_id on contact_note (contact_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_c_conversation_group_id on c_conversation (group_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_billing_address_id on o_customer (billing_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_o_customer_shipping_address_id on o_customer (shipping_address_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_eemb_inner_outer_id on eemb_inner (outer_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_einvoice_person_id on einvoice (person_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_enull_collection_detail_enull_collection_id on enull_collection_detail (enull_collection_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_a_b_id on eopt_one_a (b_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_eopt_one_b_c_id on eopt_one_b (c_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_evanilla_collection_detail_evanilla_collection_id on evanilla_collection_detail (evanilla_collection_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_td_child_parent_id on td_child (parent_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_imrelated_owner_id on imrelated (owner_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; +create index ix_info_contact_company_id on info_contact (company_id); + +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; + +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_drel_invoice_booking on drel_invoice (booking); + +alter table item add constraint fk_item_type foreign key (customer,type) references type (customer,type) on delete restrict on update restrict; +create index ix_item_customer_type on item (customer,type); + +alter table item add constraint fk_item_region foreign key (customer,region) references region (customer,type) on delete restrict on update restrict; +create index ix_item_customer_region on item (customer,region); + +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_level1_id on level1_level4 (level1_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_level4_level4_id on level1_level4 (level4_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_level1_id on level1_level2 (level1_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_level1_level2_level2_id on level1_level2 (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_level2_id on level2_level3 (level2_id); + +alter table level2_level3 add constraint fk_level2_level3_level3 foreign key (level3_id) references level3 (id) on delete restrict on update restrict; +create index ix_level2_level3_level3_id on level2_level3 (level3_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_la_attr_value_id on la_attr_value_attribute (la_attr_value_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_la_attr_value_attribute_attribute_id on la_attr_value_attribute (attribute_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; +create index ix_mprinter_current_state_id on mprinter (current_state_id); + +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; + +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_mprinter_state_printer_id on mprinter_state (printer_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_mprofile_picture_id on mprofile (picture_id); + +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_mrole_roleid on mrole_muser (mrole_roleid); + +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_mrole_muser_muser_userid on mrole_muser (muser_userid); + +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_muser_user_type_id on muser (user_type_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_conversation_id on c_message (conversation_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; +create index ix_c_message_user_id on c_message (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_user_user_id on mnoc_user_mnoc_role (mnoc_user_user_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_mnoc_user_mnoc_role_mnoc_role_role_id on mnoc_user_mnoc_role (mnoc_role_role_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_mp_role_mp_user_id on mp_role (mp_user_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_my_lob_size_join_many_parent_id on my_lob_size_join_many (parent_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_cached_bean_id on o_cached_bean_country (o_cached_bean_id); + +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_country_o_country_code on o_cached_bean_country (o_country_code); + +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; +create index ix_o_cached_bean_child_cached_bean_id on o_cached_bean_child (cached_bean_id); + +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; + +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_kcustomer_id on o_order (kcustomer_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_order_id on o_order_detail (order_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_o_order_detail_product_id on o_order_detail (product_id); + +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_s_order_items_order_uuid on s_order_items (order_uuid); + +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_or_order_ship_order_id on or_order_ship (order_id); + +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 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; + +alter table pallet_location add constraint fk_pallet_location_zone_sid foreign key (zone_sid) references zones (id) on delete restrict on update restrict; +create index ix_pallet_location_zone_sid on pallet_location (zone_sid); + +alter table parcel_location add constraint fk_parcel_location_parcelid foreign key (parcelid) references parcel (parcelid) on delete restrict on update restrict; + +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_parent_id on rawinherit_parent_rawinherit_data (rawinherit_parent_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_rawinherit_parent_rawinherit_data_rawinherit_data_id on rawinherit_parent_rawinherit_data (rawinherit_data_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_conversation_id on c_participation (conversation_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_c_participation_user_id on c_participation (user_id); + +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; + +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_default_address_oid on person (default_address_oid); + +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_phones_person_id on phones (person_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_pp_id on pp_to_ww (pp_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_pp_to_ww_ww_id on pp_to_ww (ww_id); + +alter table r_orders add constraint fk_r_orders_rcustomer foreign key (company,customername) references rcustomer (company,name) on delete restrict on update restrict; +create index ix_r_orders_company_customername on r_orders (company,customername); + +alter table resourcefile add constraint fk_resourcefile_parentresourcefileid foreign key (parentresourcefileid) references resourcefile (id) on delete restrict on update restrict; +create index ix_resourcefile_parentresourcefileid on resourcefile (parentresourcefileid); + +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_tenant_id on mt_role (tenant_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_role_id on mt_role_permission (mt_role_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_mt_role_permission_mt_permission_id on mt_role_permission (mt_permission_id); + +alter table f_second add constraint fk_f_second_first foreign key (first) references f_first (id) on delete restrict on update restrict; + +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_section_article_id on section (article_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_parent_parent_id on self_parent (parent_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_customer_referred_by_id on self_ref_customer (referred_by_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; +create index ix_self_ref_example_parent_id on self_ref_example (parent_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_stockforecast_inner_report_id on stockforecast (inner_report_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_sub_section_section_id on sub_section (section_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_t_detail_with_other_namexxxyy_master_id on t_detail_with_other_namexxxyy (master_id); + +alter table ts_detail_two add constraint fk_ts_detail_two_master_id foreign key (master_id) references ts_master_two (id) on delete restrict on update restrict; +create index ix_ts_detail_two_master_id on ts_detail_two (master_id); + +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; +create index ix_twheel_owner_plate_no on twheel (owner_plate_no); + +alter table tire add constraint fk_tire_wheel foreign key (wheel) references wheel (id) on delete restrict on update restrict; + +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_vehicle_driver_id on trip (vehicle_driver_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_trip_address_id on trip (address_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_type_sub_type_id on type (sub_type_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_ut_detail_utmaster_id on ut_detail (utmaster_id); + +alter table uutwo add constraint fk_uutwo_master_id foreign key (master_id) references uuone (id) on delete restrict on update restrict; +create index ix_uutwo_master_id on uutwo (master_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_c_user_group_id on c_user (group_id); + +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; + +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_user_id on em_user_role (user_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_em_user_role_role_id on em_user_role (role_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_truck_ref_id on vehicle (truck_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_car_ref_id on vehicle (car_ref_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_vehicle_id on vehicle_driver (vehicle_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_vehicle_driver_address_id on vehicle_driver (address_id); + +alter table warehouses add constraint fk_warehouses_officezoneid foreign key (officezoneid) references zones (id) on delete restrict on update restrict; +create index ix_warehouses_officezoneid on warehouses (officezoneid); + +alter table warehousesshippingzones add constraint fk_warehousesshippingzones_warehouses foreign key (warehouseid) references warehouses (id) on delete restrict on update restrict; +create index ix_warehousesshippingzones_warehouseid on warehousesshippingzones (warehouseid); + +alter table warehousesshippingzones add constraint fk_warehousesshippingzones_zones foreign key (shippingzoneid) references zones (id) on delete restrict on update restrict; +create index ix_warehousesshippingzones_shippingzoneid on warehousesshippingzones (shippingzoneid); + +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_tire on sa_wheel (tire); + +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_sa_wheel_car on sa_wheel (car); + +alter table with_zero add constraint fk_with_zero_parent_id foreign key (parent_id) references parent (id) on delete restrict on update restrict; +create index ix_with_zero_parent_id on with_zero (parent_id); + diff --git a/src/test/ddl-review/mysql-drop.sql b/src/test/ddl-review/mysql-drop.sql new file mode 100644 index 000000000..592b8a5e6 --- /dev/null +++ b/src/test/ddl-review/mysql-drop.sql @@ -0,0 +1,764 @@ +alter table bar drop foreign key fk_bar_foo_id; +drop index ix_bar_foo_id on bar; + +alter table o_address drop foreign key fk_o_address_country_code; +drop index ix_o_address_country_code on o_address; + +alter table animals drop foreign key fk_animals_shelter_id; +drop index ix_animals_shelter_id on animals; + +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 drel_booking drop foreign key fk_drel_booking_agent_invoice; + +alter table drel_booking drop foreign key fk_drel_booking_client_invoice; + +alter table ckey_detail drop foreign key fk_ckey_detail_ckey_parent; +drop index ix_ckey_detail_one_key_two_key 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 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_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_wheel on sp_car_car_wheels; + +alter table car_accessory drop foreign key fk_car_accessory_car_id; +drop index ix_car_accessory_car_id on car_accessory; + +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 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 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 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 td_child drop foreign key fk_td_child_parent_id; +drop index ix_td_child_parent_id on td_child; + +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_type; +drop index ix_item_customer_type on item; + +alter table item drop foreign key fk_item_region; +drop index ix_item_customer_region on item; + +alter table level1_level4 drop foreign key fk_level1_level4_level1; +drop index ix_level1_level4_level1_id on level1_level4; + +alter table level1_level4 drop foreign key fk_level1_level4_level4; +drop index ix_level1_level4_level4_id on level1_level4; + +alter table level1_level2 drop foreign key fk_level1_level2_level1; +drop index ix_level1_level2_level1_id on level1_level2; + +alter table level1_level2 drop foreign key fk_level1_level2_level2; +drop index ix_level1_level2_level2_id on level1_level2; + +alter table level2_level3 drop foreign key fk_level2_level3_level2; +drop index ix_level2_level3_level2_id on level2_level3; + +alter table level2_level3 drop foreign key fk_level2_level3_level3; +drop index ix_level2_level3_level3_id on level2_level3; + +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_id 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_id on la_attr_value_attribute; + +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_roleid on mrole_muser; + +alter table mrole_muser drop foreign key fk_mrole_muser_muser; +drop index ix_mrole_muser_muser_userid 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 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 mnoc_user_mnoc_role drop foreign key fk_mnoc_user_mnoc_role_mnoc_user; +drop index ix_mnoc_user_mnoc_role_mnoc_user_user_id 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_role_id on mnoc_user_mnoc_role; + +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 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_cached_bean_country drop foreign key fk_o_cached_bean_country_o_cached_bean; +drop index ix_o_cached_bean_country_o_cached_bean_id 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_code 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 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 oto_child drop foreign key fk_oto_child_master_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_id 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_id on rawinherit_parent_rawinherit_data; + +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 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 phones drop foreign key fk_phones_person_id; +drop index ix_phones_person_id on phones; + +alter table pp_to_ww drop foreign key fk_pp_to_ww_pp; +drop index ix_pp_to_ww_pp_id on pp_to_ww; + +alter table pp_to_ww drop foreign key fk_pp_to_ww_wview; +drop index ix_pp_to_ww_ww_id on pp_to_ww; + +alter table r_orders drop foreign key fk_r_orders_rcustomer; +drop index ix_r_orders_company_customername on r_orders; + +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_id 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_id on mt_role_permission; + +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 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 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 ts_detail_two drop foreign key fk_ts_detail_two_master_id; +drop index ix_ts_detail_two_master_id on ts_detail_two; + +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 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 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 c_user drop foreign key fk_c_user_group_id; +drop index ix_c_user_group_id on c_user; + +alter table oto_user drop foreign key fk_oto_user_account_id; + +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_truck_ref_id; +drop index ix_vehicle_truck_ref_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_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_warehouseid on warehousesshippingzones; + +alter table warehousesshippingzones drop foreign key fk_warehousesshippingzones_zones; +drop index ix_warehousesshippingzones_shippingzoneid 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 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 oto_account; + +drop table if exists o_address; + +drop table if exists address; + +drop table if exists animals; + +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_user; + +drop table if exists bsimple_with_gen; + +drop table if exists bwith_qident; + +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 ckey_assoc; + +drop table if exists ckey_detail; + +drop table if exists ckey_parent; + +drop table if exists calculation_result; + +drop table if exists cao_bean; + +drop table if exists sa_car; + +drop table if exists sp_car_car; + +drop table if exists sp_car_car_wheels; + +drop table if exists car_accessory; + +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 c_conversation; + +drop table if exists o_country; + +drop table if exists o_customer; + +drop table if exists dexh_entity; + +drop table if exists dperson; + +drop table if exists rawinherit_data; + +drop table if exists e_basic; + +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_basic_enum_id; + +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_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 e_basic_ndc; + +drop table if exists e_basicver; + +drop table if exists e_basic_withlife; + +drop table if exists e_basicverucon; + +drop table if exists eemb_inner; + +drop table if exists eemb_outer; + +drop table if exists egen_props; + +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 eperson; + +drop table if exists esimple; + +drop table if exists esome_type; + +drop table if exists etrans_many; + +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 td_child; + +drop table if exists td_parent; + +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 c_group; + +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 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 table if exists la_attr_value; + +drop table if exists la_attr_value_attribute; + +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 map_super_actual; + +drop table if exists c_message; + +drop table if exists mnoc_role; + +drop table if exists mnoc_user; + +drop table if exists mnoc_user_mnoc_role; + +drop table if exists mp_role; + +drop table if exists mp_user; + +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_cached_bean; + +drop table if exists o_cached_bean_country; + +drop table if exists o_cached_bean_child; + +drop table if exists ocar; + +drop table if exists oengine; + +drop table if exists ogear_box; + +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 oto_child; + +drop table if exists oto_master; + +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 c_participation; + +drop table if exists mt_permission; + +drop table if exists persistent_file; + +drop table if exists persistent_file_content; + +drop table if exists persons; + +drop table if exists person; + +drop table if exists phones; + +drop table if exists o_product; + +drop table if exists pp; + +drop table if exists pp_to_ww; + +drop table if exists rcustomer; + +drop table if exists r_orders; + +drop table if exists region; + +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 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 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 stockforecast; + +drop table if exists sub_section; + +drop table if exists sub_type; + +drop table if exists tbytes_only; + +drop table if exists tcar; + +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 ts_detail_two; + +drop table if exists t_atable_thatisrelatively; + +drop table if exists ts_master_two; + +drop table if exists tuuid_entity; + +drop table if exists twheel; + +drop table if exists twith_pre_insert; + +drop table if exists mt_tenant; + +drop table if exists sa_tire; + +drop table if exists tire; + +drop table if exists trip; + +drop table if exists truck_ref; + +drop table if exists type; + +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 em_user; + +drop table if exists tx_user; + +drop table if exists c_user; + +drop table if exists oto_user; + +drop table if exists em_user_role; + +drop table if exists vehicle; + +drop table if exists vehicle_driver; + +drop table if exists warehouses; + +drop table if exists warehousesshippingzones; + +drop table if exists sa_wheel; + +drop table if exists sp_car_wheel; + +drop table if exists wheel; + +drop table if exists with_zero; + +drop table if exists parent; + +drop table if exists wview; + +drop table if exists zones; + diff --git a/src/test/ddl-review/ora-create.sql b/src/test/ddl-review/ora-create.sql new file mode 100644 index 000000000..f857a9ecf --- /dev/null +++ b/src/test/ddl-review/ora-create.sql @@ -0,0 +1,2248 @@ +create table asimple_bean ( + id number(19) not null, + name varchar2(255), + constraint pk_asimple_bean primary key (id) +); +create sequence asimple_bean_seq; + +create table bar ( + bar_type varchar2(31) not null, + bar_id number(10) not null, + foo_id number(10) not null, + version number(10) not null, + constraint pk_bar primary key (bar_id) +); +create sequence bar_seq; + +create table oto_account ( + id number(19) 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 sequence oto_account_seq; + +create table o_address ( + id number(5) 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 sequence o_address_seq; + +create table address ( + oid number(19) not null, + street varchar2(255), + version number(10) not null, + constraint pk_address primary key (oid) +); +create sequence address_seq; + +create table animals ( + species varchar2(31) not null, + id number(19) not null, + shelter_id number(19), + version number(19) not null, + name varchar2(255), + registration_number varchar2(255), + date_of_birth date, + constraint pk_animals primary key (id) +); +create sequence animals_seq; + +create table animal_shelter ( + id number(19) not null, + name varchar2(255), + version number(19) not null, + constraint pk_animal_shelter primary key (id) +); +create sequence animal_shelter_seq; + +create table article ( + id number(10) 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 sequence article_seq; + +create table attribute ( + option_type number(31) not null, + id number(10) 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 sequence attribute_seq; + +create table attribute_holder ( + id number(10) not null, + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_attribute_holder primary key (id) +); +create sequence attribute_holder_seq; + +create table audit_log ( + id number(19) not null, + description varchar2(255), + modified_description varchar2(255), + constraint pk_audit_log primary key (id) +); +create sequence audit_log_seq; + +create table bbookmark ( + id number(10) not null, + bookmark_reference varchar2(255), + user_id number(10), + constraint pk_bbookmark primary key (id) +); +create sequence bbookmark_seq; + +create table bbookmark_user ( + id number(10) not null, + name varchar2(255), + password varchar2(255), + email_address varchar2(255), + country varchar2(255), + constraint pk_bbookmark_user primary key (id) +); +create sequence bbookmark_user_seq; + +create table bsimple_with_gen ( + id number(10) not null, + name varchar2(255), + constraint pk_bsimple_with_gen primary key (id) +); +create sequence bsimple_with_gen_seq; + +create table bwith_qident ( + id number(10) not null, + "Name" varchar2(255), + last_updated timestamp not null, + constraint uq_bwith_qident_name unique ("Name"), + constraint pk_bwith_qident primary key (id) +); +create sequence bwith_qident_seq; + +create table basic_joda_entity ( + id number(19) not null, + name varchar2(255), + created timestamp not null, + updated timestamp not null, + version timestamp not null, + constraint pk_basic_joda_entity primary key (id) +); +create sequence basic_joda_entity_seq; + +create table bean_with_time_zone ( + id number(19) not null, + name varchar2(255), + timezone varchar2(20), + constraint pk_bean_with_time_zone primary key (id) +); +create sequence bean_with_time_zone_seq; + +create table drel_booking ( + id number(19) not null, + agent_invoice number(19), + client_invoice number(19), + version number(10) not null, + constraint uq_drel_booking_agent_invoice unique (agent_invoice), + constraint uq_drel_booking_client_invo_2 unique (client_invoice), + constraint pk_drel_booking primary key (id) +); +create sequence drel_booking_seq; + +create table ckey_assoc ( + id number(10) not null, + assoc_one varchar2(255), + constraint pk_ckey_assoc primary key (id) +); +create sequence ckey_assoc_seq; + +create table ckey_detail ( + id number(10) not null, + something varchar2(255), + one_key number(10), + two_key varchar2(255), + constraint pk_ckey_detail primary key (id) +); +create sequence ckey_detail_seq; + +create table ckey_parent ( + one_key number(10) not null, + two_key varchar2(255) 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 calculation_result ( + id number(10) not null, + charge number(19,4), + product_configuration_id number(10), + group_configuration_id number(10), + constraint pk_calculation_result primary key (id) +); +create sequence calculation_result_seq; + +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 sa_car ( + id number(19) not null, + version number(10) not null, + constraint pk_sa_car primary key (id) +); +create sequence sa_car_seq; + +create table sp_car_car ( + id number(19) not null, + version number(10) not null, + constraint pk_sp_car_car primary key (id) +); +create sequence sp_car_car_seq; + +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 car_accessory ( + id number(10) not null, + name varchar2(255), + 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 sequence car_accessory_seq; + +create table configuration ( + type varchar2(31) not null, + id number(10) not null, + name varchar2(255), + configurations_id number(10), + group_name varchar2(255), + product_name varchar2(255), + constraint pk_configuration primary key (id) +); +create sequence configuration_seq; + +create table configurations ( + id number(10) not null, + name varchar2(255), + constraint pk_configurations primary key (id) +); +create sequence configurations_seq; + +create table contact ( + id number(10) not null, + first_name varchar2(255), + last_name varchar2(255), + phone varchar2(255), + mobile varchar2(255), + email varchar2(255), + 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 sequence contact_seq; + +create table contact_group ( + id number(10) 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 sequence contact_group_seq; + +create table contact_note ( + id number(10) 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 sequence contact_note_seq; + +create table c_conversation ( + id number(19) not null, + title varchar2(255), + isopen number(1), + 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 sequence c_conversation_seq; + +create table o_country ( + code varchar2(2) not null, + name varchar2(60), + constraint pk_o_country primary key (code) +); + +create table o_customer ( + id number(10) not null, + status varchar2(1), + name varchar2(40) not null, + smallnote varchar2(100), + anniversary date, + billing_address_id number(5), + shipping_address_id number(5), + 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) +); +create sequence o_customer_seq; + +create table dexh_entity ( + oid number(19) not null, + exhange_rate number(38), + exhange_cmoney_amount number(38), + exhange_cmoney_currency varchar2(3), + last_updated timestamp not null, + constraint pk_dexh_entity primary key (oid) +); +create sequence dexh_entity_seq; + +create table dperson ( + id number(19) not null, + first_name varchar2(255), + last_name varchar2(255), + salary number(38), + a_amt number(38), + a_curr varchar2(3), + i_start timestamp, + i_end timestamp, + constraint pk_dperson primary key (id) +); +create sequence dperson_seq; + +create table rawinherit_data ( + id number(19) not null, + val number(10), + constraint pk_rawinherit_data primary key (id) +); +create sequence rawinherit_data_seq; + +create table e_basic ( + id number(10) not null, + status varchar2(1), + name varchar2(255), + 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 sequence e_basic_seq; + +create table ebasic_clob ( + id number(19) not null, + name varchar2(255), + title varchar2(255), + description clob, + last_update timestamp not null, + constraint pk_ebasic_clob primary key (id) +); +create sequence ebasic_clob_seq; + +create table ebasic_clob_fetch_eager ( + id number(19) 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 sequence ebasic_clob_fetch_eager_seq; + +create table ebasic_clob_no_ver ( + id number(19) not null, + name varchar2(255), + description clob, + constraint pk_ebasic_clob_no_ver primary key (id) +); +create sequence ebasic_clob_no_ver_seq; + +create table e_basicenc ( + id number(10) not null, + name varchar2(255), + description raw(80), + dob raw(20), + last_update timestamp, + constraint pk_e_basicenc primary key (id) +); +create sequence e_basicenc_seq; + +create table e_basicenc_bin ( + id number(10) 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 sequence e_basicenc_bin_seq; + +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 ebasic_json_map ( + id number(19) not null, + name varchar2(255), + content clob, + version number(19) not null, + constraint pk_ebasic_json_map primary key (id) +); +create sequence ebasic_json_map_seq; + +create table ebasic_json_map_blob ( + id number(19) not null, + name varchar2(255), + content blob, + version number(19) not null, + constraint pk_ebasic_json_map_blob primary key (id) +); +create sequence ebasic_json_map_blob_seq; + +create table ebasic_json_map_clob ( + id number(19) not null, + name varchar2(255), + content clob, + version number(19) not null, + constraint pk_ebasic_json_map_clob primary key (id) +); +create sequence ebasic_json_map_clob_seq; + +create table ebasic_json_map_json_b ( + id number(19) not null, + name varchar2(255), + content clob, + version number(19) not null, + constraint pk_ebasic_json_map_json_b primary key (id) +); +create sequence ebasic_json_map_json_b_seq; + +create table ebasic_json_map_varchar ( + id number(19) not null, + name varchar2(255), + content varchar2(3000), + version number(19) not null, + constraint pk_ebasic_json_map_varchar primary key (id) +); +create sequence ebasic_json_map_varchar_seq; + +create table ebasic_json_node ( + id number(19) not null, + name varchar2(255), + content clob, + version number(19) not null, + constraint pk_ebasic_json_node primary key (id) +); +create sequence ebasic_json_node_seq; + +create table ebasic_json_node_blob ( + id number(19) not null, + name varchar2(255), + content blob, + version number(19) not null, + constraint pk_ebasic_json_node_blob primary key (id) +); +create sequence ebasic_json_node_blob_seq; + +create table ebasic_json_node_json_b ( + id number(19) not null, + name varchar2(255), + content clob, + version number(19) not null, + constraint pk_ebasic_json_node_json_b primary key (id) +); +create sequence ebasic_json_node_json_b_seq; + +create table ebasic_json_node_varchar ( + id number(19) not null, + name varchar2(255), + content varchar2(1000), + version number(19) not null, + constraint pk_ebasic_json_node_varchar primary key (id) +); +create sequence ebasic_json_node_varchar_seq; + +create table e_basic_ndc ( + id number(10) not null, + name varchar2(255), + constraint pk_e_basic_ndc primary key (id) +); +create sequence e_basic_ndc_seq; + +create table e_basicver ( + id number(10) not null, + name varchar2(255), + description varchar2(255), + other varchar2(255), + last_update timestamp not null, + constraint pk_e_basicver primary key (id) +); +create sequence e_basicver_seq; + +create table e_basic_withlife ( + id number(19) not null, + name varchar2(255), + version number(19) not null, + constraint pk_e_basic_withlife primary key (id) +); +create sequence e_basic_withlife_seq; + +create table e_basicverucon ( + id number(10) not null, + name varchar2(255), + other varchar2(255), + other_one varchar2(255), + description varchar2(255), + last_update timestamp not null, + constraint uq_e_basicverucon_name unique (name), + constraint pk_e_basicverucon primary key (id) +); +create sequence e_basicverucon_seq; + +create table eemb_inner ( + id number(10) not null, + nome_inner varchar2(255), + outer_id number(10), + update_count number(10) not null, + constraint pk_eemb_inner primary key (id) +); +create sequence eemb_inner_seq; + +create table eemb_outer ( + id number(10) not null, + nome_outer varchar2(255), + date1 timestamp, + date2 timestamp, + update_count number(10) not null, + constraint pk_eemb_outer primary key (id) +); +create sequence eemb_outer_seq; + +create table egen_props ( + id number(19) 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, + long_created number(19) not null, + long_updated number(19) not null, + constraint pk_egen_props primary key (id) +); +create sequence egen_props_seq; + +create table einvoice ( + id number(19) not null, + invoice_date timestamp, + state number(10), + person_id number(19), + ship_street varchar2(255), + ship_suburb varchar2(255), + ship_city varchar2(255), + street varchar2(255), + suburb varchar2(255), + city varchar2(255), + version number(19) not null, + constraint ck_einvoice_state check (state in (0,1,2)), + constraint pk_einvoice primary key (id) +); +create sequence einvoice_seq; + +create table e_main ( + id number(10) not null, + name varchar2(255), + description varchar2(255), + version number(19) not null, + constraint pk_e_main primary key (id) +); +create sequence e_main_seq; + +create table enull_collection ( + id number(10) not null, + name varchar2(255), + constraint pk_enull_collection primary key (id) +); +create sequence enull_collection_seq; + +create table enull_collection_detail ( + id number(10) not null, + enull_collection_id number(10) not null, + something varchar2(255), + constraint pk_enull_collection_detail primary key (id) +); +create sequence enull_collection_detail_seq; + +create table eopt_one_a ( + id number(10) 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 sequence eopt_one_a_seq; + +create table eopt_one_b ( + id number(10) 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 sequence eopt_one_b_seq; + +create table eopt_one_c ( + id number(10) 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 sequence eopt_one_c_seq; + +create table eperson ( + id number(19) not null, + name varchar2(255), + notes varchar2(255), + street varchar2(255), + suburb varchar2(255), + city varchar2(255), + version number(19) not null, + constraint pk_eperson primary key (id) +); +create sequence eperson_seq; + +create table esimple ( + usertypeid number(10) not null, + name varchar2(255), + constraint pk_esimple primary key (usertypeid) +); +create sequence esimple_seq; + +create table esome_type ( + id number(10) not null, + currency varchar2(3), + locale varchar2(20), + time_zone varchar2(20), + constraint pk_esome_type primary key (id) +); +create sequence esome_type_seq; + +create table etrans_many ( + id number(10) not null, + name varchar2(255), + constraint pk_etrans_many primary key (id) +); +create sequence etrans_many_seq; + +create table evanilla_collection ( + id number(10) not null, + name varchar2(255), + constraint pk_evanilla_collection primary key (id) +); +create sequence evanilla_collection_seq; + +create table evanilla_collection_detail ( + id number(10) not null, + evanilla_collection_id number(10) not null, + something varchar2(255), + constraint pk_evanilla_collection_detail primary key (id) +); +create sequence evanilla_collection_detail_seq; + +create table ewho_props ( + id number(19) not null, + name varchar2(255), + who_created varchar2(255) not null, + who_modified varchar2(255) not null, + version number(19) not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_ewho_props primary key (id) +); +create sequence ewho_props_seq; + +create table e_withinet ( + id number(19) not null, + name varchar2(255), + inet_address varchar2(50), + version number(19) not null, + constraint pk_e_withinet primary key (id) +); +create sequence e_withinet_seq; + +create table td_child ( + child_id number(10) not null, + child_name varchar2(255), + parent_id number(10) not null, + constraint pk_td_child primary key (child_id) +); +create sequence td_child_seq; + +create table td_parent ( + parent_type varchar2(31) not null, + parent_id number(10) not null, + parent_name varchar2(255), + extended_name varchar2(255), + constraint pk_td_parent primary key (parent_id) +); +create sequence td_parent_seq; + +create table feature_desc ( + id number(10) not null, + name varchar2(255), + description varchar2(255), + constraint pk_feature_desc primary key (id) +); +create sequence feature_desc_seq; + +create table f_first ( + id number(19) not null, + name varchar2(255), + constraint pk_f_first primary key (id) +); +create sequence f_first_seq; + +create table foo ( + foo_id number(10) not null, + important_text varchar2(255), + version number(10) not null, + constraint pk_foo primary key (foo_id) +); +create sequence foo_seq; + +create table gen_key_identity ( + id number(19) not null, + description varchar2(255), + constraint pk_gen_key_identity primary key (id) +); +create sequence gen_key_identity_seq; + +create table gen_key_sequence ( + id number(19) not null, + description varchar2(255), + constraint pk_gen_key_sequence primary key (id) +); +create sequence seq; + +create table gen_key_table ( + id number(19) not null, + description varchar2(255), + constraint pk_gen_key_table primary key (id) +); +create sequence gen_key_table_seq; + +create table c_group ( + id number(19) not null, + inactive number(1), + 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 sequence c_group_seq; + +create table imrelated ( + id number(19) not null, + name varchar2(255), + owner_id number(19) not null, + constraint pk_imrelated primary key (id) +); +create sequence imrelated_seq; + +create table imroot ( + dtype varchar2(10) not null, + id number(19) not null, + title varchar2(255), + when_title timestamp, + name varchar2(255), + constraint pk_imroot primary key (id) +); +create sequence imroot_seq; + +create table ixresource ( + dtype varchar2(255), + id raw(16) not null, + name varchar2(255), + constraint pk_ixresource primary key (id) +); + +create table info_company ( + id number(19) not null, + name varchar2(255), + version number(19) not null, + constraint pk_info_company primary key (id) +); +create sequence info_company_seq; + +create table info_contact ( + id number(19) not null, + name varchar2(255), + company_id number(19) not null, + version number(19) not null, + constraint pk_info_contact primary key (id) +); +create sequence info_contact_seq; + +create table info_customer ( + id number(19) 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 sequence info_customer_seq; + +create table inner_report ( + id number(19) 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 sequence inner_report_seq; + +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; + +create table item ( + customer number(10) not null, + itemnumber varchar2(255) not null, + description varchar2(255), + units varchar2(255), + type number(10), + region number(10), + 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 level1 ( + id number(19) not null, + name varchar2(255), + constraint pk_level1 primary key (id) +); +create sequence level1_seq; + +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) not null, + name varchar2(255), + constraint pk_level2 primary key (id) +); +create sequence level2_seq; + +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) not null, + name varchar2(255), + constraint pk_level3 primary key (id) +); +create sequence level3_seq; + +create table level4 ( + id number(19) not null, + name varchar2(255), + constraint pk_level4 primary key (id) +); +create sequence level4_seq; + +create table la_attr_value ( + id number(10) 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 sequence la_attr_value_seq; + +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 mmedia ( + type varchar2(31) not null, + id number(19) not null, + url varchar2(255), + note varchar2(255), + constraint pk_mmedia primary key (id) +); +create sequence mmedia_seq; + +create table non_updateprop ( + id number(10) 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 sequence non_updateprop_seq; + +create table mprinter ( + id number(19) 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_mprinter_last_swap_magen_2 unique (last_swap_magenta_id), + constraint uq_mprinter_last_swap_yello_3 unique (last_swap_yellow_id), + constraint uq_mprinter_last_swap_black_4 unique (last_swap_black_id), + constraint pk_mprinter primary key (id) +); +create sequence mprinter_seq; + +create table mprinter_state ( + id number(19) not null, + flags number(19), + printer_id number(19), + version number(19) not null, + constraint pk_mprinter_state primary key (id) +); +create sequence mprinter_state_seq; + +create table mprofile ( + id number(19) not null, + picture_id number(19), + name varchar2(255), + constraint pk_mprofile primary key (id) +); +create sequence mprofile_seq; + +create table mprotected_construct_bean ( + id number(19) not null, + name varchar2(255), + constraint pk_mprotected_construct_bean primary key (id) +); +create sequence mprotected_construct_bean_seq; + +create table mrole ( + roleid number(10) not null, + role_name varchar2(255), + constraint pk_mrole primary key (roleid) +); +create sequence mrole_seq; + +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) not null, + name varchar2(255), + constraint pk_msome_other primary key (id) +); +create sequence msome_other_seq; + +create table muser ( + userid number(10) not null, + user_name varchar2(255), + user_type_id number(10), + constraint pk_muser primary key (userid) +); +create sequence muser_seq; + +create table muser_type ( + id number(10) not null, + name varchar2(255), + constraint pk_muser_type primary key (id) +); +create sequence muser_type_seq; + +create table map_super_actual ( + id number(19) not null, + name varchar2(255), + when_created timestamp not null, + when_updated timestamp not null, + constraint pk_map_super_actual primary key (id) +); +create sequence map_super_actual_seq; + +create table c_message ( + id number(19) 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 sequence c_message_seq; + +create table mnoc_role ( + role_id number(10) not null, + role_name varchar2(255), + version number(10) not null, + constraint pk_mnoc_role primary key (role_id) +); +create sequence mnoc_role_seq; + +create table mnoc_user ( + user_id number(10) not null, + user_name varchar2(255), + version number(10) not null, + constraint pk_mnoc_user primary key (user_id) +); +create sequence mnoc_user_seq; + +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 mp_role ( + id number(19) not null, + mp_user_id number(19) not null, + code varchar2(255), + organization_id number(19), + constraint pk_mp_role primary key (id) +); +create sequence mp_role_seq; + +create table mp_user ( + id number(19) not null, + name varchar2(255), + constraint pk_mp_user primary key (id) +); +create sequence mp_user_seq; + +create table my_lob_size ( + id number(10) not null, + name varchar2(255), + my_count number(10), + my_lob clob, + constraint pk_my_lob_size primary key (id) +); +create sequence my_lob_size_seq; + +create table my_lob_size_join_many ( + id number(10) not null, + something varchar2(255), + other varchar2(255), + parent_id number(10), + constraint pk_my_lob_size_join_many primary key (id) +); +create sequence my_lob_size_join_many_seq; + +create table noidbean ( + name varchar2(255), + subject varchar2(255), + when_created timestamp not null +); + +create table o_cached_bean ( + id number(19) not null, + name varchar2(255), + constraint pk_o_cached_bean primary key (id) +); +create sequence o_cached_bean_seq; + +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) not null, + cached_bean_id number(19), + constraint pk_o_cached_bean_child primary key (id) +); +create sequence o_cached_bean_child_seq; + +create table ocar ( + id number(10) 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 sequence ocar_seq; + +create table oengine ( + engine_id raw(16) 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 raw(16) 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 o_order ( + id number(10) 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 sequence o_order_seq; + +create table o_order_detail ( + id number(10) not null, + order_id number(10), + 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 sequence o_order_detail_seq; + +create table s_orders ( + uuid varchar2(255) not null, + constraint pk_s_orders primary key (uuid) +); + +create table s_order_items ( + uuid varchar2(255) not null, + product_variant_uuid varchar2(255), + order_uuid varchar2(255), + quantity number(10), + amount number(38), + constraint pk_s_order_items primary key (uuid) +); + +create table or_order_ship ( + id number(10) 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 sequence or_order_ship_seq; + +create table oto_child ( + id number(10) 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 sequence oto_child_seq; + +create table oto_master ( + id number(19) not null, + name varchar2(255), + constraint pk_oto_master primary key (id) +); +create sequence oto_master_seq; + +create table pfile ( + id number(10) 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 sequence pfile_seq; + +create table pfile_content ( + id number(10) 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 sequence pfile_content_seq; + +create table paggview ( + pview_id raw(16), + 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) not null, + zone_sid number(10) not null, + attribute varchar2(255), + constraint pk_pallet_location primary key (id) +); +create sequence pallet_location_seq; + +create table parcel ( + parcelid number(19) not null, + description varchar2(255), + constraint pk_parcel primary key (parcelid) +); +create sequence parcel_seq; + +create table parcel_location ( + parcellocid number(19) not null, + location varchar2(255), + parcelid number(19), + constraint uq_parcel_location_parcelid unique (parcelid), + constraint pk_parcel_location primary key (parcellocid) +); +create sequence parcel_location_seq; + +create table rawinherit_parent ( + type varchar2(31) not null, + id number(19) not null, + val number(10), + constraint pk_rawinherit_parent primary key (id) +); +create sequence rawinherit_parent_seq; + +create table rawinherit_parent_rawinherit_d ( + rawinherit_parent_id number(19) not null, + rawinherit_data_id number(19) not null, + constraint pk_rawinherit_parent_rawinh_0 primary key (rawinherit_parent_id,rawinherit_data_id) +); + +create table c_participation ( + id number(19) 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 sequence c_participation_seq; + +create table mt_permission ( + id raw(16) not null, + name varchar2(255), + constraint pk_mt_permission primary key (id) +); + +create table persistent_file ( + id number(10) 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 sequence persistent_file_seq; + +create table persistent_file_content ( + id number(10) not null, + persistent_file_id number(10), + content blob, + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint uq_persistent_file_content__1 unique (persistent_file_id), + constraint pk_persistent_file_content primary key (id) +); +create sequence persistent_file_content_seq; + +create table persons ( + id number(19) not null, + surname varchar2(64) not null, + name varchar2(64) not null, + constraint pk_persons primary key (id) +); +create sequence persons_seq start with 1000 increment by 40; + +create table person ( + oid number(19) not null, + default_address_oid number(19), + version number(10) not null, + constraint pk_person primary key (oid) +); +create sequence person_seq; + +create table phones ( + id number(19) 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 sequence phones_seq; + +create table o_product ( + id number(10) not null, + sku varchar2(20), + name varchar2(255), + cretime timestamp not null, + updtime timestamp not null, + constraint pk_o_product primary key (id) +); +create sequence o_product_seq; + +create table pp ( + id raw(16) not null, + name varchar2(255), + value varchar2(100) not null, + constraint pk_pp primary key (id) +); + +create table pp_to_ww ( + pp_id raw(16) not null, + ww_id raw(16) not null, + constraint pk_pp_to_ww primary key (pp_id,ww_id) +); + +create table rcustomer ( + company varchar2(255) not null, + name varchar2(255) not null, + description varchar2(255), + constraint pk_rcustomer primary key (company,name) +); + +create table r_orders ( + company varchar2(255) not null, + order_number number(10) not null, + customername varchar2(255), + item varchar2(255), + constraint pk_r_orders primary key (company,order_number) +); + +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 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 raw(16) not null, + name varchar2(50), + tenant_id raw(16), + version number(19) not null, + constraint pk_mt_role primary key (id) +); + +create table mt_role_permission ( + mt_role_id raw(16) not null, + mt_permission_id raw(16) not null, + constraint pk_mt_role_permission primary key (mt_role_id,mt_permission_id) +); + +create table em_role ( + id number(19) not null, + name varchar2(255), + constraint pk_em_role primary key (id) +); +create sequence em_role_seq; + +create table f_second ( + id number(19) not null, + first number(19), + title varchar2(255), + constraint uq_f_second_first unique (first), + constraint pk_f_second primary key (id) +); +create sequence f_second_seq; + +create table section ( + id number(10) 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 sequence section_seq; + +create table self_parent ( + id number(19) not null, + name varchar2(255), + parent_id number(19), + version number(19) not null, + constraint pk_self_parent primary key (id) +); +create sequence self_parent_seq; + +create table self_ref_customer ( + id number(19) not null, + name varchar2(255), + referred_by_id number(19), + constraint pk_self_ref_customer primary key (id) +); +create sequence self_ref_customer_seq; + +create table self_ref_example ( + id number(19) not null, + name varchar2(255) not null, + parent_id number(19), + constraint pk_self_ref_example primary key (id) +); +create sequence self_ref_example_seq; + +create table some_enum_bean ( + id number(19) 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 sequence some_enum_bean_seq; + +create table some_file_bean ( + id number(19) not null, + name varchar2(255), + content blob, + version number(19) not null, + constraint pk_some_file_bean primary key (id) +); +create sequence some_file_bean_seq; + +create table some_new_types_bean ( + id number(19) not null, + dow number(1), + mth number(1), + yr number(10), + yr_mth date, + local_date date, + local_date_time timestamp, + offset_date_time timestamp, + zoned_date_time timestamp, + instant timestamp, + zone_id varchar2(60), + zone_offset varchar2(60), + 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 sequence some_new_types_bean_seq; + +create table some_period_bean ( + id number(19) not null, + period_years number(10), + period_months number(10), + period_days number(10), + anniversary date, + version number(19) not null, + constraint pk_some_period_bean primary key (id) +); +create sequence some_period_bean_seq; + +create table stockforecast ( + type varchar2(31) not null, + id number(19) not null, + inner_report_id number(19), + constraint pk_stockforecast primary key (id) +); +create sequence stockforecast_seq; + +create table sub_section ( + id number(10) 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 sequence sub_section_seq; + +create table sub_type ( + sub_type_id number(10) not null, + description varchar2(255), + version number(19) not null, + constraint pk_sub_type primary key (sub_type_id) +); +create sequence sub_type_seq; + +create table tbytes_only ( + id number(10) not null, + content blob, + constraint pk_tbytes_only primary key (id) +); +create sequence tbytes_only_seq; + +create table tcar ( + type varchar2(31) not null, + plate_no varchar2(255) not null, + truckload number(19), + constraint pk_tcar primary key (plate_no) +); + +create table tint_root ( + my_type number(3) not null, + id number(10) not null, + name varchar2(255), + child_property varchar2(255), + constraint pk_tint_root primary key (id) +); +create sequence tint_root_seq; + +create table tjoda_entity ( + id number(10) not null, + local_time timestamp, + constraint pk_tjoda_entity primary key (id) +); +create sequence tjoda_entity_seq; + +create table t_mapsuper1 ( + id number(10) not null, + something varchar2(255), + name varchar2(255), + version number(10) not null, + constraint pk_t_mapsuper1 primary key (id) +); +create sequence t_mapsuper1_seq; + +create table t_oneb ( + id number(10) not null, + name varchar2(255), + description varchar2(255), + active number(1), + constraint pk_t_oneb primary key (id) +); +create sequence t_oneb_seq; + +create table t_detail_with_other_namexxxyy ( + id number(10) not null, + name varchar2(255), + description varchar2(255), + active number(1), + master_id number(10), + constraint pk_t_detail_with_other_name_0 primary key (id) +); +create sequence t_atable_detail_seq; + +create table ts_detail_two ( + id number(10) not null, + name varchar2(255), + description varchar2(255), + active number(1), + master_id number(10), + constraint pk_ts_detail_two primary key (id) +); +create sequence ts_detail_two_seq; + +create table t_atable_thatisrelatively ( + id number(10) not null, + name varchar2(255), + description varchar2(255), + active number(1), + constraint pk_t_atable_thatisrelatively primary key (id) +); +create sequence t_atable_master_seq; + +create table ts_master_two ( + id number(10) not null, + name varchar2(255), + description varchar2(255), + active number(1), + constraint pk_ts_master_two primary key (id) +); +create sequence ts_master_two_seq; + +create table tuuid_entity ( + id raw(16) not null, + name varchar2(255), + constraint pk_tuuid_entity primary key (id) +); + +create table twheel ( + id number(19) not null, + owner_plate_no varchar2(255) not null, + constraint pk_twheel primary key (id) +); +create sequence twheel_seq; + +create table twith_pre_insert ( + id number(10) not null, + name varchar2(255) not null, + title varchar2(255), + constraint pk_twith_pre_insert primary key (id) +); +create sequence twith_pre_insert_seq; + +create table mt_tenant ( + id raw(16) not null, + name varchar2(255), + version number(19) not null, + constraint pk_mt_tenant primary key (id) +); + +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; + +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; + +create table trip ( + id number(10) not null, + vehicle_driver_id number(10), + destination varchar2(255), + address_id number(5), + star_date timestamp, + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + constraint pk_trip primary key (id) +); +create sequence trip_seq; + +create table truck_ref ( + id number(10) not null, + something varchar2(255), + constraint pk_truck_ref primary key (id) +); +create sequence truck_ref_seq; + +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 ut_detail ( + id number(10) 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 sequence ut_detail_seq; + +create table ut_master ( + id number(10) not null, + name varchar2(255), + description varchar2(255), + version number(10) not null, + constraint pk_ut_master primary key (id) +); +create sequence ut_master_seq; + +create table uuone ( + id raw(16) not null, + name varchar2(255), + constraint pk_uuone primary key (id) +); + +create table uutwo ( + id raw(16) not null, + name varchar2(255), + master_id raw(16), + constraint pk_uutwo primary key (id) +); + +create table em_user ( + id number(19) not null, + name varchar2(255), + constraint pk_em_user primary key (id) +); +create sequence em_user_seq; + +create table tx_user ( + id number(19) not null, + name varchar2(255), + constraint pk_tx_user primary key (id) +); +create sequence tx_user_seq; + +create table c_user ( + id number(19) not null, + inactive number(1), + name varchar2(255), + email 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 sequence c_user_seq; + +create table oto_user ( + id number(19) 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 sequence oto_user_seq; + +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) not null, + license_number varchar2(255), + registration_date timestamp, + cretime timestamp not null, + updtime timestamp not null, + version number(19) not null, + truck_ref_id number(10), + capacity number(19,4), + driver varchar2(255), + car_ref_id number(10), + constraint pk_vehicle primary key (id) +); +create sequence vehicle_seq; + +create table vehicle_driver ( + id number(10) not null, + name varchar2(255), + vehicle_id number(10), + address_id number(5), + 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 sequence vehicle_driver_seq; + +create table warehouses ( + id number(10) not null, + officezoneid number(10), + constraint pk_warehouses primary key (id) +); +create sequence warehouses_seq; + +create table warehousesshippingzones ( + warehouseid number(10) not null, + shippingzoneid number(10) not null, + constraint pk_warehousesshippingzones primary key (warehouseid,shippingzoneid) +); + +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; + +create table sp_car_wheel ( + id number(19) not null, + version number(10) not null, + constraint pk_sp_car_wheel primary key (id) +); +create sequence sp_car_wheel_seq; + +create table wheel ( + id number(19) not null, + version number(10) not null, + constraint pk_wheel primary key (id) +); +create sequence wheel_seq; + +create table with_zero ( + id number(19) not null, + name varchar2(255), + parent_id number(10), + version number(19) not null, + constraint pk_with_zero primary key (id) +); +create sequence with_zero_seq; + +create table parent ( + id number(10) not null, + name varchar2(255), + constraint pk_parent primary key (id) +); +create sequence parent_seq; + +create table wview ( + id raw(16) not null, + name varchar2(255) 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) not null, + attribute varchar2(255), + constraint pk_zones primary key (id) +); +create sequence zones_seq; + +alter table bar add constraint fk_bar_foo_id foreign key (foo_id) references foo (foo_id); +create index ix_bar_foo_id on bar (foo_id); + +alter table o_address add constraint fk_o_address_country_code foreign key (country_code) references o_country (code); +create index ix_o_address_country_code on o_address (country_code); + +alter table animals add constraint fk_animals_shelter_id foreign key (shelter_id) references animal_shelter (id); +create index ix_animals_shelter_id on animals (shelter_id); + +alter table attribute add constraint fk_attribute_attribute_hold_1 foreign key (attribute_holder_id) references attribute_holder (id); +create index ix_attribute_attribute_hold_1 on attribute (attribute_holder_id); + +alter table bbookmark add constraint fk_bbookmark_user_id foreign key (user_id) references bbookmark_user (id); +create index ix_bbookmark_user_id on bbookmark (user_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_invo_2 foreign key (client_invoice) references drel_invoice (id); + +alter table ckey_detail add constraint fk_ckey_detail_ckey_parent foreign key (one_key,two_key) references ckey_parent (one_key,two_key); +create index ix_ckey_detail_one_key_two__1 on ckey_detail (one_key,two_key); + +alter table ckey_parent add constraint fk_ckey_parent_assoc_id foreign key (assoc_id) references ckey_assoc (id); +create index ix_ckey_parent_assoc_id on ckey_parent (assoc_id); + +alter table calculation_result add constraint fk_calculation_result_produ_1 foreign key (product_configuration_id) references configuration (id); +create index ix_calculation_result_produ_1 on calculation_result (product_configuration_id); + +alter table calculation_result add constraint fk_calculation_result_group_2 foreign key (group_configuration_id) references configuration (id); +create index ix_calculation_result_group_2 on calculation_result (group_configuration_id); + +alter table sp_car_car_wheels add constraint fk_sp_car_car_wheels_sp_car_1 foreign key (car) references sp_car_car (id); +create index ix_sp_car_car_wheels_car on sp_car_car_wheels (car); + +alter table sp_car_car_wheels add constraint fk_sp_car_car_wheels_sp_car_2 foreign key (wheel) references sp_car_wheel (id); +create index ix_sp_car_car_wheels_wheel on sp_car_car_wheels (wheel); + +alter table car_accessory add constraint fk_car_accessory_car_id foreign key (car_id) references vehicle (id); +create index ix_car_accessory_car_id on car_accessory (car_id); + +alter table configuration add constraint fk_configuration_configurat_1 foreign key (configurations_id) references configurations (id); +create index ix_configuration_configurat_1 on configuration (configurations_id); + +alter table contact add constraint fk_contact_customer_id foreign key (customer_id) references o_customer (id); +create index ix_contact_customer_id on contact (customer_id); + +alter table contact add constraint fk_contact_group_id foreign key (group_id) references contact_group (id); +create index ix_contact_group_id on contact (group_id); + +alter table contact_note add constraint fk_contact_note_contact_id foreign key (contact_id) references contact (id); +create index ix_contact_note_contact_id on contact_note (contact_id); + +alter table c_conversation add constraint fk_c_conversation_group_id foreign key (group_id) references c_group (id); +create index ix_c_conversation_group_id on c_conversation (group_id); + +alter table o_customer add constraint fk_o_customer_billing_addre_1 foreign key (billing_address_id) references o_address (id); +create index ix_o_customer_billing_addre_1 on o_customer (billing_address_id); + +alter table o_customer add constraint fk_o_customer_shipping_addr_2 foreign key (shipping_address_id) references o_address (id); +create index ix_o_customer_shipping_addr_2 on o_customer (shipping_address_id); + +alter table eemb_inner add constraint fk_eemb_inner_outer_id foreign key (outer_id) references eemb_outer (id); +create index ix_eemb_inner_outer_id on eemb_inner (outer_id); + +alter table einvoice add constraint fk_einvoice_person_id foreign key (person_id) references eperson (id); +create index ix_einvoice_person_id on einvoice (person_id); + +alter table enull_collection_detail add constraint fk_enull_collection_detail__1 foreign key (enull_collection_id) references enull_collection (id); +create index ix_enull_collection_detail__1 on enull_collection_detail (enull_collection_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_a_b_id on eopt_one_a (b_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_eopt_one_b_c_id on eopt_one_b (c_id); + +alter table evanilla_collection_detail add constraint fk_evanilla_collection_deta_1 foreign key (evanilla_collection_id) references evanilla_collection (id); +create index ix_evanilla_collection_deta_1 on evanilla_collection_detail (evanilla_collection_id); + +alter table td_child add constraint fk_td_child_parent_id foreign key (parent_id) references td_parent (parent_id); +create index ix_td_child_parent_id on td_child (parent_id); + +alter table imrelated add constraint fk_imrelated_owner_id foreign key (owner_id) references imroot (id); +create index ix_imrelated_owner_id on imrelated (owner_id); + +alter table info_contact add constraint fk_info_contact_company_id foreign key (company_id) references info_company (id); +create index ix_info_contact_company_id on info_contact (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); + +alter table drel_invoice add constraint fk_drel_invoice_booking foreign key (booking) references drel_booking (id); +create index ix_drel_invoice_booking on drel_invoice (booking); + +alter table item add constraint fk_item_type foreign key (customer,type) references type (customer,type); +create index ix_item_customer_type on item (customer,type); + +alter table item add constraint fk_item_region foreign key (customer,region) references region (customer,type); +create index ix_item_customer_region on item (customer,region); + +alter table level1_level4 add constraint fk_level1_level4_level1 foreign key (level1_id) references level1 (id); +create index ix_level1_level4_level1_id on level1_level4 (level1_id); + +alter table level1_level4 add constraint fk_level1_level4_level4 foreign key (level4_id) references level4 (id); +create index ix_level1_level4_level4_id on level1_level4 (level4_id); + +alter table level1_level2 add constraint fk_level1_level2_level1 foreign key (level1_id) references level1 (id); +create index ix_level1_level2_level1_id on level1_level2 (level1_id); + +alter table level1_level2 add constraint fk_level1_level2_level2 foreign key (level2_id) references level2 (id); +create index ix_level1_level2_level2_id on level1_level2 (level2_id); + +alter table level2_level3 add constraint fk_level2_level3_level2 foreign key (level2_id) references level2 (id); +create index ix_level2_level3_level2_id on level2_level3 (level2_id); + +alter table level2_level3 add constraint fk_level2_level3_level3 foreign key (level3_id) references level3 (id); +create index ix_level2_level3_level3_id on level2_level3 (level3_id); + +alter table la_attr_value_attribute add constraint fk_la_attr_value_attribute__1 foreign key (la_attr_value_id) references la_attr_value (id); +create index ix_la_attr_value_attribute__1 on la_attr_value_attribute (la_attr_value_id); + +alter table la_attr_value_attribute add constraint fk_la_attr_value_attribute__2 foreign key (attribute_id) references attribute (id); +create index ix_la_attr_value_attribute__2 on la_attr_value_attribute (attribute_id); + +alter table mprinter add constraint fk_mprinter_current_state_id foreign key (current_state_id) references mprinter_state (id); +create index ix_mprinter_current_state_id on mprinter (current_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_magen_3 foreign key (last_swap_magenta_id) references mprinter_state (id); + +alter table mprinter add constraint fk_mprinter_last_swap_yello_4 foreign key (last_swap_yellow_id) references mprinter_state (id); + +alter table mprinter add constraint fk_mprinter_last_swap_black_5 foreign key (last_swap_black_id) references mprinter_state (id); + +alter table mprinter_state add constraint fk_mprinter_state_printer_id foreign key (printer_id) references mprinter (id); +create index ix_mprinter_state_printer_id on mprinter_state (printer_id); + +alter table mprofile add constraint fk_mprofile_picture_id foreign key (picture_id) references mmedia (id); +create index ix_mprofile_picture_id on mprofile (picture_id); + +alter table mrole_muser add constraint fk_mrole_muser_mrole foreign key (mrole_roleid) references mrole (roleid); +create index ix_mrole_muser_mrole_roleid on mrole_muser (mrole_roleid); + +alter table mrole_muser add constraint fk_mrole_muser_muser foreign key (muser_userid) references muser (userid); +create index ix_mrole_muser_muser_userid on mrole_muser (muser_userid); + +alter table muser add constraint fk_muser_user_type_id foreign key (user_type_id) references muser_type (id); +create index ix_muser_user_type_id on muser (user_type_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_conversation_id on c_message (conversation_id); + +alter table c_message add constraint fk_c_message_user_id foreign key (user_id) references c_user (id); +create index ix_c_message_user_id on c_message (user_id); + +alter table mnoc_user_mnoc_role add constraint fk_mnoc_user_mnoc_role_mnoc_1 foreign key (mnoc_user_user_id) references mnoc_user (user_id); +create index ix_mnoc_user_mnoc_role_mnoc_1 on mnoc_user_mnoc_role (mnoc_user_user_id); + +alter table mnoc_user_mnoc_role add constraint fk_mnoc_user_mnoc_role_mnoc_2 foreign key (mnoc_role_role_id) references mnoc_role (role_id); +create index ix_mnoc_user_mnoc_role_mnoc_2 on mnoc_user_mnoc_role (mnoc_role_role_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_mp_role_mp_user_id on mp_role (mp_user_id); + +alter table my_lob_size_join_many add constraint fk_my_lob_size_join_many_pa_1 foreign key (parent_id) references my_lob_size (id); +create index ix_my_lob_size_join_many_pa_1 on my_lob_size_join_many (parent_id); + +alter table o_cached_bean_country add constraint fk_o_cached_bean_country_o__1 foreign key (o_cached_bean_id) references o_cached_bean (id); +create index ix_o_cached_bean_country_o__1 on o_cached_bean_country (o_cached_bean_id); + +alter table o_cached_bean_country add constraint fk_o_cached_bean_country_o__2 foreign key (o_country_code) references o_country (code); +create index ix_o_cached_bean_country_o__2 on o_cached_bean_country (o_country_code); + +alter table o_cached_bean_child add constraint fk_o_cached_bean_child_cach_1 foreign key (cached_bean_id) references o_cached_bean (id); +create index ix_o_cached_bean_child_cach_1 on o_cached_bean_child (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); + +alter table o_order add constraint fk_o_order_kcustomer_id foreign key (kcustomer_id) references o_customer (id); +create index ix_o_order_kcustomer_id on o_order (kcustomer_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_order_id on o_order_detail (order_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_o_order_detail_product_id on o_order_detail (product_id); + +alter table s_order_items add constraint fk_s_order_items_order_uuid foreign key (order_uuid) references s_orders (uuid); +create index ix_s_order_items_order_uuid on s_order_items (order_uuid); + +alter table or_order_ship add constraint fk_or_order_ship_order_id foreign key (order_id) references o_order (id); +create index ix_or_order_ship_order_id on or_order_ship (order_id); + +alter table oto_child add constraint fk_oto_child_master_id foreign key (master_id) references oto_master (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); + +alter table pallet_location add constraint fk_pallet_location_zone_sid foreign key (zone_sid) references zones (id); +create index ix_pallet_location_zone_sid on pallet_location (zone_sid); + +alter table parcel_location add constraint fk_parcel_location_parcelid foreign key (parcelid) references parcel (parcelid); + +alter table rawinherit_parent_rawinherit_d add constraint fk_rawinherit_parent_rawinh_1 foreign key (rawinherit_parent_id) references rawinherit_parent (id); +create index ix_rawinherit_parent_rawinh_1 on rawinherit_parent_rawinherit_d (rawinherit_parent_id); + +alter table rawinherit_parent_rawinherit_d add constraint fk_rawinherit_parent_rawinh_2 foreign key (rawinherit_data_id) references rawinherit_data (id); +create index ix_rawinherit_parent_rawinh_2 on rawinherit_parent_rawinherit_d (rawinherit_data_id); + +alter table c_participation add constraint fk_c_participation_conversa_1 foreign key (conversation_id) references c_conversation (id); +create index ix_c_participation_conversa_1 on c_participation (conversation_id); + +alter table c_participation add constraint fk_c_participation_user_id foreign key (user_id) references c_user (id); +create index ix_c_participation_user_id on c_participation (user_id); + +alter table persistent_file_content add constraint fk_persistent_file_content__1 foreign key (persistent_file_id) references persistent_file (id); + +alter table person add constraint fk_person_default_address_oid foreign key (default_address_oid) references address (oid); +create index ix_person_default_address_oid on person (default_address_oid); + +alter table phones add constraint fk_phones_person_id foreign key (person_id) references persons (id); +create index ix_phones_person_id on phones (person_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_pp_id on pp_to_ww (pp_id); + +alter table pp_to_ww add constraint fk_pp_to_ww_wview foreign key (ww_id) references wview (id); +create index ix_pp_to_ww_ww_id on pp_to_ww (ww_id); + +alter table r_orders add constraint fk_r_orders_rcustomer foreign key (company,customername) references rcustomer (company,name); +create index ix_r_orders_company_custome_1 on r_orders (company,customername); + +alter table resourcefile add constraint fk_resourcefile_parentresou_1 foreign key (parentresourcefileid) references resourcefile (id); +create index ix_resourcefile_parentresou_1 on resourcefile (parentresourcefileid); + +alter table mt_role add constraint fk_mt_role_tenant_id foreign key (tenant_id) references mt_tenant (id); +create index ix_mt_role_tenant_id on mt_role (tenant_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_ro_1 on mt_role_permission (mt_role_id); + +alter table mt_role_permission add constraint fk_mt_role_permission_mt_pe_2 foreign key (mt_permission_id) references mt_permission (id); +create index ix_mt_role_permission_mt_pe_2 on mt_role_permission (mt_permission_id); + +alter table f_second add constraint fk_f_second_first foreign key (first) references f_first (id); + +alter table section add constraint fk_section_article_id foreign key (article_id) references article (id); +create index ix_section_article_id on section (article_id); + +alter table self_parent add constraint fk_self_parent_parent_id foreign key (parent_id) references self_parent (id); +create index ix_self_parent_parent_id on self_parent (parent_id); + +alter table self_ref_customer add constraint fk_self_ref_customer_referr_1 foreign key (referred_by_id) references self_ref_customer (id); +create index ix_self_ref_customer_referr_1 on self_ref_customer (referred_by_id); + +alter table self_ref_example add constraint fk_self_ref_example_parent_id foreign key (parent_id) references self_ref_example (id); +create index ix_self_ref_example_parent_id on self_ref_example (parent_id); + +alter table stockforecast add constraint fk_stockforecast_inner_repo_1 foreign key (inner_report_id) references inner_report (id); +create index ix_stockforecast_inner_repo_1 on stockforecast (inner_report_id); + +alter table sub_section add constraint fk_sub_section_section_id foreign key (section_id) references section (id); +create index ix_sub_section_section_id on sub_section (section_id); + +alter table t_detail_with_other_namexxxyy add constraint fk_t_detail_with_other_name_1 foreign key (master_id) references t_atable_thatisrelatively (id); +create index ix_t_detail_with_other_name_1 on t_detail_with_other_namexxxyy (master_id); + +alter table ts_detail_two add constraint fk_ts_detail_two_master_id foreign key (master_id) references ts_master_two (id); +create index ix_ts_detail_two_master_id on ts_detail_two (master_id); + +alter table twheel add constraint fk_twheel_owner_plate_no foreign key (owner_plate_no) references tcar (plate_no); +create index ix_twheel_owner_plate_no on twheel (owner_plate_no); + +alter table tire add constraint fk_tire_wheel foreign key (wheel) references wheel (id); + +alter table trip add constraint fk_trip_vehicle_driver_id foreign key (vehicle_driver_id) references vehicle_driver (id); +create index ix_trip_vehicle_driver_id on trip (vehicle_driver_id); + +alter table trip add constraint fk_trip_address_id foreign key (address_id) references o_address (id); +create index ix_trip_address_id on trip (address_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_type_sub_type_id on type (sub_type_id); + +alter table ut_detail add constraint fk_ut_detail_utmaster_id foreign key (utmaster_id) references ut_master (id); +create index ix_ut_detail_utmaster_id on ut_detail (utmaster_id); + +alter table uutwo add constraint fk_uutwo_master_id foreign key (master_id) references uuone (id); +create index ix_uutwo_master_id on uutwo (master_id); + +alter table c_user add constraint fk_c_user_group_id foreign key (group_id) references c_group (id); +create index ix_c_user_group_id on c_user (group_id); + +alter table oto_user add constraint fk_oto_user_account_id foreign key (account_id) references oto_account (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_user_id on em_user_role (user_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_em_user_role_role_id on em_user_role (role_id); + +alter table vehicle add constraint fk_vehicle_truck_ref_id foreign key (truck_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_car_ref_id foreign key (car_ref_id) references truck_ref (id); +create index ix_vehicle_car_ref_id on vehicle (car_ref_id); + +alter table vehicle_driver add constraint fk_vehicle_driver_vehicle_id foreign key (vehicle_id) references vehicle (id); +create index ix_vehicle_driver_vehicle_id on vehicle_driver (vehicle_id); + +alter table vehicle_driver add constraint fk_vehicle_driver_address_id foreign key (address_id) references o_address (id); +create index ix_vehicle_driver_address_id on vehicle_driver (address_id); + +alter table warehouses add constraint fk_warehouses_officezoneid foreign key (officezoneid) references zones (id); +create index ix_warehouses_officezoneid on warehouses (officezoneid); + +alter table warehousesshippingzones add constraint fk_warehousesshippingzones__1 foreign key (warehouseid) references warehouses (id); +create index ix_warehousesshippingzones__1 on warehousesshippingzones (warehouseid); + +alter table warehousesshippingzones add constraint fk_warehousesshippingzones__2 foreign key (shippingzoneid) references zones (id); +create index ix_warehousesshippingzones__2 on warehousesshippingzones (shippingzoneid); + +alter table sa_wheel add constraint fk_sa_wheel_tire foreign key (tire) references sa_tire (id); +create index ix_sa_wheel_tire on sa_wheel (tire); + +alter table sa_wheel add constraint fk_sa_wheel_car foreign key (car) references sa_car (id); +create index ix_sa_wheel_car on sa_wheel (car); + +alter table with_zero add constraint fk_with_zero_parent_id foreign key (parent_id) references parent (id); +create index ix_with_zero_parent_id on with_zero (parent_id); + diff --git a/src/test/ddl-review/ora-drop.sql b/src/test/ddl-review/ora-drop.sql new file mode 100644 index 000000000..1c863ed7b --- /dev/null +++ b/src/test/ddl-review/ora-drop.sql @@ -0,0 +1,938 @@ +alter table bar drop constraint fk_bar_foo_id; +drop index ix_bar_foo_id; + +alter table o_address drop constraint fk_o_address_country_code; +drop index ix_o_address_country_code; + +alter table animals drop constraint fk_animals_shelter_id; +drop index ix_animals_shelter_id; + +alter table attribute drop constraint fk_attribute_attribute_hold_1; +drop index ix_attribute_attribute_hold_1; + +alter table bbookmark drop constraint fk_bbookmark_user_id; +drop index ix_bbookmark_user_id; + +alter table drel_booking drop constraint fk_drel_booking_agent_invoice; + +alter table drel_booking drop constraint fk_drel_booking_client_invo_2; + +alter table ckey_detail drop constraint fk_ckey_detail_ckey_parent; +drop index ix_ckey_detail_one_key_two__1; + +alter table ckey_parent drop constraint fk_ckey_parent_assoc_id; +drop index ix_ckey_parent_assoc_id; + +alter table calculation_result drop constraint fk_calculation_result_produ_1; +drop index ix_calculation_result_produ_1; + +alter table calculation_result drop constraint fk_calculation_result_group_2; +drop index ix_calculation_result_group_2; + +alter table sp_car_car_wheels drop constraint fk_sp_car_car_wheels_sp_car_1; +drop index ix_sp_car_car_wheels_car; + +alter table sp_car_car_wheels drop constraint fk_sp_car_car_wheels_sp_car_2; +drop index ix_sp_car_car_wheels_wheel; + +alter table car_accessory drop constraint fk_car_accessory_car_id; +drop index ix_car_accessory_car_id; + +alter table configuration drop constraint fk_configuration_configurat_1; +drop index ix_configuration_configurat_1; + +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 c_conversation drop constraint fk_c_conversation_group_id; +drop index ix_c_conversation_group_id; + +alter table o_customer drop constraint fk_o_customer_billing_addre_1; +drop index ix_o_customer_billing_addre_1; + +alter table o_customer drop constraint fk_o_customer_shipping_addr_2; +drop index ix_o_customer_shipping_addr_2; + +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_enull_collection_detail__1; +drop index ix_enull_collection_detail__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 evanilla_collection_detail drop constraint fk_evanilla_collection_deta_1; +drop index ix_evanilla_collection_deta_1; + +alter table td_child drop constraint fk_td_child_parent_id; +drop index ix_td_child_parent_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_type; +drop index ix_item_customer_type; + +alter table item drop constraint fk_item_region; +drop index ix_item_customer_region; + +alter table level1_level4 drop constraint fk_level1_level4_level1; +drop index ix_level1_level4_level1_id; + +alter table level1_level4 drop constraint fk_level1_level4_level4; +drop index ix_level1_level4_level4_id; + +alter table level1_level2 drop constraint fk_level1_level2_level1; +drop index ix_level1_level2_level1_id; + +alter table level1_level2 drop constraint fk_level1_level2_level2; +drop index ix_level1_level2_level2_id; + +alter table level2_level3 drop constraint fk_level2_level3_level2; +drop index ix_level2_level3_level2_id; + +alter table level2_level3 drop constraint fk_level2_level3_level3; +drop index ix_level2_level3_level3_id; + +alter table la_attr_value_attribute drop constraint fk_la_attr_value_attribute__1; +drop index ix_la_attr_value_attribute__1; + +alter table la_attr_value_attribute drop constraint fk_la_attr_value_attribute__2; +drop index ix_la_attr_value_attribute__2; + +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_mprinter_last_swap_magen_3; + +alter table mprinter drop constraint fk_mprinter_last_swap_yello_4; + +alter table mprinter drop constraint fk_mprinter_last_swap_black_5; + +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_roleid; + +alter table mrole_muser drop constraint fk_mrole_muser_muser; +drop index ix_mrole_muser_muser_userid; + +alter table muser drop constraint fk_muser_user_type_id; +drop index ix_muser_user_type_id; + +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 mnoc_user_mnoc_role drop constraint fk_mnoc_user_mnoc_role_mnoc_1; +drop index ix_mnoc_user_mnoc_role_mnoc_1; + +alter table mnoc_user_mnoc_role drop constraint fk_mnoc_user_mnoc_role_mnoc_2; +drop index ix_mnoc_user_mnoc_role_mnoc_2; + +alter table mp_role drop constraint fk_mp_role_mp_user_id; +drop index ix_mp_role_mp_user_id; + +alter table my_lob_size_join_many drop constraint fk_my_lob_size_join_many_pa_1; +drop index ix_my_lob_size_join_many_pa_1; + +alter table o_cached_bean_country drop constraint fk_o_cached_bean_country_o__1; +drop index ix_o_cached_bean_country_o__1; + +alter table o_cached_bean_country drop constraint fk_o_cached_bean_country_o__2; +drop index ix_o_cached_bean_country_o__2; + +alter table o_cached_bean_child drop constraint fk_o_cached_bean_child_cach_1; +drop index ix_o_cached_bean_child_cach_1; + +alter table oengine drop constraint fk_oengine_car_id; + +alter table ogear_box drop constraint fk_ogear_box_car_id; + +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 oto_child drop constraint fk_oto_child_master_id; + +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_rawinherit_parent_rawinh_1; +drop index ix_rawinherit_parent_rawinh_1; + +alter table rawinherit_parent_rawinherit_d drop constraint fk_rawinherit_parent_rawinh_2; +drop index ix_rawinherit_parent_rawinh_2; + +alter table c_participation drop constraint fk_c_participation_conversa_1; +drop index ix_c_participation_conversa_1; + +alter table c_participation drop constraint fk_c_participation_user_id; +drop index ix_c_participation_user_id; + +alter table persistent_file_content drop constraint fk_persistent_file_content__1; + +alter table person drop constraint fk_person_default_address_oid; +drop index ix_person_default_address_oid; + +alter table phones drop constraint fk_phones_person_id; +drop index ix_phones_person_id; + +alter table pp_to_ww drop constraint fk_pp_to_ww_pp; +drop index ix_pp_to_ww_pp_id; + +alter table pp_to_ww drop constraint fk_pp_to_ww_wview; +drop index ix_pp_to_ww_ww_id; + +alter table r_orders drop constraint fk_r_orders_rcustomer; +drop index ix_r_orders_company_custome_1; + +alter table resourcefile drop constraint fk_resourcefile_parentresou_1; +drop index ix_resourcefile_parentresou_1; + +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_ro_1; + +alter table mt_role_permission drop constraint fk_mt_role_permission_mt_pe_2; +drop index ix_mt_role_permission_mt_pe_2; + +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_self_ref_customer_referr_1; +drop index ix_self_ref_customer_referr_1; + +alter table self_ref_example drop constraint fk_self_ref_example_parent_id; +drop index ix_self_ref_example_parent_id; + +alter table stockforecast drop constraint fk_stockforecast_inner_repo_1; +drop index ix_stockforecast_inner_repo_1; + +alter table sub_section drop constraint fk_sub_section_section_id; +drop index ix_sub_section_section_id; + +alter table t_detail_with_other_namexxxyy drop constraint fk_t_detail_with_other_name_1; +drop index ix_t_detail_with_other_name_1; + +alter table ts_detail_two drop constraint fk_ts_detail_two_master_id; +drop index ix_ts_detail_two_master_id; + +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 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 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 c_user drop constraint fk_c_user_group_id; +drop index ix_c_user_group_id; + +alter table oto_user drop constraint fk_oto_user_account_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_truck_ref_id; +drop index ix_vehicle_truck_ref_id; + +alter table vehicle drop constraint fk_vehicle_car_ref_id; +drop index ix_vehicle_car_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_warehousesshippingzones__1; +drop index ix_warehousesshippingzones__1; + +alter table warehousesshippingzones drop constraint fk_warehousesshippingzones__2; +drop index ix_warehousesshippingzones__2; + +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 with_zero drop constraint fk_with_zero_parent_id; +drop index ix_with_zero_parent_id; + +drop table asimple_bean cascade constraints purge; +drop sequence asimple_bean_seq; + +drop table bar cascade constraints purge; +drop sequence bar_seq; + +drop table oto_account cascade constraints purge; +drop sequence oto_account_seq; + +drop table o_address cascade constraints purge; +drop sequence o_address_seq; + +drop table address cascade constraints purge; +drop sequence address_seq; + +drop table animals cascade constraints purge; +drop sequence animals_seq; + +drop table animal_shelter cascade constraints purge; +drop sequence animal_shelter_seq; + +drop table article cascade constraints purge; +drop sequence article_seq; + +drop table attribute cascade constraints purge; +drop sequence attribute_seq; + +drop table attribute_holder cascade constraints purge; +drop sequence attribute_holder_seq; + +drop table audit_log cascade constraints purge; +drop sequence audit_log_seq; + +drop table bbookmark cascade constraints purge; +drop sequence bbookmark_seq; + +drop table bbookmark_user cascade constraints purge; +drop sequence bbookmark_user_seq; + +drop table bsimple_with_gen cascade constraints purge; +drop sequence bsimple_with_gen_seq; + +drop table bwith_qident cascade constraints purge; +drop sequence bwith_qident_seq; + +drop table basic_joda_entity cascade constraints purge; +drop sequence basic_joda_entity_seq; + +drop table bean_with_time_zone cascade constraints purge; +drop sequence bean_with_time_zone_seq; + +drop table drel_booking cascade constraints purge; +drop sequence drel_booking_seq; + +drop table ckey_assoc cascade constraints purge; +drop sequence ckey_assoc_seq; + +drop table ckey_detail cascade constraints purge; +drop sequence ckey_detail_seq; + +drop table ckey_parent cascade constraints purge; + +drop table calculation_result cascade constraints purge; +drop sequence calculation_result_seq; + +drop table cao_bean cascade constraints purge; + +drop table sa_car cascade constraints purge; +drop sequence sa_car_seq; + +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 car_accessory cascade constraints purge; +drop sequence car_accessory_seq; + +drop table configuration cascade constraints purge; +drop sequence configuration_seq; + +drop table configurations cascade constraints purge; +drop sequence configurations_seq; + +drop table contact cascade constraints purge; +drop sequence contact_seq; + +drop table contact_group cascade constraints purge; +drop sequence contact_group_seq; + +drop table contact_note cascade constraints purge; +drop sequence contact_note_seq; + +drop table c_conversation cascade constraints purge; +drop sequence c_conversation_seq; + +drop table o_country cascade constraints purge; + +drop table o_customer cascade constraints purge; +drop sequence o_customer_seq; + +drop table dexh_entity cascade constraints purge; +drop sequence dexh_entity_seq; + +drop table dperson cascade constraints purge; +drop sequence dperson_seq; + +drop table rawinherit_data cascade constraints purge; +drop sequence rawinherit_data_seq; + +drop table e_basic cascade constraints purge; +drop sequence e_basic_seq; + +drop table ebasic_clob cascade constraints purge; +drop sequence ebasic_clob_seq; + +drop table ebasic_clob_fetch_eager cascade constraints purge; +drop sequence ebasic_clob_fetch_eager_seq; + +drop table ebasic_clob_no_ver cascade constraints purge; +drop sequence ebasic_clob_no_ver_seq; + +drop table e_basicenc cascade constraints purge; +drop sequence e_basicenc_seq; + +drop table e_basicenc_bin cascade constraints purge; +drop sequence e_basicenc_bin_seq; + +drop table e_basic_enum_id cascade constraints purge; + +drop table ebasic_json_map cascade constraints purge; +drop sequence ebasic_json_map_seq; + +drop table ebasic_json_map_blob cascade constraints purge; +drop sequence ebasic_json_map_blob_seq; + +drop table ebasic_json_map_clob cascade constraints purge; +drop sequence ebasic_json_map_clob_seq; + +drop table ebasic_json_map_json_b cascade constraints purge; +drop sequence ebasic_json_map_json_b_seq; + +drop table ebasic_json_map_varchar cascade constraints purge; +drop sequence ebasic_json_map_varchar_seq; + +drop table ebasic_json_node cascade constraints purge; +drop sequence ebasic_json_node_seq; + +drop table ebasic_json_node_blob cascade constraints purge; +drop sequence ebasic_json_node_blob_seq; + +drop table ebasic_json_node_json_b cascade constraints purge; +drop sequence ebasic_json_node_json_b_seq; + +drop table ebasic_json_node_varchar cascade constraints purge; +drop sequence ebasic_json_node_varchar_seq; + +drop table e_basic_ndc cascade constraints purge; +drop sequence e_basic_ndc_seq; + +drop table e_basicver cascade constraints purge; +drop sequence e_basicver_seq; + +drop table e_basic_withlife cascade constraints purge; +drop sequence e_basic_withlife_seq; + +drop table e_basicverucon cascade constraints purge; +drop sequence e_basicverucon_seq; + +drop table eemb_inner cascade constraints purge; +drop sequence eemb_inner_seq; + +drop table eemb_outer cascade constraints purge; +drop sequence eemb_outer_seq; + +drop table egen_props cascade constraints purge; +drop sequence egen_props_seq; + +drop table einvoice cascade constraints purge; +drop sequence einvoice_seq; + +drop table e_main cascade constraints purge; +drop sequence e_main_seq; + +drop table enull_collection cascade constraints purge; +drop sequence enull_collection_seq; + +drop table enull_collection_detail cascade constraints purge; +drop sequence enull_collection_detail_seq; + +drop table eopt_one_a cascade constraints purge; +drop sequence eopt_one_a_seq; + +drop table eopt_one_b cascade constraints purge; +drop sequence eopt_one_b_seq; + +drop table eopt_one_c cascade constraints purge; +drop sequence eopt_one_c_seq; + +drop table eperson cascade constraints purge; +drop sequence eperson_seq; + +drop table esimple cascade constraints purge; +drop sequence esimple_seq; + +drop table esome_type cascade constraints purge; +drop sequence esome_type_seq; + +drop table etrans_many cascade constraints purge; +drop sequence etrans_many_seq; + +drop table evanilla_collection cascade constraints purge; +drop sequence evanilla_collection_seq; + +drop table evanilla_collection_detail cascade constraints purge; +drop sequence evanilla_collection_detail_seq; + +drop table ewho_props cascade constraints purge; +drop sequence ewho_props_seq; + +drop table e_withinet cascade constraints purge; +drop sequence e_withinet_seq; + +drop table td_child cascade constraints purge; +drop sequence td_child_seq; + +drop table td_parent cascade constraints purge; +drop sequence td_parent_seq; + +drop table feature_desc cascade constraints purge; +drop sequence feature_desc_seq; + +drop table f_first cascade constraints purge; +drop sequence f_first_seq; + +drop table foo cascade constraints purge; +drop sequence foo_seq; + +drop table gen_key_identity cascade constraints purge; +drop sequence gen_key_identity_seq; + +drop table gen_key_sequence cascade constraints purge; +drop sequence seq; + +drop table gen_key_table cascade constraints purge; +drop sequence gen_key_table_seq; + +drop table c_group cascade constraints purge; +drop sequence c_group_seq; + +drop table imrelated cascade constraints purge; +drop sequence imrelated_seq; + +drop table imroot cascade constraints purge; +drop sequence imroot_seq; + +drop table ixresource cascade constraints purge; + +drop table info_company cascade constraints purge; +drop sequence info_company_seq; + +drop table info_contact cascade constraints purge; +drop sequence info_contact_seq; + +drop table info_customer cascade constraints purge; +drop sequence info_customer_seq; + +drop table inner_report cascade constraints purge; +drop sequence inner_report_seq; + +drop table drel_invoice cascade constraints purge; +drop sequence drel_invoice_seq; + +drop table item cascade constraints purge; + +drop table level1 cascade constraints purge; +drop sequence level1_seq; + +drop table level1_level4 cascade constraints purge; + +drop table level1_level2 cascade constraints purge; + +drop table level2 cascade constraints purge; +drop sequence level2_seq; + +drop table level2_level3 cascade constraints purge; + +drop table level3 cascade constraints purge; +drop sequence level3_seq; + +drop table level4 cascade constraints purge; +drop sequence level4_seq; + +drop table la_attr_value cascade constraints purge; +drop sequence la_attr_value_seq; + +drop table la_attr_value_attribute cascade constraints purge; + +drop table mmedia cascade constraints purge; +drop sequence mmedia_seq; + +drop table non_updateprop cascade constraints purge; +drop sequence non_updateprop_seq; + +drop table mprinter cascade constraints purge; +drop sequence mprinter_seq; + +drop table mprinter_state cascade constraints purge; +drop sequence mprinter_state_seq; + +drop table mprofile cascade constraints purge; +drop sequence mprofile_seq; + +drop table mprotected_construct_bean cascade constraints purge; +drop sequence mprotected_construct_bean_seq; + +drop table mrole cascade constraints purge; +drop sequence mrole_seq; + +drop table mrole_muser cascade constraints purge; + +drop table msome_other cascade constraints purge; +drop sequence msome_other_seq; + +drop table muser cascade constraints purge; +drop sequence muser_seq; + +drop table muser_type cascade constraints purge; +drop sequence muser_type_seq; + +drop table map_super_actual cascade constraints purge; +drop sequence map_super_actual_seq; + +drop table c_message cascade constraints purge; +drop sequence c_message_seq; + +drop table mnoc_role cascade constraints purge; +drop sequence mnoc_role_seq; + +drop table mnoc_user cascade constraints purge; +drop sequence mnoc_user_seq; + +drop table mnoc_user_mnoc_role cascade constraints purge; + +drop table mp_role cascade constraints purge; +drop sequence mp_role_seq; + +drop table mp_user cascade constraints purge; +drop sequence mp_user_seq; + +drop table my_lob_size cascade constraints purge; +drop sequence my_lob_size_seq; + +drop table my_lob_size_join_many cascade constraints purge; +drop sequence my_lob_size_join_many_seq; + +drop table noidbean cascade constraints purge; + +drop table o_cached_bean cascade constraints purge; +drop sequence o_cached_bean_seq; + +drop table o_cached_bean_country cascade constraints purge; + +drop table o_cached_bean_child cascade constraints purge; +drop sequence o_cached_bean_child_seq; + +drop table ocar cascade constraints purge; +drop sequence ocar_seq; + +drop table oengine cascade constraints purge; + +drop table ogear_box cascade constraints purge; + +drop table o_order cascade constraints purge; +drop sequence o_order_seq; + +drop table o_order_detail cascade constraints purge; +drop sequence o_order_detail_seq; + +drop table s_orders cascade constraints purge; + +drop table s_order_items cascade constraints purge; + +drop table or_order_ship cascade constraints purge; +drop sequence or_order_ship_seq; + +drop table oto_child cascade constraints purge; +drop sequence oto_child_seq; + +drop table oto_master cascade constraints purge; +drop sequence oto_master_seq; + +drop table pfile cascade constraints purge; +drop sequence pfile_seq; + +drop table pfile_content cascade constraints purge; +drop sequence pfile_content_seq; + +drop table paggview cascade constraints purge; + +drop table pallet_location cascade constraints purge; +drop sequence pallet_location_seq; + +drop table parcel cascade constraints purge; +drop sequence parcel_seq; + +drop table parcel_location cascade constraints purge; +drop sequence parcel_location_seq; + +drop table rawinherit_parent cascade constraints purge; +drop sequence rawinherit_parent_seq; + +drop table rawinherit_parent_rawinherit_d cascade constraints purge; + +drop table c_participation cascade constraints purge; +drop sequence c_participation_seq; + +drop table mt_permission cascade constraints purge; + +drop table persistent_file cascade constraints purge; +drop sequence persistent_file_seq; + +drop table persistent_file_content cascade constraints purge; +drop sequence persistent_file_content_seq; + +drop table persons cascade constraints purge; +drop sequence persons_seq; + +drop table person cascade constraints purge; +drop sequence person_seq; + +drop table phones cascade constraints purge; +drop sequence phones_seq; + +drop table o_product cascade constraints purge; +drop sequence o_product_seq; + +drop table pp cascade constraints purge; + +drop table pp_to_ww cascade constraints purge; + +drop table rcustomer cascade constraints purge; + +drop table r_orders cascade constraints purge; + +drop table region 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 sequence em_role_seq; + +drop table f_second cascade constraints purge; +drop sequence f_second_seq; + +drop table section cascade constraints purge; +drop sequence section_seq; + +drop table self_parent cascade constraints purge; +drop sequence self_parent_seq; + +drop table self_ref_customer cascade constraints purge; +drop sequence self_ref_customer_seq; + +drop table self_ref_example cascade constraints purge; +drop sequence self_ref_example_seq; + +drop table some_enum_bean cascade constraints purge; +drop sequence some_enum_bean_seq; + +drop table some_file_bean cascade constraints purge; +drop sequence some_file_bean_seq; + +drop table some_new_types_bean cascade constraints purge; +drop sequence some_new_types_bean_seq; + +drop table some_period_bean cascade constraints purge; +drop sequence some_period_bean_seq; + +drop table stockforecast cascade constraints purge; +drop sequence stockforecast_seq; + +drop table sub_section cascade constraints purge; +drop sequence sub_section_seq; + +drop table sub_type cascade constraints purge; +drop sequence sub_type_seq; + +drop table tbytes_only cascade constraints purge; +drop sequence tbytes_only_seq; + +drop table tcar cascade constraints purge; + +drop table tint_root cascade constraints purge; +drop sequence tint_root_seq; + +drop table tjoda_entity cascade constraints purge; +drop sequence tjoda_entity_seq; + +drop table t_mapsuper1 cascade constraints purge; +drop sequence t_mapsuper1_seq; + +drop table t_oneb cascade constraints purge; +drop sequence t_oneb_seq; + +drop table t_detail_with_other_namexxxyy cascade constraints purge; +drop sequence t_atable_detail_seq; + +drop table ts_detail_two cascade constraints purge; +drop sequence ts_detail_two_seq; + +drop table t_atable_thatisrelatively cascade constraints purge; +drop sequence t_atable_master_seq; + +drop table ts_master_two cascade constraints purge; +drop sequence ts_master_two_seq; + +drop table tuuid_entity cascade constraints purge; + +drop table twheel cascade constraints purge; +drop sequence twheel_seq; + +drop table twith_pre_insert cascade constraints purge; +drop sequence twith_pre_insert_seq; + +drop table mt_tenant cascade constraints purge; + +drop table sa_tire cascade constraints purge; +drop sequence sa_tire_seq; + +drop table tire cascade constraints purge; +drop sequence tire_seq; + +drop table trip cascade constraints purge; +drop sequence trip_seq; + +drop table truck_ref cascade constraints purge; +drop sequence truck_ref_seq; + +drop table type cascade constraints purge; + +drop table ut_detail cascade constraints purge; +drop sequence ut_detail_seq; + +drop table ut_master cascade constraints purge; +drop sequence ut_master_seq; + +drop table uuone cascade constraints purge; + +drop table uutwo cascade constraints purge; + +drop table em_user cascade constraints purge; +drop sequence em_user_seq; + +drop table tx_user cascade constraints purge; +drop sequence tx_user_seq; + +drop table c_user cascade constraints purge; +drop sequence c_user_seq; + +drop table oto_user cascade constraints purge; +drop sequence oto_user_seq; + +drop table em_user_role cascade constraints purge; + +drop table vehicle cascade constraints purge; +drop sequence vehicle_seq; + +drop table vehicle_driver cascade constraints purge; +drop sequence vehicle_driver_seq; + +drop table warehouses cascade constraints purge; +drop sequence warehouses_seq; + +drop table warehousesshippingzones cascade constraints purge; + +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 wheel cascade constraints purge; +drop sequence wheel_seq; + +drop table with_zero cascade constraints purge; +drop sequence with_zero_seq; + +drop table parent cascade constraints purge; +drop sequence parent_seq; + +drop table wview cascade constraints purge; + +drop table zones cascade constraints purge; +drop sequence zones_seq; + diff --git a/src/test/ddl-review/pg-create.sql b/src/test/ddl-review/pg-create.sql new file mode 100644 index 000000000..7eb9473f7 --- /dev/null +++ b/src/test/ddl-review/pg-create.sql @@ -0,0 +1,2086 @@ +create table asimple_bean ( + id bigserial not null, + name varchar(255), + constraint pk_asimple_bean primary key (id) +); + +create table bar ( + bar_type varchar(31) not null, + bar_id serial not null, + foo_id integer not null, + version integer not null, + constraint pk_bar primary key (bar_id) +); + +create table oto_account ( + id bigserial 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 o_address ( + id smallserial 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 address ( + oid bigserial not null, + street varchar(255), + version integer not null, + constraint pk_address primary key (oid) +); + +create table animals ( + species varchar(31) not null, + id bigserial not null, + shelter_id bigint, + version bigint not null, + name varchar(255), + registration_number varchar(255), + date_of_birth date, + constraint pk_animals primary key (id) +); + +create table animal_shelter ( + id bigserial not null, + name varchar(255), + version bigint not null, + constraint pk_animal_shelter primary key (id) +); + +create table article ( + id serial 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 not null, + id serial 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 serial 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 bigserial not null, + description varchar(255), + modified_description varchar(255), + constraint pk_audit_log primary key (id) +); + +create table bbookmark ( + id serial not null, + bookmark_reference varchar(255), + user_id integer, + constraint pk_bbookmark primary key (id) +); + +create table bbookmark_user ( + id serial not null, + name varchar(255), + password varchar(255), + email_address varchar(255), + country varchar(255), + constraint pk_bbookmark_user primary key (id) +); + +create table bsimple_with_gen ( + id serial not null, + name varchar(255), + constraint pk_bsimple_with_gen primary key (id) +); + +create table bwith_qident ( + id serial not null, + "Name" varchar(255), + last_updated timestamp not null, + constraint uq_bwith_qident_name unique ("Name"), + constraint pk_bwith_qident primary key (id) +); + +create table basic_joda_entity ( + id bigserial not null, + name varchar(255), + 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 bigserial 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, + agent_invoice bigint, + client_invoice bigint, + version integer not null, + 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; + +create table ckey_assoc ( + id serial not null, + assoc_one varchar(255), + constraint pk_ckey_assoc primary key (id) +); + +create table ckey_detail ( + id serial not null, + something varchar(255), + one_key integer, + two_key varchar(255), + constraint pk_ckey_detail primary key (id) +); + +create table ckey_parent ( + one_key integer not null, + two_key varchar(255) not null, + name varchar(255), + assoc_id integer, + version integer not null, + constraint pk_ckey_parent primary key (one_key,two_key) +); + +create table calculation_result ( + id serial not null, + charge float, + 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 sa_car ( + id bigint not null, + version integer not null, + constraint pk_sa_car primary key (id) +); +create sequence sa_car_seq; + +create table sp_car_car ( + id bigint not null, + version integer not null, + constraint pk_sp_car_car primary key (id) +); +create sequence sp_car_car_seq; + +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 car_accessory ( + id serial not null, + name varchar(255), + car_id integer, + cretime timestamp not null, + updtime timestamp not null, + version bigint not null, + constraint pk_car_accessory primary key (id) +); + +create table configuration ( + type varchar(31) not null, + id serial 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 serial not null, + name varchar(255), + constraint pk_configurations primary key (id) +); + +create table contact ( + id serial not null, + first_name varchar(255), + last_name varchar(255), + phone varchar(255), + mobile varchar(255), + email varchar(255), + 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 serial 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 serial not null, + contact_id integer, + title varchar(255), + note text, + cretime timestamp not null, + updtime timestamp not null, + version bigint not null, + constraint pk_contact_note primary key (id) +); + +create table c_conversation ( + id bigserial not null, + title varchar(255), + isopen boolean, + 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 o_customer ( + id serial not null, + status varchar(1), + name varchar(40) not null, + smallnote varchar(100), + anniversary date, + billing_address_id smallint, + shipping_address_id smallint, + 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) +); + +create table dexh_entity ( + oid bigserial not null, + exhange_rate decimal(38), + exhange_cmoney_amount decimal(38), + exhange_cmoney_currency varchar(3), + last_updated timestamp not null, + constraint pk_dexh_entity primary key (oid) +); + +create table dperson ( + id bigserial not null, + first_name varchar(255), + last_name varchar(255), + salary decimal(38), + a_amt decimal(38), + a_curr varchar(3), + i_start timestamp, + i_end timestamp, + constraint pk_dperson primary key (id) +); + +create table rawinherit_data ( + id bigserial not null, + val integer, + constraint pk_rawinherit_data primary key (id) +); + +create table e_basic ( + id serial not null, + status varchar(1), + name varchar(255), + 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_clob ( + id bigserial not null, + name varchar(255), + title varchar(255), + description text, + last_update timestamp not null, + constraint pk_ebasic_clob primary key (id) +); + +create table ebasic_clob_fetch_eager ( + id bigserial not null, + name varchar(255), + title varchar(255), + description text, + last_update timestamp not null, + constraint pk_ebasic_clob_fetch_eager primary key (id) +); + +create table ebasic_clob_no_ver ( + id bigserial not null, + name varchar(255), + description text, + constraint pk_ebasic_clob_no_ver primary key (id) +); + +create table e_basicenc ( + id serial not null, + name varchar(255), + description bytea, + dob bytea, + last_update timestamp, + constraint pk_e_basicenc primary key (id) +); + +create table e_basicenc_bin ( + id serial not null, + name varchar(255), + description varchar(255), + data bytea, + some_time bytea, + last_update timestamp not null, + constraint pk_e_basicenc_bin 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 ebasic_json_map ( + id bigserial 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 bigserial 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 bigserial 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_json_b ( + id bigserial 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 bigserial 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 bigserial 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 bigserial 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 bigserial 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 bigserial not null, + name varchar(255), + content varchar(1000), + version bigint not null, + constraint pk_ebasic_json_node_varchar primary key (id) +); + +create table e_basic_ndc ( + id serial not null, + name varchar(255), + constraint pk_e_basic_ndc primary key (id) +); + +create table e_basicver ( + id serial 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 bigserial not null, + name varchar(255), + version bigint not null, + constraint pk_e_basic_withlife primary key (id) +); + +create table e_basicverucon ( + id serial not null, + name varchar(255), + other varchar(255), + other_one varchar(255), + description varchar(255), + last_update timestamp not null, + constraint uq_e_basicverucon_name unique (name), + constraint pk_e_basicverucon primary key (id) +); + +create table eemb_inner ( + id serial 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 serial not null, + nome_outer varchar(255), + date1 timestamp, + date2 timestamp, + update_count integer not null, + constraint pk_eemb_outer primary key (id) +); + +create table egen_props ( + id bigserial 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, + long_created bigint not null, + long_updated bigint not null, + constraint pk_egen_props primary key (id) +); + +create table einvoice ( + id bigserial not null, + invoice_date timestamp, + state integer, + person_id bigint, + ship_street varchar(255), + ship_suburb varchar(255), + ship_city varchar(255), + street varchar(255), + suburb varchar(255), + city varchar(255), + version bigint not null, + constraint ck_einvoice_state check (state in (0,1,2)), + constraint pk_einvoice primary key (id) +); + +create table e_main ( + id serial not null, + name varchar(255), + description varchar(255), + version bigint not null, + constraint pk_e_main primary key (id) +); + +create table enull_collection ( + id serial not null, + name varchar(255), + constraint pk_enull_collection primary key (id) +); + +create table enull_collection_detail ( + id serial 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 serial 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 serial 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 serial 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 eperson ( + id bigserial not null, + name varchar(255), + notes varchar(255), + street varchar(255), + suburb varchar(255), + city varchar(255), + version bigint not null, + constraint pk_eperson primary key (id) +); + +create table esimple ( + usertypeid serial not null, + name varchar(255), + constraint pk_esimple primary key (usertypeid) +); + +create table esome_type ( + id serial not null, + currency varchar(3), + locale varchar(20), + time_zone varchar(20), + constraint pk_esome_type primary key (id) +); + +create table etrans_many ( + id serial not null, + name varchar(255), + constraint pk_etrans_many primary key (id) +); + +create table evanilla_collection ( + id serial not null, + name varchar(255), + constraint pk_evanilla_collection primary key (id) +); + +create table evanilla_collection_detail ( + id serial not null, + evanilla_collection_id integer not null, + something varchar(255), + constraint pk_evanilla_collection_detail primary key (id) +); + +create table ewho_props ( + id bigserial not null, + name varchar(255), + who_created varchar(255) not null, + who_modified varchar(255) not null, + version bigint not null, + when_created timestamp not null, + when_modified timestamp not null, + constraint pk_ewho_props primary key (id) +); + +create table e_withinet ( + id bigserial not null, + name varchar(255), + inet_address varchar(50), + version bigint not null, + constraint pk_e_withinet primary key (id) +); + +create table td_child ( + child_id serial 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 serial not null, + parent_name varchar(255), + extended_name varchar(255), + constraint pk_td_parent primary key (parent_id) +); + +create table feature_desc ( + id serial not null, + name varchar(255), + description varchar(255), + constraint pk_feature_desc primary key (id) +); + +create table f_first ( + id bigserial not null, + name varchar(255), + constraint pk_f_first primary key (id) +); + +create table foo ( + foo_id serial not null, + important_text varchar(255), + version integer not null, + constraint pk_foo primary key (foo_id) +); + +create table gen_key_identity ( + id bigserial 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; + +create table gen_key_table ( + id bigserial not null, + description varchar(255), + constraint pk_gen_key_table primary key (id) +); + +create table c_group ( + id bigserial not null, + inactive boolean, + 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 imrelated ( + id bigserial not null, + name varchar(255), + owner_id bigint not null, + constraint pk_imrelated primary key (id) +); + +create table imroot ( + dtype varchar(10) not null, + id bigserial not null, + title varchar(255), + when_title timestamp, + name varchar(255), + constraint pk_imroot primary key (id) +); + +create table ixresource ( + dtype varchar(255), + id bytea not null, + name varchar(255), + constraint pk_ixresource primary key (id) +); + +create table info_company ( + id bigserial not null, + name varchar(255), + version bigint not null, + constraint pk_info_company primary key (id) +); + +create table info_contact ( + id bigserial 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 bigserial 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 bigserial 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; + +create table item ( + customer integer not null, + itemnumber varchar(255) not null, + description varchar(255), + units varchar(255), + type integer, + region integer, + 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 level1 ( + id bigserial 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 bigserial 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 bigserial not null, + name varchar(255), + constraint pk_level3 primary key (id) +); + +create table level4 ( + id bigserial not null, + name varchar(255), + constraint pk_level4 primary key (id) +); + +create table la_attr_value ( + id serial 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 mmedia ( + type varchar(31) not null, + id bigserial not null, + url varchar(255), + note varchar(255), + constraint pk_mmedia primary key (id) +); + +create table non_updateprop ( + id serial 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 bigserial 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_2 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 bigserial not null, + flags bigint, + printer_id bigint, + version bigint not null, + constraint pk_mprinter_state primary key (id) +); + +create table mprofile ( + id bigserial not null, + picture_id bigint, + name varchar(255), + constraint pk_mprofile primary key (id) +); + +create table mprotected_construct_bean ( + id bigserial not null, + name varchar(255), + constraint pk_mprotected_construct_bean primary key (id) +); + +create table mrole ( + roleid serial 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 bigserial not null, + name varchar(255), + constraint pk_msome_other primary key (id) +); + +create table muser ( + userid serial not null, + user_name varchar(255), + user_type_id integer, + constraint pk_muser primary key (userid) +); + +create table muser_type ( + id serial not null, + name varchar(255), + constraint pk_muser_type primary key (id) +); + +create table map_super_actual ( + id bigserial 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 bigserial 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 mnoc_role ( + role_id serial not null, + role_name varchar(255), + version integer not null, + constraint pk_mnoc_role primary key (role_id) +); + +create table mnoc_user ( + user_id serial 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 mp_role ( + id bigserial 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 bigserial not null, + name varchar(255), + constraint pk_mp_user primary key (id) +); + +create table my_lob_size ( + id serial not null, + name varchar(255), + my_count integer, + my_lob text, + constraint pk_my_lob_size primary key (id) +); + +create table my_lob_size_join_many ( + id serial 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_cached_bean ( + id bigserial 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 bigserial not null, + cached_bean_id bigint, + constraint pk_o_cached_bean_child primary key (id) +); + +create table ocar ( + id serial 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 oengine ( + engine_id bytea 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 bytea 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 o_order ( + id serial 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 serial not null, + order_id integer, + order_qty integer, + ship_qty integer, + unit_price float, + product_id integer, + cretime timestamp, + updtime timestamp not null, + constraint pk_o_order_detail primary key (id) +); + +create table s_orders ( + uuid varchar(255) not null, + constraint pk_s_orders primary key (uuid) +); + +create table s_order_items ( + uuid varchar(255) not null, + product_variant_uuid varchar(255), + order_uuid varchar(255), + quantity integer, + amount decimal(38), + constraint pk_s_order_items primary key (uuid) +); + +create table or_order_ship ( + id serial 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 oto_child ( + id serial 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_master ( + id bigserial not null, + name varchar(255), + constraint pk_oto_master primary key (id) +); + +create table pfile ( + id serial 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 serial not null, + content bytea, + cretime timestamp not null, + updtime timestamp not null, + version bigint not null, + constraint pk_pfile_content primary key (id) +); + +create table paggview ( + pview_id bytea, + amount integer not null, + constraint uq_paggview_pview_id unique (pview_id) +); + +create table pallet_location ( + type varchar(31) not null, + id serial not null, + zone_sid integer not null, + attribute varchar(255), + constraint pk_pallet_location primary key (id) +); + +create table parcel ( + parcelid bigserial not null, + description varchar(255), + constraint pk_parcel primary key (parcelid) +); + +create table parcel_location ( + parcellocid bigserial 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 bigserial not null, + val integer, + constraint pk_rawinherit_parent primary key (id) +); + +create table rawinherit_parent_rawinherit_dat ( + rawinherit_parent_id bigint not null, + rawinherit_data_id bigint not null, + constraint pk_rawinherit_parent_rawinher_0 primary key (rawinherit_parent_id,rawinherit_data_id) +); + +create table c_participation ( + id bigserial 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 mt_permission ( + id bytea not null, + name varchar(255), + constraint pk_mt_permission primary key (id) +); + +create table persistent_file ( + id serial 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 serial not null, + persistent_file_id integer, + content bytea, + cretime timestamp not null, + updtime timestamp not null, + version bigint not null, + constraint uq_persistent_file_content_pe_1 unique (persistent_file_id), + constraint pk_persistent_file_content primary key (id) +); + +create table persons ( + id bigserial not null, + surname varchar(64) not null, + name varchar(64) not null, + constraint pk_persons primary key (id) +); + +create table person ( + oid bigserial not null, + default_address_oid bigint, + version integer not null, + constraint pk_person primary key (oid) +); + +create table phones ( + id bigserial 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 o_product ( + id serial 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 bytea not null, + name varchar(255), + value varchar(100) not null, + constraint pk_pp primary key (id) +); + +create table pp_to_ww ( + pp_id bytea not null, + ww_id bytea not null, + constraint pk_pp_to_ww primary key (pp_id,ww_id) +); + +create table rcustomer ( + company varchar(255) not null, + name varchar(255) not null, + description varchar(255), + constraint pk_rcustomer primary key (company,name) +); + +create table r_orders ( + company varchar(255) not null, + order_number integer not null, + customername varchar(255), + item varchar(255), + constraint pk_r_orders primary key (company,order_number) +); + +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 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 bytea not null, + name varchar(50), + tenant_id bytea, + version bigint not null, + constraint pk_mt_role primary key (id) +); + +create table mt_role_permission ( + mt_role_id bytea not null, + mt_permission_id bytea not null, + constraint pk_mt_role_permission primary key (mt_role_id,mt_permission_id) +); + +create table em_role ( + id bigserial not null, + name varchar(255), + constraint pk_em_role primary key (id) +); + +create table f_second ( + id bigserial not null, + first bigint, + title varchar(255), + constraint uq_f_second_first unique (first), + constraint pk_f_second primary key (id) +); + +create table section ( + id serial not null, + article_id integer, + type integer, + content text, + 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 bigserial 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 bigserial not null, + name varchar(255), + referred_by_id bigint, + constraint pk_self_ref_customer primary key (id) +); + +create table self_ref_example ( + id bigserial not null, + name varchar(255) not null, + parent_id bigint, + constraint pk_self_ref_example primary key (id) +); + +create table some_enum_bean ( + id bigserial 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 bigserial 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 bigserial not null, + dow integer, + mth integer, + yr integer, + yr_mth date, + local_date date, + local_date_time timestamp, + offset_date_time timestamp, + zoned_date_time timestamp, + instant timestamp, + zone_id varchar(60), + zone_offset varchar(60), + 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 bigserial not null, + period_years integer, + period_months integer, + period_days integer, + anniversary date, + version bigint not null, + constraint pk_some_period_bean primary key (id) +); + +create table stockforecast ( + type varchar(31) not null, + id bigserial not null, + inner_report_id bigint, + constraint pk_stockforecast primary key (id) +); + +create table sub_section ( + id serial 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 serial not null, + description varchar(255), + version bigint not null, + constraint pk_sub_type primary key (sub_type_id) +); + +create table tbytes_only ( + id serial not null, + content bytea, + constraint pk_tbytes_only primary key (id) +); + +create table tcar ( + type varchar(31) not null, + plate_no varchar(255) not null, + truckload bigint, + constraint pk_tcar primary key (plate_no) +); + +create table tint_root ( + my_type integer not null, + id serial not null, + name varchar(255), + child_property varchar(255), + constraint pk_tint_root primary key (id) +); + +create table tjoda_entity ( + id serial not null, + local_time time, + constraint pk_tjoda_entity primary key (id) +); + +create table t_mapsuper1 ( + id serial not null, + something varchar(255), + name varchar(255), + version integer not null, + constraint pk_t_mapsuper1 primary key (id) +); + +create table t_oneb ( + id serial not null, + name varchar(255), + description varchar(255), + active boolean, + constraint pk_t_oneb primary key (id) +); + +create table t_detail_with_other_namexxxyy ( + id integer not null, + name varchar(255), + description varchar(255), + active boolean, + master_id integer, + constraint pk_t_detail_with_other_namexx_0 primary key (id) +); +create sequence t_atable_detail_seq; + +create table ts_detail_two ( + id serial not null, + name varchar(255), + description varchar(255), + active boolean, + master_id integer, + constraint pk_ts_detail_two primary key (id) +); + +create table t_atable_thatisrelatively ( + id integer not null, + name varchar(255), + description varchar(255), + active boolean, + constraint pk_t_atable_thatisrelatively primary key (id) +); +create sequence t_atable_master_seq; + +create table ts_master_two ( + id serial not null, + name varchar(255), + description varchar(255), + active boolean, + constraint pk_ts_master_two primary key (id) +); + +create table tuuid_entity ( + id bytea not null, + name varchar(255), + constraint pk_tuuid_entity primary key (id) +); + +create table twheel ( + id bigserial not null, + owner_plate_no varchar(255) not null, + constraint pk_twheel primary key (id) +); + +create table twith_pre_insert ( + id serial not null, + name varchar(255) not null, + title varchar(255), + constraint pk_twith_pre_insert primary key (id) +); + +create table mt_tenant ( + id bytea not null, + name varchar(255), + version bigint not null, + constraint pk_mt_tenant primary key (id) +); + +create table sa_tire ( + id bigint not null, + version integer not null, + constraint pk_sa_tire primary key (id) +); +create sequence sa_tire_seq; + +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; + +create table trip ( + id serial not null, + vehicle_driver_id integer, + destination varchar(255), + address_id smallint, + 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 serial not null, + something varchar(255), + constraint pk_truck_ref 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 ut_detail ( + id serial 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 serial not null, + name varchar(255), + description varchar(255), + version integer not null, + constraint pk_ut_master primary key (id) +); + +create table uuone ( + id bytea not null, + name varchar(255), + constraint pk_uuone primary key (id) +); + +create table uutwo ( + id bytea not null, + name varchar(255), + master_id bytea, + constraint pk_uutwo primary key (id) +); + +create table em_user ( + id bigserial not null, + name varchar(255), + constraint pk_em_user primary key (id) +); + +create table tx_user ( + id bigserial not null, + name varchar(255), + constraint pk_tx_user primary key (id) +); + +create table c_user ( + id bigserial not null, + inactive boolean, + name varchar(255), + email 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 oto_user ( + id bigserial 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 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 serial not null, + license_number varchar(255), + registration_date timestamp, + cretime timestamp not null, + updtime timestamp not null, + version bigint not null, + truck_ref_id integer, + capacity float, + driver varchar(255), + car_ref_id integer, + constraint pk_vehicle primary key (id) +); + +create table vehicle_driver ( + id serial not null, + name varchar(255), + vehicle_id integer, + address_id smallint, + 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 warehouses ( + id serial 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 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; + +create table sp_car_wheel ( + id bigint not null, + version integer not null, + constraint pk_sp_car_wheel primary key (id) +); +create sequence sp_car_wheel_seq; + +create table wheel ( + id bigint not null, + version integer not null, + constraint pk_wheel primary key (id) +); +create sequence wheel_seq; + +create table with_zero ( + id bigserial not null, + name varchar(255), + parent_id integer, + version bigint not null, + constraint pk_with_zero primary key (id) +); + +create table parent ( + id serial not null, + name varchar(255), + constraint pk_parent primary key (id) +); + +create table wview ( + id bytea not null, + name varchar(255) not null, + constraint uq_wview_name unique (name), + constraint pk_wview primary key (id) +); + +create table zones ( + type varchar(31) not null, + id serial not null, + attribute varchar(255), + constraint pk_zones primary key (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_bar_foo_id on bar (foo_id); + +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; +create index ix_o_address_country_code on o_address (country_code); + +alter table animals add constraint fk_animals_shelter_id foreign key (shelter_id) references animal_shelter (id) on delete restrict on update restrict; +create index ix_animals_shelter_id on animals (shelter_id); + +alter table attribute add constraint fk_attribute_attribute_holder_1 foreign key (attribute_holder_id) references attribute_holder (id) on delete restrict on update restrict; +create index ix_attribute_attribute_holder_1 on attribute (attribute_holder_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_id on bbookmark (user_id); + +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; + +alter table ckey_detail add constraint fk_ckey_detail_ckey_parent foreign key (one_key,two_key) references ckey_parent (one_key,two_key) on delete restrict on update restrict; +create index ix_ckey_detail_one_key_two_key on ckey_detail (one_key,two_key); + +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_ckey_parent_assoc_id on ckey_parent (assoc_id); + +alter table calculation_result add constraint fk_calculation_result_product_1 foreign key (product_configuration_id) references configuration (id) on delete restrict on update restrict; +create index ix_calculation_result_product_1 on calculation_result (product_configuration_id); + +alter table calculation_result add constraint fk_calculation_result_group_c_2 foreign key (group_configuration_id) references configuration (id) on delete restrict on update restrict; +create index ix_calculation_result_group_c_2 on calculation_result (group_configuration_id); + +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_car on sp_car_car_wheels (car); + +alter table sp_car_car_wheels add constraint fk_sp_car_car_wheels_sp_car_w_2 foreign key (wheel) references sp_car_wheel (id) on delete restrict on update restrict; +create index ix_sp_car_car_wheels_wheel on sp_car_car_wheels (wheel); + +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_car_accessory_car_id on car_accessory (car_id); + +alter table configuration add constraint fk_configuration_configuratio_1 foreign key (configurations_id) references configurations (id) on delete restrict on update restrict; +create index ix_configuration_configuratio_1 on configuration (configurations_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_customer_id on contact (customer_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_group_id on contact (group_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_contact_note_contact_id on contact_note (contact_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_c_conversation_group_id on c_conversation (group_id); + +alter table o_customer add constraint fk_o_customer_billing_address_1 foreign key (billing_address_id) references o_address (id) on delete restrict on update restrict; +create index ix_o_customer_billing_address_1 on o_customer (billing_address_id); + +alter table o_customer add constraint fk_o_customer_shipping_addres_2 foreign key (shipping_address_id) references o_address (id) on delete restrict on update restrict; +create index ix_o_customer_shipping_addres_2 on o_customer (shipping_address_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_eemb_inner_outer_id on eemb_inner (outer_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_einvoice_person_id on einvoice (person_id); + +alter table enull_collection_detail add constraint fk_enull_collection_detail_en_1 foreign key (enull_collection_id) references enull_collection (id) on delete restrict on update restrict; +create index ix_enull_collection_detail_en_1 on enull_collection_detail (enull_collection_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_a_b_id on eopt_one_a (b_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_eopt_one_b_c_id on eopt_one_b (c_id); + +alter table evanilla_collection_detail add constraint fk_evanilla_collection_detail_1 foreign key (evanilla_collection_id) references evanilla_collection (id) on delete restrict on update restrict; +create index ix_evanilla_collection_detail_1 on evanilla_collection_detail (evanilla_collection_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_td_child_parent_id on td_child (parent_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_imrelated_owner_id on imrelated (owner_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; +create index ix_info_contact_company_id on info_contact (company_id); + +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; + +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_drel_invoice_booking on drel_invoice (booking); + +alter table item add constraint fk_item_type foreign key (customer,type) references type (customer,type) on delete restrict on update restrict; +create index ix_item_customer_type on item (customer,type); + +alter table item add constraint fk_item_region foreign key (customer,region) references region (customer,type) on delete restrict on update restrict; +create index ix_item_customer_region on item (customer,region); + +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_level1_id on level1_level4 (level1_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_level4_level4_id on level1_level4 (level4_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_level1_id on level1_level2 (level1_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_level1_level2_level2_id on level1_level2 (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_level2_id on level2_level3 (level2_id); + +alter table level2_level3 add constraint fk_level2_level3_level3 foreign key (level3_id) references level3 (id) on delete restrict on update restrict; +create index ix_level2_level3_level3_id on level2_level3 (level3_id); + +alter table la_attr_value_attribute add constraint fk_la_attr_value_attribute_la_1 foreign key (la_attr_value_id) references la_attr_value (id) on delete restrict on update restrict; +create index ix_la_attr_value_attribute_la_1 on la_attr_value_attribute (la_attr_value_id); + +alter table la_attr_value_attribute add constraint fk_la_attr_value_attribute_at_2 foreign key (attribute_id) references attribute (id) on delete restrict on update restrict; +create index ix_la_attr_value_attribute_at_2 on la_attr_value_attribute (attribute_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; +create index ix_mprinter_current_state_id on mprinter (current_state_id); + +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_3 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; + +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_mprinter_state_printer_id on mprinter_state (printer_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_mprofile_picture_id on mprofile (picture_id); + +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_mrole_roleid on mrole_muser (mrole_roleid); + +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_mrole_muser_muser_userid on mrole_muser (muser_userid); + +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_muser_user_type_id on muser (user_type_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_conversation_id on c_message (conversation_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; +create index ix_c_message_user_id on c_message (user_id); + +alter table mnoc_user_mnoc_role add constraint fk_mnoc_user_mnoc_role_mnoc_u_1 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_u_1 on mnoc_user_mnoc_role (mnoc_user_user_id); + +alter table mnoc_user_mnoc_role add constraint fk_mnoc_user_mnoc_role_mnoc_r_2 foreign key (mnoc_role_role_id) references mnoc_role (role_id) on delete restrict on update restrict; +create index ix_mnoc_user_mnoc_role_mnoc_r_2 on mnoc_user_mnoc_role (mnoc_role_role_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_mp_role_mp_user_id on mp_role (mp_user_id); + +alter table my_lob_size_join_many add constraint fk_my_lob_size_join_many_pare_1 foreign key (parent_id) references my_lob_size (id) on delete restrict on update restrict; +create index ix_my_lob_size_join_many_pare_1 on my_lob_size_join_many (parent_id); + +alter table o_cached_bean_country add constraint fk_o_cached_bean_country_o_ca_1 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_ca_1 on o_cached_bean_country (o_cached_bean_id); + +alter table o_cached_bean_country add constraint fk_o_cached_bean_country_o_co_2 foreign key (o_country_code) references o_country (code) on delete restrict on update restrict; +create index ix_o_cached_bean_country_o_co_2 on o_cached_bean_country (o_country_code); + +alter table o_cached_bean_child add constraint fk_o_cached_bean_child_cached_1 foreign key (cached_bean_id) references o_cached_bean (id) on delete restrict on update restrict; +create index ix_o_cached_bean_child_cached_1 on o_cached_bean_child (cached_bean_id); + +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; + +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_kcustomer_id on o_order (kcustomer_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_order_id on o_order_detail (order_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_o_order_detail_product_id on o_order_detail (product_id); + +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_s_order_items_order_uuid on s_order_items (order_uuid); + +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_or_order_ship_order_id on or_order_ship (order_id); + +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 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; + +alter table pallet_location add constraint fk_pallet_location_zone_sid foreign key (zone_sid) references zones (id) on delete restrict on update restrict; +create index ix_pallet_location_zone_sid on pallet_location (zone_sid); + +alter table parcel_location add constraint fk_parcel_location_parcelid foreign key (parcelid) references parcel (parcelid) on delete restrict on update restrict; + +alter table rawinherit_parent_rawinherit_dat add constraint fk_rawinherit_parent_rawinher_1 foreign key (rawinherit_parent_id) references rawinherit_parent (id) on delete restrict on update restrict; +create index ix_rawinherit_parent_rawinher_1 on rawinherit_parent_rawinherit_dat (rawinherit_parent_id); + +alter table rawinherit_parent_rawinherit_dat add constraint fk_rawinherit_parent_rawinher_2 foreign key (rawinherit_data_id) references rawinherit_data (id) on delete restrict on update restrict; +create index ix_rawinherit_parent_rawinher_2 on rawinherit_parent_rawinherit_dat (rawinherit_data_id); + +alter table c_participation add constraint fk_c_participation_conversati_1 foreign key (conversation_id) references c_conversation (id) on delete restrict on update restrict; +create index ix_c_participation_conversati_1 on c_participation (conversation_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_c_participation_user_id on c_participation (user_id); + +alter table persistent_file_content add constraint fk_persistent_file_content_pe_1 foreign key (persistent_file_id) references persistent_file (id) on delete restrict on update restrict; + +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_default_address_oid on person (default_address_oid); + +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_phones_person_id on phones (person_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_pp_id on pp_to_ww (pp_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_pp_to_ww_ww_id on pp_to_ww (ww_id); + +alter table r_orders add constraint fk_r_orders_rcustomer foreign key (company,customername) references rcustomer (company,name) on delete restrict on update restrict; +create index ix_r_orders_company_customern_1 on r_orders (company,customername); + +alter table resourcefile add constraint fk_resourcefile_parentresourc_1 foreign key (parentresourcefileid) references resourcefile (id) on delete restrict on update restrict; +create index ix_resourcefile_parentresourc_1 on resourcefile (parentresourcefileid); + +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_tenant_id on mt_role (tenant_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_role_1 on mt_role_permission (mt_role_id); + +alter table mt_role_permission add constraint fk_mt_role_permission_mt_perm_2 foreign key (mt_permission_id) references mt_permission (id) on delete restrict on update restrict; +create index ix_mt_role_permission_mt_perm_2 on mt_role_permission (mt_permission_id); + +alter table f_second add constraint fk_f_second_first foreign key (first) references f_first (id) on delete restrict on update restrict; + +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_section_article_id on section (article_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_parent_parent_id on self_parent (parent_id); + +alter table self_ref_customer add constraint fk_self_ref_customer_referred_1 foreign key (referred_by_id) references self_ref_customer (id) on delete restrict on update restrict; +create index ix_self_ref_customer_referred_1 on self_ref_customer (referred_by_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; +create index ix_self_ref_example_parent_id on self_ref_example (parent_id); + +alter table stockforecast add constraint fk_stockforecast_inner_report_1 foreign key (inner_report_id) references inner_report (id) on delete restrict on update restrict; +create index ix_stockforecast_inner_report_1 on stockforecast (inner_report_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_sub_section_section_id on sub_section (section_id); + +alter table t_detail_with_other_namexxxyy add constraint fk_t_detail_with_other_namexx_1 foreign key (master_id) references t_atable_thatisrelatively (id) on delete restrict on update restrict; +create index ix_t_detail_with_other_namexx_1 on t_detail_with_other_namexxxyy (master_id); + +alter table ts_detail_two add constraint fk_ts_detail_two_master_id foreign key (master_id) references ts_master_two (id) on delete restrict on update restrict; +create index ix_ts_detail_two_master_id on ts_detail_two (master_id); + +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; +create index ix_twheel_owner_plate_no on twheel (owner_plate_no); + +alter table tire add constraint fk_tire_wheel foreign key (wheel) references wheel (id) on delete restrict on update restrict; + +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_vehicle_driver_id on trip (vehicle_driver_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_trip_address_id on trip (address_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_type_sub_type_id on type (sub_type_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_ut_detail_utmaster_id on ut_detail (utmaster_id); + +alter table uutwo add constraint fk_uutwo_master_id foreign key (master_id) references uuone (id) on delete restrict on update restrict; +create index ix_uutwo_master_id on uutwo (master_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_c_user_group_id on c_user (group_id); + +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; + +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_user_id on em_user_role (user_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_em_user_role_role_id on em_user_role (role_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_truck_ref_id on vehicle (truck_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_car_ref_id on vehicle (car_ref_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_vehicle_id on vehicle_driver (vehicle_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_vehicle_driver_address_id on vehicle_driver (address_id); + +alter table warehouses add constraint fk_warehouses_officezoneid foreign key (officezoneid) references zones (id) on delete restrict on update restrict; +create index ix_warehouses_officezoneid on warehouses (officezoneid); + +alter table warehousesshippingzones add constraint fk_warehousesshippingzones_wa_1 foreign key (warehouseid) references warehouses (id) on delete restrict on update restrict; +create index ix_warehousesshippingzones_wa_1 on warehousesshippingzones (warehouseid); + +alter table warehousesshippingzones add constraint fk_warehousesshippingzones_zo_2 foreign key (shippingzoneid) references zones (id) on delete restrict on update restrict; +create index ix_warehousesshippingzones_sh_2 on warehousesshippingzones (shippingzoneid); + +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_tire on sa_wheel (tire); + +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_sa_wheel_car on sa_wheel (car); + +alter table with_zero add constraint fk_with_zero_parent_id foreign key (parent_id) references parent (id) on delete restrict on update restrict; +create index ix_with_zero_parent_id on with_zero (parent_id); + diff --git a/src/test/ddl-review/pg-drop.sql b/src/test/ddl-review/pg-drop.sql new file mode 100644 index 000000000..cf7ea95f8 --- /dev/null +++ b/src/test/ddl-review/pg-drop.sql @@ -0,0 +1,776 @@ +alter table bar drop constraint fk_bar_foo_id; +drop index ix_bar_foo_id; + +alter table o_address drop constraint fk_o_address_country_code; +drop index ix_o_address_country_code; + +alter table animals drop constraint fk_animals_shelter_id; +drop index ix_animals_shelter_id; + +alter table attribute drop constraint fk_attribute_attribute_holder_1; +drop index ix_attribute_attribute_holder_1; + +alter table bbookmark drop constraint fk_bbookmark_user_id; +drop index ix_bbookmark_user_id; + +alter table drel_booking drop constraint fk_drel_booking_agent_invoice; + +alter table drel_booking drop constraint fk_drel_booking_client_invoice; + +alter table ckey_detail drop constraint fk_ckey_detail_ckey_parent; +drop index ix_ckey_detail_one_key_two_key; + +alter table ckey_parent drop constraint fk_ckey_parent_assoc_id; +drop index ix_ckey_parent_assoc_id; + +alter table calculation_result drop constraint fk_calculation_result_product_1; +drop index ix_calculation_result_product_1; + +alter table calculation_result drop constraint fk_calculation_result_group_c_2; +drop index ix_calculation_result_group_c_2; + +alter table sp_car_car_wheels drop constraint fk_sp_car_car_wheels_sp_car_car; +drop index ix_sp_car_car_wheels_car; + +alter table sp_car_car_wheels drop constraint fk_sp_car_car_wheels_sp_car_w_2; +drop index ix_sp_car_car_wheels_wheel; + +alter table car_accessory drop constraint fk_car_accessory_car_id; +drop index ix_car_accessory_car_id; + +alter table configuration drop constraint fk_configuration_configuratio_1; +drop index ix_configuration_configuratio_1; + +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 c_conversation drop constraint fk_c_conversation_group_id; +drop index ix_c_conversation_group_id; + +alter table o_customer drop constraint fk_o_customer_billing_address_1; +drop index ix_o_customer_billing_address_1; + +alter table o_customer drop constraint fk_o_customer_shipping_addres_2; +drop index ix_o_customer_shipping_addres_2; + +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_enull_collection_detail_en_1; +drop index ix_enull_collection_detail_en_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 evanilla_collection_detail drop constraint fk_evanilla_collection_detail_1; +drop index ix_evanilla_collection_detail_1; + +alter table td_child drop constraint fk_td_child_parent_id; +drop index ix_td_child_parent_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_type; +drop index ix_item_customer_type; + +alter table item drop constraint fk_item_region; +drop index ix_item_customer_region; + +alter table level1_level4 drop constraint fk_level1_level4_level1; +drop index ix_level1_level4_level1_id; + +alter table level1_level4 drop constraint fk_level1_level4_level4; +drop index ix_level1_level4_level4_id; + +alter table level1_level2 drop constraint fk_level1_level2_level1; +drop index ix_level1_level2_level1_id; + +alter table level1_level2 drop constraint fk_level1_level2_level2; +drop index ix_level1_level2_level2_id; + +alter table level2_level3 drop constraint fk_level2_level3_level2; +drop index ix_level2_level3_level2_id; + +alter table level2_level3 drop constraint fk_level2_level3_level3; +drop index ix_level2_level3_level3_id; + +alter table la_attr_value_attribute drop constraint fk_la_attr_value_attribute_la_1; +drop index ix_la_attr_value_attribute_la_1; + +alter table la_attr_value_attribute drop constraint fk_la_attr_value_attribute_at_2; +drop index ix_la_attr_value_attribute_at_2; + +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_mprinter_last_swap_magenta_3; + +alter table mprinter drop constraint fk_mprinter_last_swap_yellow_id; + +alter table mprinter drop constraint fk_mprinter_last_swap_black_id; + +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_roleid; + +alter table mrole_muser drop constraint fk_mrole_muser_muser; +drop index ix_mrole_muser_muser_userid; + +alter table muser drop constraint fk_muser_user_type_id; +drop index ix_muser_user_type_id; + +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 mnoc_user_mnoc_role drop constraint fk_mnoc_user_mnoc_role_mnoc_u_1; +drop index ix_mnoc_user_mnoc_role_mnoc_u_1; + +alter table mnoc_user_mnoc_role drop constraint fk_mnoc_user_mnoc_role_mnoc_r_2; +drop index ix_mnoc_user_mnoc_role_mnoc_r_2; + +alter table mp_role drop constraint fk_mp_role_mp_user_id; +drop index ix_mp_role_mp_user_id; + +alter table my_lob_size_join_many drop constraint fk_my_lob_size_join_many_pare_1; +drop index ix_my_lob_size_join_many_pare_1; + +alter table o_cached_bean_country drop constraint fk_o_cached_bean_country_o_ca_1; +drop index ix_o_cached_bean_country_o_ca_1; + +alter table o_cached_bean_country drop constraint fk_o_cached_bean_country_o_co_2; +drop index ix_o_cached_bean_country_o_co_2; + +alter table o_cached_bean_child drop constraint fk_o_cached_bean_child_cached_1; +drop index ix_o_cached_bean_child_cached_1; + +alter table oengine drop constraint fk_oengine_car_id; + +alter table ogear_box drop constraint fk_ogear_box_car_id; + +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 oto_child drop constraint fk_oto_child_master_id; + +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_dat drop constraint fk_rawinherit_parent_rawinher_1; +drop index ix_rawinherit_parent_rawinher_1; + +alter table rawinherit_parent_rawinherit_dat drop constraint fk_rawinherit_parent_rawinher_2; +drop index ix_rawinherit_parent_rawinher_2; + +alter table c_participation drop constraint fk_c_participation_conversati_1; +drop index ix_c_participation_conversati_1; + +alter table c_participation drop constraint fk_c_participation_user_id; +drop index ix_c_participation_user_id; + +alter table persistent_file_content drop constraint fk_persistent_file_content_pe_1; + +alter table person drop constraint fk_person_default_address_oid; +drop index ix_person_default_address_oid; + +alter table phones drop constraint fk_phones_person_id; +drop index ix_phones_person_id; + +alter table pp_to_ww drop constraint fk_pp_to_ww_pp; +drop index ix_pp_to_ww_pp_id; + +alter table pp_to_ww drop constraint fk_pp_to_ww_wview; +drop index ix_pp_to_ww_ww_id; + +alter table r_orders drop constraint fk_r_orders_rcustomer; +drop index ix_r_orders_company_customern_1; + +alter table resourcefile drop constraint fk_resourcefile_parentresourc_1; +drop index ix_resourcefile_parentresourc_1; + +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_1; + +alter table mt_role_permission drop constraint fk_mt_role_permission_mt_perm_2; +drop index ix_mt_role_permission_mt_perm_2; + +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_self_ref_customer_referred_1; +drop index ix_self_ref_customer_referred_1; + +alter table self_ref_example drop constraint fk_self_ref_example_parent_id; +drop index ix_self_ref_example_parent_id; + +alter table stockforecast drop constraint fk_stockforecast_inner_report_1; +drop index ix_stockforecast_inner_report_1; + +alter table sub_section drop constraint fk_sub_section_section_id; +drop index ix_sub_section_section_id; + +alter table t_detail_with_other_namexxxyy drop constraint fk_t_detail_with_other_namexx_1; +drop index ix_t_detail_with_other_namexx_1; + +alter table ts_detail_two drop constraint fk_ts_detail_two_master_id; +drop index ix_ts_detail_two_master_id; + +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 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 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 c_user drop constraint fk_c_user_group_id; +drop index ix_c_user_group_id; + +alter table oto_user drop constraint fk_oto_user_account_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_truck_ref_id; +drop index ix_vehicle_truck_ref_id; + +alter table vehicle drop constraint fk_vehicle_car_ref_id; +drop index ix_vehicle_car_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_warehousesshippingzones_wa_1; +drop index ix_warehousesshippingzones_wa_1; + +alter table warehousesshippingzones drop constraint fk_warehousesshippingzones_zo_2; +drop index ix_warehousesshippingzones_sh_2; + +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 with_zero drop constraint fk_with_zero_parent_id; +drop index ix_with_zero_parent_id; + +drop table if exists asimple_bean cascade; + +drop table if exists bar cascade; + +drop table if exists oto_account cascade; + +drop table if exists o_address cascade; + +drop table if exists address cascade; + +drop table if exists animals 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_user cascade; + +drop table if exists bsimple_with_gen cascade; + +drop table if exists bwith_qident 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 ckey_assoc cascade; + +drop table if exists ckey_detail cascade; + +drop table if exists ckey_parent cascade; + +drop table if exists calculation_result cascade; + +drop table if exists cao_bean cascade; + +drop table if exists sa_car cascade; +drop sequence if exists sa_car_seq; + +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 car_accessory 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 c_conversation cascade; + +drop table if exists o_country cascade; + +drop table if exists o_customer cascade; + +drop table if exists dexh_entity cascade; + +drop table if exists dperson cascade; + +drop table if exists rawinherit_data cascade; + +drop table if exists e_basic 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_basic_enum_id 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_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 e_basic_ndc cascade; + +drop table if exists e_basicver cascade; + +drop table if exists e_basic_withlife cascade; + +drop table if exists e_basicverucon cascade; + +drop table if exists eemb_inner cascade; + +drop table if exists eemb_outer cascade; + +drop table if exists egen_props 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 eperson cascade; + +drop table if exists esimple cascade; + +drop table if exists esome_type cascade; + +drop table if exists etrans_many 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 td_child cascade; + +drop table if exists td_parent 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; + +drop table if exists gen_key_table cascade; + +drop table if exists c_group 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 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 table if exists la_attr_value cascade; + +drop table if exists la_attr_value_attribute 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 map_super_actual cascade; + +drop table if exists c_message 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 mp_role cascade; + +drop table if exists mp_user 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_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 ocar cascade; + +drop table if exists oengine cascade; + +drop table if exists ogear_box 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 or_order_ship cascade; + +drop table if exists oto_child cascade; + +drop table if exists oto_master 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_dat cascade; + +drop table if exists c_participation 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 persons cascade; + +drop table if exists person cascade; + +drop table if exists phones 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 rcustomer cascade; + +drop table if exists r_orders cascade; + +drop table if exists region 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 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 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 stockforecast cascade; + +drop table if exists sub_section cascade; + +drop table if exists sub_type cascade; + +drop table if exists tbytes_only cascade; + +drop table if exists tcar 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 ts_detail_two cascade; + +drop table if exists t_atable_thatisrelatively cascade; +drop sequence if exists t_atable_master_seq; + +drop table if exists ts_master_two 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 mt_tenant cascade; + +drop table if exists sa_tire cascade; +drop sequence if exists sa_tire_seq; + +drop table if exists tire cascade; +drop sequence if exists tire_seq; + +drop table if exists trip cascade; + +drop table if exists truck_ref cascade; + +drop table if exists type 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 em_user cascade; + +drop table if exists tx_user cascade; + +drop table if exists c_user cascade; + +drop table if exists oto_user 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 warehouses cascade; + +drop table if exists warehousesshippingzones cascade; + +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 wheel cascade; +drop sequence if exists wheel_seq; + +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; +