From 0aec597cf251d3ff3290f08d0b8fa30031643dac Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Thu, 8 Mar 2018 19:35:48 +1300 Subject: [PATCH] #1318 No effective change - DDL review for ... ENH: native UUID-support for SqlServer --- src/test/ddl-review/sqlserver-create-all.sql | 3626 ++++++++++++++++++ src/test/ddl-review/sqlserver-drop-all.sql | 1549 ++++++++ 2 files changed, 5175 insertions(+) create mode 100644 src/test/ddl-review/sqlserver-create-all.sql create mode 100644 src/test/ddl-review/sqlserver-drop-all.sql diff --git a/src/test/ddl-review/sqlserver-create-all.sql b/src/test/ddl-review/sqlserver-create-all.sql new file mode 100644 index 000000000..de66ddd39 --- /dev/null +++ b/src/test/ddl-review/sqlserver-create-all.sql @@ -0,0 +1,3626 @@ +-- Generated by ebean unknown at 2018-03-08T04:43:42.126Z +create table asimple_bean ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_asimple_bean primary key (id) +); +create sequence asimple_bean_seq as bigint start with 1 increment by 50; + +create table bar ( + bar_type nvarchar(31) not null, + bar_id integer not null, + foo_id integer not null, + version integer not null, + constraint pk_bar primary key (bar_id) +); +create sequence bar_seq as bigint start with 1 increment by 50; + +create table oto_account ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_oto_account primary key (id) +); +create sequence oto_account_seq as bigint start with 1 increment by 50; + +create table addr ( + id numeric(19) not null, + employee_id numeric(19), + name nvarchar(255), + address_line1 nvarchar(255), + address_line2 nvarchar(255), + city nvarchar(255), + version numeric(19) not null, + constraint pk_addr primary key (id) +); +create sequence addr_seq as bigint start with 1 increment by 50; + +create table address ( + oid numeric(19) not null, + street nvarchar(255), + version integer not null, + constraint pk_address primary key (oid) +); +create sequence address_seq as bigint start with 1 increment by 50; + +create table o_address ( + id smallint not null, + line_1 nvarchar(100), + line_2 nvarchar(100), + city nvarchar(100), + cretime datetime2, + country_code nvarchar(2), + updtime datetime2 not null, + constraint pk_o_address primary key (id) +); +create sequence o_address_seq as bigint start with 1 increment by 50; + +create table album ( + id numeric(19) not null, + name nvarchar(255), + cover_id numeric(19), + deleted integer default 0 not null, + created_at datetime2 not null, + last_update datetime2 not null, + constraint pk_album primary key (id) +); +create unique nonclustered index uq_album_cover_id on album(cover_id) where cover_id is not null; +create sequence album_seq as bigint start with 1 increment by 50; + +create table animal ( + species nvarchar(255) not null, + id numeric(19) not null, + shelter_id numeric(19), + version numeric(19) not null, + name nvarchar(255), + registration_number nvarchar(255), + date_of_birth date, + dog_size nvarchar(255), + constraint pk_animal primary key (id) +); +create sequence animal_seq as bigint start with 1 increment by 50; + +create table animal_shelter ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_animal_shelter primary key (id) +); +create sequence animal_shelter_seq as bigint start with 1 increment by 50; + +create table article ( + id integer not null, + name nvarchar(255), + author nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_article primary key (id) +); +create sequence article_seq as bigint start with 1 increment by 50; + +create table attribute ( + option_type integer not null, + id integer not null, + attribute_holder_id integer, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_attribute primary key (id) +); +create sequence attribute_seq as bigint start with 1 increment by 50; + +create table attribute_holder ( + id integer not null, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_attribute_holder primary key (id) +); +create sequence attribute_holder_seq as bigint start with 1 increment by 50; + +create table audit_log ( + id numeric(19) not null, + description nvarchar(255), + modified_description nvarchar(255), + constraint pk_audit_log primary key (id) +); +create sequence audit_log_seq as bigint start with 1 increment by 50; + +create table bbookmark ( + id integer not null, + bookmark_reference nvarchar(255), + user_id integer, + constraint pk_bbookmark primary key (id) +); +create sequence bbookmark_seq as bigint start with 1 increment by 50; + +create table bbookmark_user ( + id integer not null, + name nvarchar(255), + password nvarchar(255), + email_address nvarchar(255), + country nvarchar(255), + constraint pk_bbookmark_user primary key (id) +); +create sequence bbookmark_user_seq as bigint start with 1 increment by 50; + +create table bsimple_with_gen ( + id integer not null, + name nvarchar(255), + constraint pk_bsimple_with_gen primary key (id) +); +create sequence bsimple_with_gen_seq as bigint start with 1 increment by 50; + +create table bsite ( + id nvarchar(40) not null, + name nvarchar(255), + constraint pk_bsite primary key (id) +); + +create table bsite_user ( + site_id nvarchar(40) not null, + user_id nvarchar(40) not null, + access_level integer, + constraint ck_bsite_user_access_level check ( access_level in (0,1,2)), + constraint pk_bsite_user primary key (site_id,user_id) +); + +create table bsite_user_b ( + site nvarchar(40) not null, + usr nvarchar(40) not null, + access_level integer, + constraint ck_bsite_user_b_access_level check ( access_level in (0,1,2)), + constraint pk_bsite_user_b primary key (site,usr) +); + +create table bsite_user_c ( + site_uid nvarchar(40) not null, + user_uid nvarchar(40) not null, + access_level integer, + constraint ck_bsite_user_c_access_level check ( access_level in (0,1,2)), + constraint pk_bsite_user_c primary key (site_uid,user_uid) +); + +create table buser ( + id nvarchar(40) not null, + name nvarchar(255), + constraint pk_buser primary key (id) +); + +create table bwith_qident ( + id integer not null, + [Name] nvarchar(191), + last_updated datetime2 not null, + constraint pk_bwith_qident primary key (id) +); +create unique nonclustered index uq_bwith_qident_name on bwith_qident([Name]) where [Name] is not null; +create sequence bwith_qident_seq as bigint start with 1 increment by 50; + +create table basic_joda_entity ( + id numeric(19) not null, + name nvarchar(255), + period nvarchar(50), + created datetime2 not null, + updated datetime2 not null, + version datetime2 not null, + constraint pk_basic_joda_entity primary key (id) +); +create sequence basic_joda_entity_seq as bigint start with 1 increment by 50; + +create table bean_with_time_zone ( + id numeric(19) not null, + name nvarchar(255), + timezone nvarchar(20), + constraint pk_bean_with_time_zone primary key (id) +); +create sequence bean_with_time_zone_seq as bigint start with 1 increment by 50; + +create table drel_booking ( + id numeric(19) not null, + booking_uid numeric(19), + agent_invoice numeric(19), + client_invoice numeric(19), + version integer not null, + constraint pk_drel_booking primary key (id) +); +create unique nonclustered index uq_drel_booking_booking_uid on drel_booking(booking_uid) where booking_uid is not null; +create unique nonclustered index uq_drel_booking_agent_invoice on drel_booking(agent_invoice) where agent_invoice is not null; +create unique nonclustered index uq_drel_booking_client_invoice on drel_booking(client_invoice) where client_invoice is not null; +create sequence drel_booking_seq as bigint start with 1 increment by 50; + +create table cinh_root ( + dtype nvarchar(3) not null, + id integer not null, + license_number nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + driver nvarchar(255), + notes nvarchar(255), + action nvarchar(255), + constraint pk_cinh_root primary key (id) +); +create sequence cinh_root_seq as bigint start with 1 increment by 50; + +create table ckey_assoc ( + id integer not null, + assoc_one nvarchar(255), + constraint pk_ckey_assoc primary key (id) +); +create sequence ckey_assoc_seq as bigint start with 1 increment by 50; + +create table ckey_detail ( + id integer not null, + something nvarchar(255), + one_key integer, + two_key nvarchar(127), + constraint pk_ckey_detail primary key (id) +); +create sequence ckey_detail_seq as bigint start with 1 increment by 50; + +create table ckey_parent ( + one_key integer not null, + two_key nvarchar(127) not null, + name nvarchar(255), + assoc_id integer, + version integer not null, + constraint pk_ckey_parent primary key (one_key,two_key) +); + +create table calculation_result ( + id integer not null, + charge float(32) not null, + product_configuration_id integer, + group_configuration_id integer, + constraint pk_calculation_result primary key (id) +); +create sequence calculation_result_seq as bigint start with 1 increment by 50; + +create table cao_bean ( + x_cust_id integer not null, + x_type_id integer not null, + description nvarchar(255), + version numeric(19) not null, + constraint pk_cao_bean primary key (x_cust_id,x_type_id) +); + +create table sa_car ( + id numeric(19) not null, + version integer not null, + constraint pk_sa_car primary key (id) +); +create sequence sa_car_seq as bigint start with 1 increment by 50; + +create table sp_car_car ( + id numeric(19) not null, + version integer not null, + constraint pk_sp_car_car primary key (id) +); +create sequence sp_car_car_seq as bigint start with 1 increment by 50; + +create table sp_car_car_wheels ( + car numeric(19) not null, + wheel numeric(19) not null, + constraint pk_sp_car_car_wheels primary key (car,wheel) +); + +create table car_accessory ( + id integer not null, + name nvarchar(255), + fuse_id numeric(19) not null, + car_id integer, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_car_accessory primary key (id) +); +create sequence car_accessory_seq as bigint start with 1 increment by 50; + +create table car_fuse ( + id numeric(19) not null, + location_code nvarchar(255), + constraint pk_car_fuse primary key (id) +); +create sequence car_fuse_seq as bigint start with 1 increment by 50; + +create table category ( + id numeric(19) not null, + name nvarchar(255), + surveyobjectid numeric(19), + sequence_number integer not null, + constraint pk_category primary key (id) +); +create sequence category_seq as bigint start with 1 increment by 50; + +create table child_person ( + identifier integer not null, + name nvarchar(255), + age integer, + some_bean_id integer, + parent_identifier integer, + family_name nvarchar(255), + address nvarchar(255), + constraint pk_child_person primary key (identifier) +); +create sequence child_person_seq as bigint start with 1 increment by 50; + +create table configuration ( + type nvarchar(21) not null, + id integer not null, + name nvarchar(255), + configurations_id integer, + group_name nvarchar(255), + product_name nvarchar(255), + constraint pk_configuration primary key (id) +); +create sequence configuration_seq as bigint start with 1 increment by 50; + +create table configurations ( + id integer not null, + name nvarchar(255), + constraint pk_configurations primary key (id) +); +create sequence configurations_seq as bigint start with 1 increment by 50; + +create table contact ( + id integer not null, + first_name nvarchar(127), + last_name nvarchar(127), + phone nvarchar(255), + mobile nvarchar(255), + email nvarchar(255), + customer_id integer not null, + group_id integer, + cretime datetime2 not null, + updtime datetime2 not null, + constraint pk_contact primary key (id) +); +create sequence contact_seq as bigint start with 1 increment by 50; + +create table contact_group ( + id integer not null, + name nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_contact_group primary key (id) +); +create sequence contact_group_seq as bigint start with 1 increment by 50; + +create table contact_note ( + id integer not null, + contact_id integer, + title nvarchar(255), + note nvarchar(max), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_contact_note primary key (id) +); +create sequence contact_note_seq as bigint start with 1 increment by 50; + +create table c_conversation ( + id numeric(19) not null, + title nvarchar(255), + isopen integer default 0 not null, + group_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_c_conversation primary key (id) +); +create sequence c_conversation_seq as bigint start with 1 increment by 50; + +create table o_country ( + code nvarchar(2) not null, + name nvarchar(60), + constraint pk_o_country primary key (code) +); + +create table cover ( + id numeric(19) not null, + s3url nvarchar(255), + deleted integer default 0 not null, + constraint pk_cover primary key (id) +); +create sequence cover_seq as bigint start with 1 increment by 50; + +create table o_customer ( + id integer not null, + status nvarchar(1), + name nvarchar(40) not null, + smallnote nvarchar(100), + anniversary date, + billing_address_id 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 sequence o_customer_seq as bigint start with 1 increment by 50; + +create table dcredit ( + id numeric(19) not null, + credit nvarchar(255), + constraint pk_dcredit primary key (id) +); +create sequence dcredit_seq as bigint start with 1 increment by 50; + +create table dcredit_drol ( + dcredit_id numeric(19) not null, + drol_id numeric(19) not null, + constraint pk_dcredit_drol primary key (dcredit_id,drol_id) +); + +create table dexh_entity ( + oid numeric(19) not null, + exhange nvarchar(255), + an_enum_type nvarchar(255), + last_updated datetime2 not null, + constraint pk_dexh_entity primary key (oid) +); +create sequence dexh_entity_seq as bigint start with 1 increment by 50; + +create table dperson ( + id numeric(19) not null, + first_name nvarchar(255), + last_name nvarchar(255), + salary numeric(28), + constraint pk_dperson primary key (id) +); +create sequence dperson_seq as bigint start with 1 increment by 50; + +create table drol ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_drol primary key (id) +); +create sequence drol_seq as bigint start with 1 increment by 50; + +create table drot ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_drot primary key (id) +); +create sequence drot_seq as bigint start with 1 increment by 50; + +create table drot_drol ( + drot_id numeric(19) not null, + drol_id numeric(19) not null, + constraint pk_drot_drol primary key (drot_id,drol_id) +); + +create table rawinherit_data ( + id numeric(19) not null, + val integer, + constraint pk_rawinherit_data primary key (id) +); +create sequence rawinherit_data_seq as bigint start with 1 increment by 50; + +create table dfk_cascade ( + id numeric(19) not null, + name nvarchar(255), + one_id numeric(19), + constraint pk_dfk_cascade primary key (id) +); +create sequence dfk_cascade_seq as bigint start with 1 increment by 50; + +create table dfk_cascade_one ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_dfk_cascade_one primary key (id) +); +create sequence dfk_cascade_one_seq as bigint start with 1 increment by 50; + +create table dfk_none ( + id numeric(19) not null, + name nvarchar(255), + one_id numeric(19), + constraint pk_dfk_none primary key (id) +); +create sequence dfk_none_seq as bigint start with 1 increment by 50; + +create table dfk_none_via_join ( + id numeric(19) not null, + name nvarchar(255), + one_id numeric(19), + constraint pk_dfk_none_via_join primary key (id) +); +create sequence dfk_none_via_join_seq as bigint start with 1 increment by 50; + +create table dfk_one ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_dfk_one primary key (id) +); +create sequence dfk_one_seq as bigint start with 1 increment by 50; + +create table dfk_set_null ( + id numeric(19) not null, + name nvarchar(255), + one_id numeric(19), + constraint pk_dfk_set_null primary key (id) +); +create sequence dfk_set_null_seq as bigint start with 1 increment by 50; + +create table doc ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_doc primary key (id) +); +create sequence doc_seq as bigint start with 1 increment by 50; + +create table doc_link ( + doc_id numeric(19) not null, + link_id numeric(19) not null, + constraint pk_doc_link primary key (doc_id,link_id) +); + +create table doc_link_draft ( + doc_id numeric(19) not null, + link_id numeric(19) not null, + constraint pk_doc_link_draft primary key (doc_id,link_id) +); + +create table doc_draft ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_doc_draft primary key (id) +); +create sequence doc_draft_seq as bigint start with 1 ; + +create table document ( + id numeric(19) not null, + title nvarchar(127), + body nvarchar(255), + organisation_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_document primary key (id) +); +create unique nonclustered index uq_document_title on document(title) where title is not null; +create sequence document_seq as bigint start with 1 increment by 50; + +create table document_draft ( + id numeric(19) not null, + title nvarchar(127), + body nvarchar(255), + when_publish datetime2, + organisation_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_document_draft primary key (id) +); +create unique nonclustered index uq_document_draft_title on document_draft(title) where title is not null; +create sequence document_draft_seq as bigint start with 1 ; + +create table document_media ( + id numeric(19) not null, + document_id numeric(19), + name nvarchar(255), + description nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_document_media primary key (id) +); +create sequence document_media_seq as bigint start with 1 increment by 50; + +create table document_media_draft ( + id numeric(19) not null, + document_id numeric(19), + name nvarchar(255), + description nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_document_media_draft primary key (id) +); +create sequence document_media_draft_seq as bigint start with 1 ; + +create table earray_bean ( + id numeric(19) not null, + name nvarchar(255), + phone_numbers varchar(300), + uids varchar(1000), + other_ids varchar(1000), + doubs varchar(1000), + statuses varchar(1000), + status2 varchar(1000), + version numeric(19) not null, + constraint pk_earray_bean primary key (id) +); +create sequence earray_bean_seq as bigint start with 1 increment by 50; + +create table earray_set_bean ( + id numeric(19) not null, + name nvarchar(255), + phone_numbers varchar(300), + uids varchar(1000), + other_ids varchar(1000), + doubs varchar(1000), + version numeric(19) not null, + constraint pk_earray_set_bean primary key (id) +); +create sequence earray_set_bean_seq as bigint start with 1 increment by 50; + +create table e_basic ( + id integer not null, + status nvarchar(1), + name nvarchar(127), + description nvarchar(255), + some_date datetime2, + constraint ck_e_basic_status check ( status in ('N','A','I')), + constraint pk_e_basic primary key (id) +); +create sequence e_basic_seq as bigint start with 1 increment by 50; + +create table ebasic_change_log ( + id numeric(19) not null, + name nvarchar(20), + short_description nvarchar(50), + long_description nvarchar(100), + who_created nvarchar(255) not null, + who_modified nvarchar(255) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + version numeric(19) not null, + constraint pk_ebasic_change_log primary key (id) +); +create sequence ebasic_change_log_seq as bigint start with 1 increment by 50; + +create table ebasic_clob ( + id numeric(19) not null, + name nvarchar(255), + title nvarchar(255), + description nvarchar(max), + last_update datetime2 not null, + constraint pk_ebasic_clob primary key (id) +); +create sequence ebasic_clob_seq as bigint start with 1 increment by 50; + +create table ebasic_clob_fetch_eager ( + id numeric(19) not null, + name nvarchar(255), + title nvarchar(255), + description nvarchar(max), + last_update datetime2 not null, + constraint pk_ebasic_clob_fetch_eager primary key (id) +); +create sequence ebasic_clob_fetch_eager_seq as bigint start with 1 increment by 50; + +create table ebasic_clob_no_ver ( + id numeric(19) not null, + name nvarchar(255), + description nvarchar(max), + constraint pk_ebasic_clob_no_ver primary key (id) +); +create sequence ebasic_clob_no_ver_seq as bigint start with 1 increment by 50; + +create table e_basicenc ( + id integer not null, + name nvarchar(255), + description varbinary(80), + dob varbinary(20), + status varbinary(20), + last_update datetime2, + constraint pk_e_basicenc primary key (id) +); +create sequence e_basicenc_seq as bigint start with 1 increment by 50; + +create table e_basicenc_bin ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + data image, + some_time varbinary(255), + last_update datetime2 not null, + constraint pk_e_basicenc_bin primary key (id) +); +create sequence e_basicenc_bin_seq as bigint start with 1 increment by 50; + +create table e_basic_enum_id ( + status nvarchar(1) not null, + name nvarchar(255), + description nvarchar(255), + constraint ck_e_basic_enum_id_status check ( status in ('N','A','I')), + constraint pk_e_basic_enum_id primary key (status) +); + +create table e_basic_eni ( + id integer not null, + status integer, + name nvarchar(255), + description nvarchar(255), + some_date datetime2, + constraint ck_e_basic_eni_status check ( status in (1,2,3)), + constraint pk_e_basic_eni primary key (id) +); +create sequence e_basic_eni_seq as bigint start with 1 increment by 50; + +create table ebasic_hstore ( + id numeric(19) not null, + name nvarchar(255), + map nvarchar(800), + version numeric(19) not null, + constraint pk_ebasic_hstore primary key (id) +); +create sequence ebasic_hstore_seq as bigint start with 1 increment by 50; + +create table ebasic_json_list ( + id numeric(19) not null, + name nvarchar(255), + bean_set nvarchar(700), + bean_list nvarchar(max), + bean_map nvarchar(700), + plain_bean nvarchar(500), + flags nvarchar(50), + tags nvarchar(100), + version numeric(19) not null, + constraint pk_ebasic_json_list primary key (id) +); +create sequence ebasic_json_list_seq as bigint start with 1 increment by 50; + +create table ebasic_json_map ( + id numeric(19) not null, + name nvarchar(255), + content nvarchar(max), + version numeric(19) not null, + constraint pk_ebasic_json_map primary key (id) +); +create sequence ebasic_json_map_seq as bigint start with 1 increment by 50; + +create table ebasic_json_map_blob ( + id numeric(19) not null, + name nvarchar(255), + content image, + version numeric(19) not null, + constraint pk_ebasic_json_map_blob primary key (id) +); +create sequence ebasic_json_map_blob_seq as bigint start with 1 increment by 50; + +create table ebasic_json_map_clob ( + id numeric(19) not null, + name nvarchar(255), + content nvarchar(max), + version numeric(19) not null, + constraint pk_ebasic_json_map_clob primary key (id) +); +create sequence ebasic_json_map_clob_seq as bigint start with 1 increment by 50; + +create table ebasic_json_map_detail ( + id numeric(19) not null, + owner_id numeric(19), + name nvarchar(255), + content nvarchar(max), + version numeric(19) not null, + constraint pk_ebasic_json_map_detail primary key (id) +); +create sequence ebasic_json_map_detail_seq as bigint start with 1 increment by 50; + +create table ebasic_json_map_json_b ( + id numeric(19) not null, + name nvarchar(255), + content nvarchar(max), + version numeric(19) not null, + constraint pk_ebasic_json_map_json_b primary key (id) +); +create sequence ebasic_json_map_json_b_seq as bigint start with 1 increment by 50; + +create table ebasic_json_map_varchar ( + id numeric(19) not null, + name nvarchar(255), + content nvarchar(3000), + version numeric(19) not null, + constraint pk_ebasic_json_map_varchar primary key (id) +); +create sequence ebasic_json_map_varchar_seq as bigint start with 1 increment by 50; + +create table ebasic_json_node ( + id numeric(19) not null, + name nvarchar(255), + content nvarchar(max), + version numeric(19) not null, + constraint pk_ebasic_json_node primary key (id) +); +create sequence ebasic_json_node_seq as bigint start with 1 increment by 50; + +create table ebasic_json_node_blob ( + id numeric(19) not null, + name nvarchar(255), + content image, + version numeric(19) not null, + constraint pk_ebasic_json_node_blob primary key (id) +); +create sequence ebasic_json_node_blob_seq as bigint start with 1 increment by 50; + +create table ebasic_json_node_json_b ( + id numeric(19) not null, + name nvarchar(255), + content nvarchar(max), + version numeric(19) not null, + constraint pk_ebasic_json_node_json_b primary key (id) +); +create sequence ebasic_json_node_json_b_seq as bigint start with 1 increment by 50; + +create table ebasic_json_node_varchar ( + id numeric(19) not null, + name nvarchar(255), + content nvarchar(1000), + version numeric(19) not null, + constraint pk_ebasic_json_node_varchar primary key (id) +); +create sequence ebasic_json_node_varchar_seq as bigint start with 1 increment by 50; + +create table ebasic_json_unmapped ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_ebasic_json_unmapped primary key (id) +); +create sequence ebasic_json_unmapped_seq as bigint start with 1 increment by 50; + +create table e_basic_ndc ( + id integer not null, + name nvarchar(255), + constraint pk_e_basic_ndc primary key (id) +); +create sequence e_basic_ndc_seq as bigint start with 1 increment by 50; + +create table ebasic_no_sdchild ( + id numeric(19) not null, + owner_id numeric(19) not null, + child_name nvarchar(255), + amount numeric(19) not null, + version numeric(19) not null, + constraint pk_ebasic_no_sdchild primary key (id) +); +create sequence ebasic_no_sdchild_seq as bigint start with 1 increment by 50; + +create table ebasic_sdchild ( + id numeric(19) not null, + owner_id numeric(19) not null, + child_name nvarchar(255), + amount numeric(19) not null, + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_ebasic_sdchild primary key (id) +); +create sequence ebasic_sdchild_seq as bigint start with 1 increment by 50; + +create table ebasic_soft_delete ( + id numeric(19) not null, + name nvarchar(255), + description nvarchar(255), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_ebasic_soft_delete primary key (id) +); +create sequence ebasic_soft_delete_seq as bigint start with 1 increment by 50; + +create table e_basicver ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + other nvarchar(255), + last_update datetime2 not null, + constraint pk_e_basicver primary key (id) +); +create sequence e_basicver_seq as bigint start with 1 increment by 50; + +create table e_basic_withlife ( + id numeric(19) not null, + name nvarchar(255), + deleted integer default 0 not null, + version numeric(19) not null, + constraint pk_e_basic_withlife primary key (id) +); +create sequence e_basic_withlife_seq as bigint start with 1 increment by 50; + +create table e_basicverucon ( + id integer not null, + name nvarchar(127), + other nvarchar(127), + other_one nvarchar(127), + description nvarchar(255), + last_update datetime2 not null, + constraint pk_e_basicverucon primary key (id) +); +create unique nonclustered index uq_e_basicverucon_name on e_basicverucon(name) where name is not null; +create unique nonclustered index uq_e_basicverucon_other_other_one on e_basicverucon(other,other_one) where other is not null and other_one is not null; +create sequence e_basicverucon_seq as bigint start with 1 increment by 50; + +create table e_col_ab ( + id numeric(19) not null, + column_a nvarchar(255), + column_b nvarchar(255), + constraint pk_e_col_ab primary key (id) +); +create sequence e_col_ab_seq as bigint start with 1 increment by 50; + +create table ecustom_id ( + id nvarchar(127) not null, + name nvarchar(255), + constraint pk_ecustom_id primary key (id) +); + +create table eemb_inner ( + id integer not null, + nome_inner nvarchar(255), + outer_id integer, + update_count integer not null, + constraint pk_eemb_inner primary key (id) +); +create sequence eemb_inner_seq as bigint start with 1 increment by 50; + +create table eemb_outer ( + id integer not null, + nome_outer nvarchar(255), + date1 datetime2, + date2 datetime2, + update_count integer not null, + constraint pk_eemb_outer primary key (id) +); +create sequence eemb_outer_seq as bigint start with 1 increment by 50; + +create table egen_props ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + ts_created datetime2 not null, + ts_updated datetime2 not null, + ldt_created datetime2 not null, + ldt_updated datetime2 not null, + odt_created datetime2 not null, + odt_updated datetime2 not null, + zdt_created datetime2 not null, + zdt_updated datetime2 not null, + instant_created datetime2 not null, + instant_updated datetime2 not null, + long_created numeric(19) not null, + long_updated numeric(19) not null, + constraint pk_egen_props primary key (id) +); +create sequence egen_props_seq as bigint start with 1 increment by 50; + +create table einvoice ( + id numeric(19) not null, + invoice_date datetime2, + state integer, + person_id numeric(19), + ship_street nvarchar(255), + ship_suburb nvarchar(255), + ship_city nvarchar(255), + ship_status nvarchar(3), + bill_street nvarchar(255), + bill_suburb nvarchar(255), + bill_city nvarchar(255), + bill_status nvarchar(3), + version numeric(19) not null, + constraint ck_einvoice_state check ( state in (0,1,2)), + constraint ck_einvoice_ship_status check ( ship_status in ('ONE','TWO')), + constraint ck_einvoice_bill_status check ( bill_status in ('ONE','TWO')), + constraint pk_einvoice primary key (id) +); +create sequence einvoice_seq as bigint start with 1 increment by 50; + +create table e_main ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + version numeric(19) not null, + constraint pk_e_main primary key (id) +); +create sequence e_main_seq as bigint start with 1 increment by 50; + +create table enull_collection ( + id integer not null, + name nvarchar(255), + constraint pk_enull_collection primary key (id) +); +create sequence enull_collection_seq as bigint start with 1 increment by 50; + +create table enull_collection_detail ( + id integer not null, + enull_collection_id integer not null, + something nvarchar(255), + constraint pk_enull_collection_detail primary key (id) +); +create sequence enull_collection_detail_seq as bigint start with 1 increment by 50; + +create table eopt_one_a ( + id integer not null, + name_for_a nvarchar(255), + b_id integer, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_eopt_one_a primary key (id) +); +create sequence eopt_one_a_seq as bigint start with 1 increment by 50; + +create table eopt_one_b ( + id integer not null, + name_for_b nvarchar(255), + c_id integer not null, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_eopt_one_b primary key (id) +); +create sequence eopt_one_b_seq as bigint start with 1 increment by 50; + +create table eopt_one_c ( + id integer not null, + name_for_c nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_eopt_one_c primary key (id) +); +create sequence eopt_one_c_seq as bigint start with 1 increment by 50; + +create table eperson ( + id numeric(19) not null, + name nvarchar(255), + notes nvarchar(255), + street nvarchar(255), + suburb nvarchar(255), + addr_city nvarchar(255), + addr_status nvarchar(3), + version numeric(19) not null, + constraint ck_eperson_addr_status check ( addr_status in ('ONE','TWO')), + constraint pk_eperson primary key (id) +); +create sequence eperson_seq as bigint start with 1 increment by 50; + +create table e_person_online ( + id numeric(19) not null, + email nvarchar(127), + online_status integer default 0 not null, + when_updated datetime2 not null, + constraint pk_e_person_online primary key (id) +); +create unique nonclustered index uq_e_person_online_email on e_person_online(email) where email is not null; +create sequence e_person_online_seq as bigint start with 1 increment by 50; + +create table esimple ( + usertypeid integer identity(1,1) not null, + name nvarchar(255), + constraint pk_esimple primary key (usertypeid) +); + +create table esoft_del_book ( + id numeric(19) not null, + book_title nvarchar(255), + lend_by_id numeric(19), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esoft_del_book primary key (id) +); +create sequence esoft_del_book_seq as bigint start with 1 increment by 50; + +create table esoft_del_book_esoft_del_user ( + esoft_del_book_id numeric(19) not null, + esoft_del_user_id numeric(19) not null, + constraint pk_esoft_del_book_esoft_del_user primary key (esoft_del_book_id,esoft_del_user_id) +); + +create table esoft_del_down ( + id numeric(19) not null, + esoft_del_mid_id numeric(19) not null, + down nvarchar(255), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esoft_del_down primary key (id) +); +create sequence esoft_del_down_seq as bigint start with 1 increment by 50; + +create table esoft_del_mid ( + id numeric(19) not null, + top_id numeric(19), + mid nvarchar(255), + up_id numeric(19), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esoft_del_mid primary key (id) +); +create sequence esoft_del_mid_seq as bigint start with 1 increment by 50; + +create table esoft_del_one_a ( + id numeric(19) not null, + name nvarchar(255), + oneb_id numeric(19), + deleted integer default 0 not null, + version numeric(19) not null, + constraint pk_esoft_del_one_a primary key (id) +); +create unique nonclustered index uq_esoft_del_one_a_oneb_id on esoft_del_one_a(oneb_id) where oneb_id is not null; +create sequence esoft_del_one_a_seq as bigint start with 1 increment by 50; + +create table esoft_del_one_b ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_esoft_del_one_b primary key (id) +); +create sequence esoft_del_one_b_seq as bigint start with 1 increment by 50; + +create table esoft_del_role ( + id numeric(19) not null, + role_name nvarchar(255), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esoft_del_role primary key (id) +); +create sequence esoft_del_role_seq as bigint start with 1 increment by 50; + +create table esoft_del_role_esoft_del_user ( + esoft_del_role_id numeric(19) not null, + esoft_del_user_id numeric(19) not null, + constraint pk_esoft_del_role_esoft_del_user primary key (esoft_del_role_id,esoft_del_user_id) +); + +create table esoft_del_top ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esoft_del_top primary key (id) +); +create sequence esoft_del_top_seq as bigint start with 1 increment by 50; + +create table esoft_del_up ( + id numeric(19) not null, + up nvarchar(255), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esoft_del_up primary key (id) +); +create sequence esoft_del_up_seq as bigint start with 1 increment by 50; + +create table esoft_del_user ( + id numeric(19) not null, + user_name nvarchar(255), + version numeric(19) not null, + deleted integer default 0 not null, + constraint pk_esoft_del_user primary key (id) +); +create sequence esoft_del_user_seq as bigint start with 1 increment by 50; + +create table esoft_del_user_esoft_del_role ( + esoft_del_user_id numeric(19) not null, + esoft_del_role_id numeric(19) not null, + constraint pk_esoft_del_user_esoft_del_role primary key (esoft_del_user_id,esoft_del_role_id) +); + +create table esome_convert_type ( + id numeric(19) not null, + name nvarchar(255), + money numeric(28), + constraint pk_esome_convert_type primary key (id) +); +create sequence esome_convert_type_seq as bigint start with 1 increment by 50; + +create table esome_type ( + id integer not null, + currency nvarchar(3), + locale nvarchar(20), + time_zone nvarchar(20), + constraint pk_esome_type primary key (id) +); +create sequence esome_type_seq as bigint start with 1 increment by 50; + +create table etrans_many ( + id integer not null, + name nvarchar(255), + constraint pk_etrans_many primary key (id) +); +create sequence etrans_many_seq as bigint start with 1 increment by 50; + +create table rawinherit_uncle ( + id integer not null, + name nvarchar(255), + parent_id numeric(19) not null, + version numeric(19) not null, + constraint pk_rawinherit_uncle primary key (id) +); +create sequence rawinherit_uncle_seq as bigint start with 1 increment by 50; + +create table evanilla_collection ( + id integer not null, + name nvarchar(255), + constraint pk_evanilla_collection primary key (id) +); +create sequence evanilla_collection_seq as bigint start with 1 increment by 50; + +create table evanilla_collection_detail ( + id integer not null, + evanilla_collection_id integer not null, + something nvarchar(255), + constraint pk_evanilla_collection_detail primary key (id) +); +create sequence evanilla_collection_detail_seq as bigint start with 1 increment by 50; + +create table ewho_props ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + who_created nvarchar(255) not null, + who_modified nvarchar(255) not null, + constraint pk_ewho_props primary key (id) +); +create sequence ewho_props_seq as bigint start with 1 increment by 50; + +create table e_withinet ( + id numeric(19) not null, + name nvarchar(255), + inet_address nvarchar(50), + version numeric(19) not null, + constraint pk_e_withinet primary key (id) +); +create sequence e_withinet_seq as bigint start with 1 increment by 50; + +create table td_child ( + child_id integer not null, + child_name nvarchar(255), + parent_id integer not null, + constraint pk_td_child primary key (child_id) +); +create sequence td_child_seq as bigint start with 1 increment by 50; + +create table td_parent ( + parent_type nvarchar(31) not null, + parent_id integer not null, + parent_name nvarchar(255), + extended_name nvarchar(255), + constraint pk_td_parent primary key (parent_id) +); +create sequence td_parent_seq as bigint start with 1 increment by 50; + +create table empl ( + id numeric(19) not null, + name nvarchar(255), + age integer, + default_address_id numeric(19), + constraint pk_empl primary key (id) +); +create sequence empl_seq as bigint start with 1 increment by 50; + +create table feature_desc ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + constraint pk_feature_desc primary key (id) +); +create sequence feature_desc_seq as bigint start with 1 increment by 50; + +create table f_first ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_f_first primary key (id) +); +create sequence f_first_seq as bigint start with 1 increment by 50; + +create table foo ( + foo_id integer not null, + important_text nvarchar(255), + version integer not null, + constraint pk_foo primary key (foo_id) +); +create sequence foo_seq as bigint start with 1 increment by 50; + +create table gen_key_identity ( + id numeric(19) identity(1,1) not null, + description nvarchar(255), + constraint pk_gen_key_identity primary key (id) +); + +create table gen_key_sequence ( + id numeric(19) not null, + description nvarchar(255), + constraint pk_gen_key_sequence primary key (id) +); +create sequence SEQ as bigint start with 1 increment by 50; + +create table gen_key_table ( + id numeric(19) not null, + description nvarchar(255), + constraint pk_gen_key_table primary key (id) +); +create sequence gen_key_table_seq as bigint start with 1 increment by 50; + +create table grand_parent_person ( + identifier integer not null, + name nvarchar(255), + age integer, + some_bean_id integer, + family_name nvarchar(255), + address nvarchar(255), + constraint pk_grand_parent_person primary key (identifier) +); +create sequence grand_parent_person_seq as bigint start with 1 increment by 50; + +create table survey_group ( + id numeric(19) not null, + name nvarchar(255), + categoryobjectid numeric(19), + sequence_number integer not null, + constraint pk_survey_group primary key (id) +); +create sequence survey_group_seq as bigint start with 1 increment by 50; + +create table c_group ( + id numeric(19) not null, + inactive integer default 0 not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_c_group primary key (id) +); +create sequence c_group_seq as bigint start with 1 increment by 50; + +create table he_doc ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_he_doc primary key (id) +); +create sequence he_doc_seq as bigint start with 1 increment by 50; + +create table hx_link ( + id numeric(19) not null, + name nvarchar(255), + location nvarchar(255), + comments nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_hx_link primary key (id) +); +create sequence hx_link_seq as bigint start with 1 increment by 50; + +create table hx_link_doc ( + hx_link_id numeric(19) not null, + he_doc_id numeric(19) not null, + constraint pk_hx_link_doc primary key (hx_link_id,he_doc_id) +); + +create table hi_doc ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_hi_doc primary key (id) +); +create sequence hi_doc_seq as bigint start with 1 increment by 50; + +create table hi_link ( + id numeric(19) not null, + name nvarchar(255), + location nvarchar(255), + comments nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_hi_link primary key (id) +); +create sequence hi_link_seq as bigint start with 1 increment by 50; + +create table hi_link_doc ( + hi_link_id numeric(19) not null, + hi_doc_id numeric(19) not null, + constraint pk_hi_link_doc primary key (hi_link_id,hi_doc_id) +); + +create table imrelated ( + id numeric(19) not null, + name nvarchar(255), + owner_id numeric(19) not null, + constraint pk_imrelated primary key (id) +); +create sequence imrelated_seq as bigint start with 1 increment by 50; + +create table imroot ( + dtype nvarchar(31) not null, + id numeric(19) not null, + name nvarchar(255), + title nvarchar(255), + when_title datetime2, + constraint pk_imroot primary key (id) +); +create sequence imroot_seq as bigint start with 1 increment by 50; + +create table ixresource ( + dtype nvarchar(255), + id nvarchar(40) not null, + name nvarchar(255), + constraint pk_ixresource primary key (id) +); + +create table info_company ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_info_company primary key (id) +); +create sequence info_company_seq as bigint start with 1 increment by 50; + +create table info_contact ( + id numeric(19) not null, + name nvarchar(255), + company_id numeric(19) not null, + version numeric(19) not null, + constraint pk_info_contact primary key (id) +); +create sequence info_contact_seq as bigint start with 1 increment by 50; + +create table info_customer ( + id numeric(19) not null, + name nvarchar(255), + company_id numeric(19), + version numeric(19) not null, + constraint pk_info_customer primary key (id) +); +create unique nonclustered index uq_info_customer_company_id on info_customer(company_id) where company_id is not null; +create sequence info_customer_seq as bigint start with 1 increment by 50; + +create table inner_report ( + id numeric(19) not null, + name nvarchar(255), + forecast_id numeric(19), + constraint pk_inner_report primary key (id) +); +create unique nonclustered index uq_inner_report_forecast_id on inner_report(forecast_id) where forecast_id is not null; +create sequence inner_report_seq as bigint start with 1 increment by 50; + +create table drel_invoice ( + id numeric(19) not null, + booking numeric(19), + version integer not null, + constraint pk_drel_invoice primary key (id) +); +create sequence drel_invoice_seq as bigint start with 1 increment by 50; + +create table item ( + customer integer not null, + itemnumber nvarchar(127) not null, + description nvarchar(255), + units nvarchar(255), + type integer not null, + region integer not null, + date_modified datetime2, + date_created datetime2, + modified_by nvarchar(255), + created_by nvarchar(255), + version numeric(19) not null, + constraint pk_item primary key (customer,itemnumber) +); + +create table monkey ( + mid numeric(19) not null, + name nvarchar(255), + food_preference nvarchar(255), + version numeric(19) not null, + constraint pk_monkey primary key (mid) +); +create sequence monkey_seq as bigint start with 1 increment by 50; + +create table trainer ( + tid numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_trainer primary key (tid) +); +create sequence trainer_seq as bigint start with 1 increment by 50; + +create table trainer_monkey ( + trainer_tid numeric(19) not null, + monkey_mid numeric(19) not null, + constraint uq_trainer_monkey_mid unique (monkey_mid), + constraint pk_trainer_monkey primary key (trainer_tid,monkey_mid) +); + +create table troop ( + pid numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_troop primary key (pid) +); +create sequence troop_seq as bigint start with 1 increment by 50; + +create table troop_monkey ( + troop_pid numeric(19) not null, + monkey_mid numeric(19) not null, + constraint uq_troop_monkey_mid unique (monkey_mid), + constraint pk_troop_monkey primary key (troop_pid,monkey_mid) +); + +create table l2_cldf_reset_bean ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_l2_cldf_reset_bean primary key (id) +); +create sequence l2_cldf_reset_bean_seq as bigint start with 1 increment by 50; + +create table l2_cldf_reset_bean_child ( + id numeric(19) not null, + parent_id numeric(19), + constraint pk_l2_cldf_reset_bean_child primary key (id) +); +create sequence l2_cldf_reset_bean_child_seq as bigint start with 1 increment by 50; + +create table level1 ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_level1 primary key (id) +); +create sequence level1_seq as bigint start with 1 increment by 50; + +create table level1_level4 ( + level1_id numeric(19) not null, + level4_id numeric(19) not null, + constraint pk_level1_level4 primary key (level1_id,level4_id) +); + +create table level1_level2 ( + level1_id numeric(19) not null, + level2_id numeric(19) not null, + constraint pk_level1_level2 primary key (level1_id,level2_id) +); + +create table level2 ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_level2 primary key (id) +); +create sequence level2_seq as bigint start with 1 increment by 50; + +create table level2_level3 ( + level2_id numeric(19) not null, + level3_id numeric(19) not null, + constraint pk_level2_level3 primary key (level2_id,level3_id) +); + +create table level3 ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_level3 primary key (id) +); +create sequence level3_seq as bigint start with 1 increment by 50; + +create table level4 ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_level4 primary key (id) +); +create sequence level4_seq as bigint start with 1 increment by 50; + +create table link ( + id numeric(19) not null, + name nvarchar(255), + location nvarchar(255), + when_publish datetime2, + link_comment nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + deleted integer default 0 not null, + constraint pk_link primary key (id) +); +create sequence link_seq as bigint start with 1 increment by 50; + +create table link_draft ( + id numeric(19) not null, + name nvarchar(255), + location nvarchar(255), + when_publish datetime2, + link_comment nvarchar(255), + dirty integer default 0 not null, + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + deleted integer default 0 not null, + constraint pk_link_draft primary key (id) +); +create sequence link_draft_seq as bigint start with 1 ; + +create table la_attr_value ( + id integer not null, + name nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_la_attr_value primary key (id) +); +create sequence la_attr_value_seq as bigint start with 1 increment by 50; + +create table la_attr_value_attribute ( + la_attr_value_id integer not null, + attribute_id integer not null, + constraint pk_la_attr_value_attribute primary key (la_attr_value_id,attribute_id) +); + +create table mmedia ( + type nvarchar(31) not null, + id numeric(19) not null, + url nvarchar(255), + note nvarchar(255), + constraint pk_mmedia primary key (id) +); +create sequence mmedia_seq as bigint start with 1 increment by 50; + +create table non_updateprop ( + id integer not null, + non_enum nvarchar(5), + name nvarchar(255), + note nvarchar(255), + constraint ck_non_updateprop_non_enum check ( non_enum in ('BEGIN','END')), + constraint pk_non_updateprop primary key (id) +); +create sequence non_updateprop_seq as bigint start with 1 increment by 50; + +create table mprinter ( + id numeric(19) not null, + name nvarchar(255), + flags numeric(19) not null, + current_state_id numeric(19), + last_swap_cyan_id numeric(19), + last_swap_magenta_id numeric(19), + last_swap_yellow_id numeric(19), + last_swap_black_id numeric(19), + version numeric(19) not null, + constraint pk_mprinter primary key (id) +); +create unique nonclustered index uq_mprinter_last_swap_cyan_id on mprinter(last_swap_cyan_id) where last_swap_cyan_id is not null; +create unique nonclustered index uq_mprinter_last_swap_magenta_id on mprinter(last_swap_magenta_id) where last_swap_magenta_id is not null; +create unique nonclustered index uq_mprinter_last_swap_yellow_id on mprinter(last_swap_yellow_id) where last_swap_yellow_id is not null; +create unique nonclustered index uq_mprinter_last_swap_black_id on mprinter(last_swap_black_id) where last_swap_black_id is not null; +create sequence mprinter_seq as bigint start with 1 increment by 50; + +create table mprinter_state ( + id numeric(19) not null, + flags numeric(19) not null, + printer_id numeric(19), + version numeric(19) not null, + constraint pk_mprinter_state primary key (id) +); +create sequence mprinter_state_seq as bigint start with 1 increment by 50; + +create table mprofile ( + id numeric(19) not null, + picture_id numeric(19), + name nvarchar(255), + constraint pk_mprofile primary key (id) +); +create sequence mprofile_seq as bigint start with 1 increment by 50; + +create table mprotected_construct_bean ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_mprotected_construct_bean primary key (id) +); +create sequence mprotected_construct_bean_seq as bigint start with 1 increment by 50; + +create table mrole ( + roleid integer not null, + role_name nvarchar(255), + constraint pk_mrole primary key (roleid) +); +create sequence mrole_seq as bigint start with 1 increment by 50; + +create table mrole_muser ( + mrole_roleid integer not null, + muser_userid integer not null, + constraint pk_mrole_muser primary key (mrole_roleid,muser_userid) +); + +create table msome_other ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_msome_other primary key (id) +); +create sequence msome_other_seq as bigint start with 1 increment by 50; + +create table muser ( + userid integer not null, + user_name nvarchar(255), + user_type_id integer, + constraint pk_muser primary key (userid) +); +create sequence muser_seq as bigint start with 1 increment by 50; + +create table muser_type ( + id integer not null, + name nvarchar(255), + constraint pk_muser_type primary key (id) +); +create sequence muser_type_seq as bigint start with 1 increment by 50; + +create table mail_box ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_mail_box primary key (id) +); +create sequence mail_box_seq as bigint start with 1 increment by 50; + +create table mail_user ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_mail_user primary key (id) +); +create sequence mail_user_seq as bigint start with 1 increment by 50; + +create table mail_user_inbox ( + mail_user_id numeric(19) not null, + mail_box_id numeric(19) not null, + constraint pk_mail_user_inbox primary key (mail_user_id,mail_box_id) +); + +create table mail_user_outbox ( + mail_user_id numeric(19) not null, + mail_box_id numeric(19) not null, + constraint pk_mail_user_outbox primary key (mail_user_id,mail_box_id) +); + +create table map_super_actual ( + id numeric(19) not null, + name nvarchar(255), + when_created datetime2 not null, + when_updated datetime2 not null, + constraint pk_map_super_actual primary key (id) +); +create sequence map_super_actual_seq as bigint start with 1 increment by 50; + +create table c_message ( + id numeric(19) not null, + title nvarchar(255), + body nvarchar(255), + conversation_id numeric(19), + user_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_c_message primary key (id) +); +create sequence c_message_seq as bigint start with 1 increment by 50; + +create table mnoc_role ( + role_id integer not null, + role_name nvarchar(255), + version integer not null, + constraint pk_mnoc_role primary key (role_id) +); +create sequence mnoc_role_seq as bigint start with 1 increment by 50; + +create table mnoc_user ( + user_id integer not null, + user_name nvarchar(255), + version integer not null, + constraint pk_mnoc_user primary key (user_id) +); +create sequence mnoc_user_seq as bigint start with 1 increment by 50; + +create table mnoc_user_mnoc_role ( + mnoc_user_user_id integer not null, + mnoc_role_role_id integer not null, + constraint pk_mnoc_user_mnoc_role primary key (mnoc_user_user_id,mnoc_role_role_id) +); + +create table mny_a ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_mny_a primary key (id) +); +create sequence mny_a_seq as bigint start with 1 increment by 50; + +create table mny_b ( + id numeric(19) not null, + name nvarchar(255), + a_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_mny_b primary key (id) +); +create sequence mny_b_seq as bigint start with 1 increment by 50; + +create table mny_b_mny_c ( + mny_b_id numeric(19) not null, + mny_c_id numeric(19) not null, + constraint pk_mny_b_mny_c primary key (mny_b_id,mny_c_id) +); + +create table mny_c ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_mny_c primary key (id) +); +create sequence mny_c_seq as bigint start with 1 increment by 50; + +create table mny_topic ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_mny_topic primary key (id) +); +create sequence mny_topic_seq as bigint start with 1 increment by 50; + +create table subtopics ( + topic numeric(19) not null, + subtopic numeric(19) not null, + constraint pk_subtopics primary key (topic,subtopic) +); + +create table mp_role ( + id numeric(19) not null, + mp_user_id numeric(19) not null, + code nvarchar(255), + organization_id numeric(19), + constraint pk_mp_role primary key (id) +); +create sequence mp_role_seq as bigint start with 1 increment by 50; + +create table mp_user ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_mp_user primary key (id) +); +create sequence mp_user_seq as bigint start with 1 increment by 50; + +create table ms_many_a ( + aid numeric(19) not null, + name nvarchar(255), + ms_many_a_many_b integer default 0 not null, + ms_many_b integer default 0 not null, + deleted integer default 0 not null, + constraint pk_ms_many_a primary key (aid) +); +create sequence ms_many_a_seq as bigint start with 1 increment by 50; + +create table ms_many_a_many_b ( + ms_many_a_aid numeric(19) not null, + ms_many_b_bid numeric(19) not null, + constraint pk_ms_many_a_many_b primary key (ms_many_a_aid,ms_many_b_bid) +); + +create table ms_many_b ( + bid numeric(19) not null, + name nvarchar(255), + deleted integer default 0 not null, + constraint pk_ms_many_b primary key (bid) +); +create sequence ms_many_b_seq as bigint start with 1 increment by 50; + +create table ms_many_b_many_a ( + ms_many_b_bid numeric(19) not null, + ms_many_a_aid numeric(19) not null, + constraint pk_ms_many_b_many_a primary key (ms_many_b_bid,ms_many_a_aid) +); + +create table my_lob_size ( + id integer not null, + name nvarchar(255), + my_count integer not null, + my_lob nvarchar(max), + constraint pk_my_lob_size primary key (id) +); +create sequence my_lob_size_seq as bigint start with 1 increment by 50; + +create table my_lob_size_join_many ( + id integer not null, + something nvarchar(255), + other nvarchar(255), + parent_id integer, + constraint pk_my_lob_size_join_many primary key (id) +); +create sequence my_lob_size_join_many_seq as bigint start with 1 increment by 50; + +create table noidbean ( + name nvarchar(255), + subject nvarchar(255), + when_created datetime2 not null +); + +create table o_cached_bean ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_o_cached_bean primary key (id) +); +create sequence o_cached_bean_seq as bigint start with 1 increment by 50; + +create table o_cached_bean_country ( + o_cached_bean_id numeric(19) not null, + o_country_code nvarchar(2) not null, + constraint pk_o_cached_bean_country primary key (o_cached_bean_id,o_country_code) +); + +create table o_cached_bean_child ( + id numeric(19) not null, + cached_bean_id numeric(19), + constraint pk_o_cached_bean_child primary key (id) +); +create sequence o_cached_bean_child_seq as bigint start with 1 increment by 50; + +create table o_cached_natkey ( + id numeric(19) not null, + store nvarchar(255), + sku nvarchar(255), + description nvarchar(255), + constraint pk_o_cached_natkey primary key (id) +); +create sequence o_cached_natkey_seq as bigint start with 1 increment by 50; + +create table o_cached_natkey3 ( + id numeric(19) not null, + store nvarchar(255), + code integer not null, + sku nvarchar(255), + description nvarchar(255), + constraint pk_o_cached_natkey3 primary key (id) +); +create sequence o_cached_natkey3_seq as bigint start with 1 increment by 50; + +create table ocar ( + id integer not null, + vin nvarchar(255), + name nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_ocar primary key (id) +); +create sequence ocar_seq as bigint start with 1 increment by 50; + +create table ocompany ( + id integer not null, + corp_id nvarchar(50), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_ocompany primary key (id) +); +create unique nonclustered index uq_ocompany_corp_id on ocompany(corp_id) where corp_id is not null; +create sequence ocompany_seq as bigint start with 1 increment by 50; + +create table oengine ( + engine_id nvarchar(40) not null, + short_desc nvarchar(255), + car_id integer, + version integer not null, + constraint pk_oengine primary key (engine_id) +); +create unique nonclustered index uq_oengine_car_id on oengine(car_id) where car_id is not null; + +create table ogear_box ( + id nvarchar(40) not null, + box_desc nvarchar(255), + box_size integer, + car_id integer, + version integer not null, + constraint pk_ogear_box primary key (id) +); +create unique nonclustered index uq_ogear_box_car_id on ogear_box(car_id) where car_id is not null; + +create table oroad_show_msg ( + id integer not null, + company_id integer not null, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint uq_oroad_show_msg_company_id unique (company_id), + constraint pk_oroad_show_msg primary key (id) +); +create sequence oroad_show_msg_seq as bigint start with 1 increment by 50; + +create table om_ordered_detail ( + id numeric(19) not null, + name nvarchar(255), + master_id numeric(19), + version numeric(19) not null, + sort_order integer, + constraint pk_om_ordered_detail primary key (id) +); +create sequence om_ordered_detail_seq as bigint start with 1 increment by 50; + +create table om_ordered_master ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_om_ordered_master primary key (id) +); +create sequence om_ordered_master_seq as bigint start with 1 increment by 50; + +create table o_order ( + id integer not null, + status integer, + order_date date, + ship_date date, + kcustomer_id integer not null, + cretime datetime2 not null, + updtime datetime2 not null, + constraint ck_o_order_status check ( status in (0,1,2,3)), + constraint pk_o_order primary key (id) +); +create sequence o_order_seq as bigint start with 1 increment by 50; + +create table o_order_detail ( + id integer not null, + order_id integer not null, + order_qty integer, + ship_qty integer, + unit_price float(32), + product_id integer, + cretime datetime2, + updtime datetime2 not null, + constraint pk_o_order_detail primary key (id) +); +create sequence o_order_detail_seq as bigint start with 1 increment by 50; + +create table s_orders ( + uuid nvarchar(40) not null, + constraint pk_s_orders primary key (uuid) +); + +create table s_order_items ( + uuid nvarchar(40) not null, + product_variant_uuid nvarchar(255), + order_uuid nvarchar(40), + quantity integer not null, + amount numeric(28), + constraint pk_s_order_items primary key (uuid) +); + +create table or_order_ship ( + id integer not null, + order_id integer, + ship_time datetime2, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_or_order_ship primary key (id) +); +create sequence or_order_ship_seq as bigint start with 1 increment by 50; + +create table organisation ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_organisation primary key (id) +); +create sequence organisation_seq as bigint start with 1 increment by 50; + +create table oto_bchild ( + master_id numeric(19) not null, + child nvarchar(255), + constraint pk_oto_bchild primary key (master_id) +); +create sequence oto_bchild_seq as bigint start with 1 increment by 50; + +create table oto_bmaster ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_oto_bmaster primary key (id) +); +create sequence oto_bmaster_seq as bigint start with 1 increment by 50; + +create table oto_child ( + id integer not null, + name nvarchar(255), + master_id numeric(19), + constraint pk_oto_child primary key (id) +); +create unique nonclustered index uq_oto_child_master_id on oto_child(master_id) where master_id is not null; +create sequence oto_child_seq as bigint start with 1 increment by 50; + +create table oto_cust ( + cid numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_oto_cust primary key (cid) +); +create sequence oto_cust_seq as bigint start with 1 increment by 50; + +create table oto_cust_address ( + aid numeric(19) not null, + line1 nvarchar(255), + line2 nvarchar(255), + line3 nvarchar(255), + customer_cid numeric(19), + version numeric(19) not null, + constraint pk_oto_cust_address primary key (aid) +); +create unique nonclustered index uq_oto_cust_address_customer_cid on oto_cust_address(customer_cid) where customer_cid is not null; +create sequence oto_cust_address_seq as bigint start with 1 increment by 50; + +create table oto_master ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_oto_master primary key (id) +); +create sequence oto_master_seq as bigint start with 1 increment by 50; + +create table oto_prime ( + pid numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_oto_prime primary key (pid) +); +create sequence oto_prime_seq as bigint start with 1 increment by 50; + +create table oto_prime_extra ( + eid numeric(19) not null, + extra nvarchar(255), + version numeric(19) not null, + constraint pk_oto_prime_extra primary key (eid) +); + +create table oto_th_many ( + id numeric(19) not null, + oto_th_top_id numeric(19) not null, + many nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_oto_th_many primary key (id) +); +create sequence oto_th_many_seq as bigint start with 1 increment by 50; + +create table oto_th_one ( + id numeric(19) not null, + one integer default 0 not null, + many_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_oto_th_one primary key (id) +); +create unique nonclustered index uq_oto_th_one_many_id on oto_th_one(many_id) where many_id is not null; +create sequence oto_th_one_seq as bigint start with 1 increment by 50; + +create table oto_th_top ( + id numeric(19) not null, + topp nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_oto_th_top primary key (id) +); +create sequence oto_th_top_seq as bigint start with 1 increment by 50; + +create table oto_ubprime ( + pid nvarchar(40) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_oto_ubprime primary key (pid) +); + +create table oto_ubprime_extra ( + eid nvarchar(40) not null, + extra nvarchar(255), + version numeric(19) not null, + constraint pk_oto_ubprime_extra primary key (eid) +); + +create table oto_uprime ( + pid nvarchar(40) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_oto_uprime primary key (pid) +); + +create table oto_uprime_extra ( + eid nvarchar(40) not null, + extra nvarchar(255), + version numeric(19) not null, + constraint pk_oto_uprime_extra primary key (eid) +); + +create table pfile ( + id integer not null, + name nvarchar(255), + file_content_id integer, + file_content2_id integer, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_pfile primary key (id) +); +create unique nonclustered index uq_pfile_file_content_id on pfile(file_content_id) where file_content_id is not null; +create unique nonclustered index uq_pfile_file_content2_id on pfile(file_content2_id) where file_content2_id is not null; +create sequence pfile_seq as bigint start with 1 increment by 50; + +create table pfile_content ( + id integer not null, + content image, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_pfile_content primary key (id) +); +create sequence pfile_content_seq as bigint start with 1 increment by 50; + +create table paggview ( + pview_id nvarchar(40), + amount integer not null +); +create unique nonclustered index uq_paggview_pview_id on paggview(pview_id) where pview_id is not null; + +create table pallet_location ( + type nvarchar(31) not null, + id integer not null, + zone_sid integer not null, + attribute nvarchar(255), + constraint pk_pallet_location primary key (id) +); +create sequence pallet_location_seq as bigint start with 1 increment by 50; + +create table parcel ( + parcelid numeric(19) not null, + description nvarchar(255), + constraint pk_parcel primary key (parcelid) +); +create sequence parcel_seq as bigint start with 1 increment by 50; + +create table parcel_location ( + parcellocid numeric(19) not null, + location nvarchar(255), + parcelid numeric(19), + constraint pk_parcel_location primary key (parcellocid) +); +create unique nonclustered index uq_parcel_location_parcelid on parcel_location(parcelId) where parcelId is not null; +create sequence parcel_location_seq as bigint start with 1 increment by 50; + +create table rawinherit_parent ( + type nvarchar(31) not null, + id numeric(19) not null, + val integer, + more nvarchar(255), + constraint pk_rawinherit_parent primary key (id) +); +create sequence rawinherit_parent_seq as bigint start with 1 increment by 50; + +create table rawinherit_parent_rawinherit_data ( + rawinherit_parent_id numeric(19) not null, + rawinherit_data_id numeric(19) not null, + constraint pk_rawinherit_parent_rawinherit_data primary key (rawinherit_parent_id,rawinherit_data_id) +); + +create table parent_person ( + identifier integer not null, + name nvarchar(255), + age integer, + some_bean_id integer, + parent_identifier integer, + family_name nvarchar(255), + address nvarchar(255), + constraint pk_parent_person primary key (identifier) +); +create sequence parent_person_seq as bigint start with 1 increment by 50; + +create table c_participation ( + id numeric(19) not null, + rating integer, + type integer, + conversation_id numeric(19) not null, + user_id numeric(19) not null, + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint ck_c_participation_type check ( type in (0,1)), + constraint pk_c_participation primary key (id) +); +create sequence c_participation_seq as bigint start with 1 increment by 50; + +create table mt_permission ( + id nvarchar(40) not null, + name nvarchar(255), + constraint pk_mt_permission primary key (id) +); + +create table persistent_file ( + id integer not null, + name nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_persistent_file primary key (id) +); +create sequence persistent_file_seq as bigint start with 1 increment by 50; + +create table persistent_file_content ( + id integer not null, + persistent_file_id integer, + content image, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_persistent_file_content primary key (id) +); +create unique nonclustered index uq_persistent_file_content_persistent_file_id on persistent_file_content(persistent_file_id) where persistent_file_id is not null; +create sequence persistent_file_content_seq as bigint start with 1 increment by 50; + +create table persons ( + id numeric(19) not null, + surname nvarchar(64) not null, + name nvarchar(64) not null, + constraint pk_persons primary key (id) +); +create sequence PERSONS_seq as bigint start with 1000 increment by 40; + +create table person ( + oid numeric(19) not null, + default_address_oid numeric(19), + version integer not null, + constraint pk_person primary key (oid) +); +create sequence person_seq as bigint start with 1 increment by 50; + +create table phones ( + id numeric(19) not null, + phone_number nvarchar(7) not null, + person_id numeric(19) not null, + constraint uq_phones_phone_number unique (phone_number), + constraint pk_phones primary key (id) +); +create sequence PHONES_seq as bigint start with 1 increment by 50; + +create table primary_revision ( + id numeric(19) not null, + revision integer not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_primary_revision primary key (id,revision) +); + +create table o_product ( + id integer not null, + sku nvarchar(20), + name nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + constraint pk_o_product primary key (id) +); +create sequence o_product_seq as bigint start with 1 increment by 50; + +create table pp ( + id nvarchar(40) not null, + name nvarchar(255), + value nvarchar(100) not null, + constraint pk_pp primary key (id) +); + +create table pp_to_ww ( + pp_id nvarchar(40) not null, + ww_id nvarchar(40) not null, + constraint pk_pp_to_ww primary key (pp_id,ww_id) +); + +create table question ( + id numeric(19) not null, + name nvarchar(255), + groupobjectid numeric(19), + sequence_number integer not null, + constraint pk_question primary key (id) +); +create sequence question_seq as bigint start with 1 increment by 50; + +create table rcustomer ( + company nvarchar(127) not null, + name nvarchar(127) not null, + description nvarchar(255), + constraint pk_rcustomer primary key (company,name) +); + +create table r_orders ( + company nvarchar(127) not null, + order_number integer not null, + customername nvarchar(127), + item nvarchar(255), + constraint pk_r_orders primary key (company,order_number) +); + +create table region ( + customer integer not null, + type integer not null, + description nvarchar(255), + version numeric(19) not null, + constraint pk_region primary key (customer,type) +); + +create table resourcefile ( + id nvarchar(64) not null, + parentresourcefileid nvarchar(64), + name nvarchar(128) not null, + constraint pk_resourcefile primary key (id) +); + +create table em_role ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_em_role primary key (id) +); +create sequence em_role_seq as bigint start with 1 increment by 50; + +create table mt_role ( + id nvarchar(40) not null, + name nvarchar(50), + tenant_id nvarchar(40), + version numeric(19) not null, + constraint pk_mt_role primary key (id) +); + +create table mt_role_permission ( + mt_role_id nvarchar(40) not null, + mt_permission_id nvarchar(40) not null, + constraint pk_mt_role_permission primary key (mt_role_id,mt_permission_id) +); + +create table f_second ( + id numeric(19) not null, + mod_name nvarchar(255), + first numeric(19), + title nvarchar(255), + constraint pk_f_second primary key (id) +); +create unique nonclustered index uq_f_second_first on f_second(first) where first is not null; +create sequence f_second_seq as bigint start with 1 increment by 50; + +create table section ( + id integer not null, + article_id integer, + type integer, + content nvarchar(max), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint ck_section_type check ( type in (0,1)), + constraint pk_section primary key (id) +); +create sequence section_seq as bigint start with 1 increment by 50; + +create table self_parent ( + id numeric(19) not null, + name nvarchar(255), + parent_id numeric(19), + version numeric(19) not null, + constraint pk_self_parent primary key (id) +); +create sequence self_parent_seq as bigint start with 1 increment by 50; + +create table self_ref_customer ( + id numeric(19) not null, + name nvarchar(255), + referred_by_id numeric(19), + constraint pk_self_ref_customer primary key (id) +); +create sequence self_ref_customer_seq as bigint start with 1 increment by 50; + +create table self_ref_example ( + id numeric(19) not null, + name nvarchar(255) not null, + parent_id numeric(19), + constraint pk_self_ref_example primary key (id) +); +create sequence self_ref_example_seq as bigint start with 1 increment by 50; + +create table some_enum_bean ( + id numeric(19) not null, + some_enum integer, + name nvarchar(255), + constraint ck_some_enum_bean_some_enum check ( some_enum in (0,1)), + constraint pk_some_enum_bean primary key (id) +); +create sequence some_enum_bean_seq as bigint start with 1 increment by 50; + +create table some_file_bean ( + id numeric(19) not null, + name nvarchar(255), + content image, + version numeric(19) not null, + constraint pk_some_file_bean primary key (id) +); +create sequence some_file_bean_seq as bigint start with 1 increment by 50; + +create table some_new_types_bean ( + id numeric(19) not null, + dow integer, + mth integer, + yr integer, + yr_mth date, + local_date date, + local_date_time datetime2, + offset_date_time datetime2, + zoned_date_time datetime2, + instant datetime2, + zone_id nvarchar(60), + zone_offset nvarchar(60), + path nvarchar(255), + period nvarchar(20), + version numeric(19) not null, + constraint ck_some_new_types_bean_dow check ( dow in (1,2,3,4,5,6,7)), + constraint ck_some_new_types_bean_mth check ( mth in (1,2,3,4,5,6,7,8,9,10,11,12)), + constraint pk_some_new_types_bean primary key (id) +); +create sequence some_new_types_bean_seq as bigint start with 1 increment by 50; + +create table some_period_bean ( + id numeric(19) not null, + anniversary date, + version numeric(19) not null, + constraint pk_some_period_bean primary key (id) +); +create sequence some_period_bean_seq as bigint start with 1 increment by 50; + +create table stockforecast ( + type nvarchar(31) not null, + id numeric(19) not null, + inner_report_id numeric(19), + constraint pk_stockforecast primary key (id) +); +create sequence stockforecast_seq as bigint start with 1 increment by 50; + +create table sub_section ( + id integer not null, + section_id integer, + title nvarchar(255), + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + constraint pk_sub_section primary key (id) +); +create sequence sub_section_seq as bigint start with 1 increment by 50; + +create table sub_type ( + sub_type_id integer not null, + description nvarchar(255), + version numeric(19) not null, + constraint pk_sub_type primary key (sub_type_id) +); +create sequence sub_type_seq as bigint start with 1 increment by 50; + +create table survey ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_survey primary key (id) +); +create sequence survey_seq as bigint start with 1 increment by 50; + +create table tbytes_only ( + id integer not null, + content image, + constraint pk_tbytes_only primary key (id) +); +create sequence tbytes_only_seq as bigint start with 1 increment by 50; + +create table tcar ( + type nvarchar(31) not null, + plate_no nvarchar(32) not null, + truckload numeric(19), + constraint pk_tcar primary key (plate_no) +); + +create table tevent ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_tevent primary key (id) +); +create sequence tevent_seq as bigint start with 1 increment by 50; + +create table tevent_many ( + id numeric(19) not null, + description nvarchar(255), + event_id numeric(19), + units integer not null, + amount float(32) not null, + version numeric(19) not null, + constraint pk_tevent_many primary key (id) +); +create sequence tevent_many_seq as bigint start with 1 increment by 50; + +create table tevent_one ( + id numeric(19) not null, + name nvarchar(255), + status integer, + event_id numeric(19), + version numeric(19) not null, + constraint ck_tevent_one_status check ( status in (0,1)), + constraint pk_tevent_one primary key (id) +); +create unique nonclustered index uq_tevent_one_event_id on tevent_one(event_id) where event_id is not null; +create sequence tevent_one_seq as bigint start with 1 increment by 50; + +create table tint_root ( + my_type integer not null, + id integer not null, + name nvarchar(255), + child_property nvarchar(255), + constraint pk_tint_root primary key (id) +); +create sequence tint_root_seq as bigint start with 1 increment by 50; + +create table tjoda_entity ( + id integer not null, + local_time time, + constraint pk_tjoda_entity primary key (id) +); +create sequence tjoda_entity_seq as bigint start with 1 increment by 50; + +create table t_mapsuper1 ( + id integer not null, + something nvarchar(255), + name nvarchar(255), + version integer not null, + constraint pk_t_mapsuper1 primary key (id) +); +create sequence t_mapsuper1_seq as bigint start with 1 increment by 50; + +create table t_oneb ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + active integer default 0 not null, + constraint pk_t_oneb primary key (id) +); +create sequence t_oneb_seq as bigint start with 1 increment by 50; + +create table t_detail_with_other_namexxxyy ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + some_unique_value nvarchar(127), + active integer default 0 not null, + master_id integer, + constraint pk_t_detail_with_other_namexxxyy primary key (id) +); +create unique nonclustered index uq_t_detail_with_other_namexxxyy_some_unique_value on t_detail_with_other_namexxxyy(some_unique_value) where some_unique_value is not null; +create sequence t_atable_detail_seq as bigint start with 1 increment by 50; + +create table ts_detail_two ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + active integer default 0 not null, + master_id integer, + constraint pk_ts_detail_two primary key (id) +); +create sequence ts_detail_two_seq as bigint start with 1 increment by 50; + +create table t_atable_thatisrelatively ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + active integer default 0 not null, + constraint pk_t_atable_thatisrelatively primary key (id) +); +create sequence t_atable_master_seq as bigint start with 1 increment by 50; + +create table ts_master_two ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + active integer default 0 not null, + constraint pk_ts_master_two primary key (id) +); +create sequence ts_master_two_seq as bigint start with 1 increment by 50; + +create table tuuid_entity ( + id nvarchar(40) not null, + name nvarchar(255), + constraint pk_tuuid_entity primary key (id) +); + +create table twheel ( + id numeric(19) not null, + owner_plate_no nvarchar(32) not null, + constraint pk_twheel primary key (id) +); +create sequence twheel_seq as bigint start with 1 increment by 50; + +create table twith_pre_insert ( + id integer not null, + name nvarchar(255) not null, + title nvarchar(255), + constraint pk_twith_pre_insert primary key (id) +); +create sequence twith_pre_insert_seq as bigint start with 1 increment by 50; + +create table mt_tenant ( + id nvarchar(40) not null, + name nvarchar(255), + version numeric(19) not null, + constraint pk_mt_tenant primary key (id) +); + +create table test_annotation_base_entity ( + direct nvarchar(255), + meta nvarchar(255), + mixed nvarchar(255), + constraint_annotation nvarchar(40), + null1 nvarchar(255) not null, + null2 nvarchar(255), + null3 nvarchar(255) +); + +create table tire ( + id numeric(19) not null, + wheel numeric(19), + version integer not null, + constraint pk_tire primary key (id) +); +create unique nonclustered index uq_tire_wheel on tire(wheel) where wheel is not null; +create sequence tire_seq as bigint start with 1 increment by 50; + +create table sa_tire ( + id numeric(19) not null, + version integer not null, + constraint pk_sa_tire primary key (id) +); +create sequence sa_tire_seq as bigint start with 1 increment by 50; + +create table trip ( + id integer not null, + vehicle_driver_id integer, + destination nvarchar(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 sequence trip_seq as bigint start with 1 increment by 50; + +create table truck_ref ( + id integer not null, + something nvarchar(255), + constraint pk_truck_ref primary key (id) +); +create sequence truck_ref_seq as bigint start with 1 increment by 50; + +create table type ( + customer integer not null, + type integer not null, + description nvarchar(255), + sub_type_id integer, + version numeric(19) not null, + constraint pk_type primary key (customer,type) +); + +create table tz_bean ( + id numeric(19) not null, + moda nvarchar(255), + ts datetime2, + tstz datetime2, + constraint pk_tz_bean primary key (id) +); +create sequence tz_bean_seq as bigint start with 1 increment by 50; + +create table ut_detail ( + id integer not null, + utmaster_id integer not null, + name nvarchar(255), + qty integer, + amount float(32), + version integer not null, + constraint pk_ut_detail primary key (id) +); +create sequence ut_detail_seq as bigint start with 1 increment by 50; + +create table ut_master ( + id integer not null, + name nvarchar(255), + description nvarchar(255), + version integer not null, + constraint pk_ut_master primary key (id) +); +create sequence ut_master_seq as bigint start with 1 increment by 50; + +create table uuone ( + id nvarchar(40) not null, + name nvarchar(255), + constraint pk_uuone primary key (id) +); + +create table uutwo ( + id nvarchar(40) not null, + name nvarchar(255), + master_id nvarchar(40), + constraint pk_uutwo primary key (id) +); + +create table c_user ( + id numeric(19) not null, + inactive integer default 0 not null, + name nvarchar(255), + email nvarchar(255), + password_hash nvarchar(255), + group_id numeric(19), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint pk_c_user primary key (id) +); +create sequence c_user_seq as bigint start with 1 increment by 50; + +create table tx_user ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_tx_user primary key (id) +); +create sequence tx_user_seq as bigint start with 1 increment by 50; + +create table g_user ( + id numeric(19) not null, + username nvarchar(255), + version numeric(19) not null, + constraint pk_g_user primary key (id) +); +create sequence g_user_seq as bigint start with 1 increment by 50; + +create table em_user ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_em_user primary key (id) +); +create sequence em_user_seq as bigint start with 1 increment by 50; + +create table oto_user ( + id numeric(19) not null, + name nvarchar(255), + account_id numeric(19) not null, + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + constraint uq_oto_user_account_id unique (account_id), + constraint pk_oto_user primary key (id) +); +create sequence oto_user_seq as bigint start with 1 increment by 50; + +create table em_user_role ( + user_id numeric(19) not null, + role_id numeric(19) not null, + constraint pk_em_user_role primary key (user_id,role_id) +); + +create table vehicle ( + dtype nvarchar(3) not null, + id integer not null, + license_number nvarchar(255), + registration_date datetime2, + cretime datetime2 not null, + updtime datetime2 not null, + version numeric(19) not null, + siz nvarchar(1), + driver nvarchar(255), + car_ref_id integer, + notes nvarchar(255), + truck_ref_id integer, + capacity float(32), + constraint ck_vehicle_siz check ( siz in ('S','M','L','H')), + constraint pk_vehicle primary key (id) +); +create sequence vehicle_seq as bigint start with 1 increment by 50; + +create table vehicle_driver ( + id integer not null, + name nvarchar(255), + vehicle_id integer, + address_id 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 sequence vehicle_driver_seq as bigint start with 1 increment by 50; + +create table warehouses ( + id integer not null, + officezoneid integer, + constraint pk_warehouses primary key (id) +); +create sequence warehouses_seq as bigint start with 1 increment by 50; + +create table warehousesshippingzones ( + warehouseid integer not null, + shippingzoneid integer not null, + constraint pk_warehousesshippingzones primary key (warehouseid,shippingzoneid) +); + +create table sa_wheel ( + id numeric(19) not null, + tire numeric(19), + car numeric(19), + version integer not null, + constraint pk_sa_wheel primary key (id) +); +create sequence sa_wheel_seq as bigint start with 1 increment by 50; + +create table wheel ( + id numeric(19) not null, + version integer not null, + constraint pk_wheel primary key (id) +); +create sequence wheel_seq as bigint start with 1 increment by 50; + +create table sp_car_wheel ( + id numeric(19) not null, + version integer not null, + constraint pk_sp_car_wheel primary key (id) +); +create sequence sp_car_wheel_seq as bigint start with 1 increment by 50; + +create table g_who_props_otm ( + id numeric(19) not null, + name nvarchar(255), + version numeric(19) not null, + when_created datetime2 not null, + when_modified datetime2 not null, + who_created_id numeric(19), + who_modified_id numeric(19), + constraint pk_g_who_props_otm primary key (id) +); +create sequence g_who_props_otm_seq as bigint start with 1 increment by 50; + +create table with_zero ( + id numeric(19) not null, + name nvarchar(255), + parent_id integer, + lang nvarchar(2) default 'en' not null, + version numeric(19) not null, + constraint pk_with_zero primary key (id) +); +create sequence with_zero_seq as bigint start with 1 increment by 50; + +create table parent ( + id integer not null, + name nvarchar(255), + constraint pk_parent primary key (id) +); +create sequence parent_seq as bigint start with 1 increment by 50; + +create table wview ( + id nvarchar(40) not null, + name nvarchar(127) not null, + constraint uq_wview_name unique (name), + constraint pk_wview primary key (id) +); + +create table zones ( + type nvarchar(31) not null, + id integer not null, + attribute nvarchar(255), + constraint pk_zones primary key (id) +); +create sequence zones_seq as bigint start with 1 increment by 50; + +create index ix_contact_last_name_first_name on contact (last_name,first_name); +create index ix_e_basic_name on e_basic (name); +create index ix_bar_foo_id on bar (foo_id); +alter table bar add constraint fk_bar_foo_id foreign key (foo_id) references foo (foo_id); + +create index ix_addr_employee_id on addr (employee_id); +alter table addr add constraint fk_addr_employee_id foreign key (employee_id) references empl (id); + +create index ix_o_address_country_code on o_address (country_code); +alter table o_address add constraint fk_o_address_country_code foreign key (country_code) references o_country (code); + +alter table album add constraint fk_album_cover_id foreign key (cover_id) references cover (id); + +create index ix_animal_shelter_id on animal (shelter_id); +alter table animal add constraint fk_animal_shelter_id foreign key (shelter_id) references animal_shelter (id); + +create index ix_attribute_attribute_holder_id on attribute (attribute_holder_id); +alter table attribute add constraint fk_attribute_attribute_holder_id foreign key (attribute_holder_id) references attribute_holder (id); + +create index ix_bbookmark_user_id on bbookmark (user_id); +alter table bbookmark add constraint fk_bbookmark_user_id foreign key (user_id) references bbookmark_user (id); + +create index ix_bsite_user_site_id on bsite_user (site_id); +alter table bsite_user add constraint fk_bsite_user_site_id foreign key (site_id) references bsite (id); + +create index ix_bsite_user_user_id on bsite_user (user_id); +alter table bsite_user add constraint fk_bsite_user_user_id foreign key (user_id) references buser (id); + +create index ix_bsite_user_b_site on bsite_user_b (site); +alter table bsite_user_b add constraint fk_bsite_user_b_site foreign key (site) references bsite (id); + +create index ix_bsite_user_b_usr on bsite_user_b (usr); +alter table bsite_user_b add constraint fk_bsite_user_b_usr foreign key (usr) references buser (id); + +create index ix_bsite_user_c_site_uid on bsite_user_c (site_uid); +alter table bsite_user_c add constraint fk_bsite_user_c_site_uid foreign key (site_uid) references bsite (id); + +create index ix_bsite_user_c_user_uid on bsite_user_c (user_uid); +alter table bsite_user_c add constraint fk_bsite_user_c_user_uid foreign key (user_uid) references buser (id); + +alter table drel_booking add constraint fk_drel_booking_agent_invoice foreign key (agent_invoice) references drel_invoice (id); + +alter table drel_booking add constraint fk_drel_booking_client_invoice foreign key (client_invoice) references drel_invoice (id); + +create index ix_ckey_detail_parent on ckey_detail (one_key,two_key); +alter table ckey_detail add constraint fk_ckey_detail_parent foreign key (one_key,two_key) references ckey_parent (one_key,two_key); + +create index ix_ckey_parent_assoc_id on ckey_parent (assoc_id); +alter table ckey_parent add constraint fk_ckey_parent_assoc_id foreign key (assoc_id) references ckey_assoc (id); + +create index ix_calculation_result_product_configuration_id on calculation_result (product_configuration_id); +alter table calculation_result add constraint fk_calculation_result_product_configuration_id foreign key (product_configuration_id) references configuration (id); + +create index ix_calculation_result_group_configuration_id on calculation_result (group_configuration_id); +alter table calculation_result add constraint fk_calculation_result_group_configuration_id foreign key (group_configuration_id) references configuration (id); + +create index ix_sp_car_car_wheels_sp_car_car on sp_car_car_wheels (car); +alter table sp_car_car_wheels add constraint fk_sp_car_car_wheels_sp_car_car foreign key (car) references sp_car_car (id); + +create index ix_sp_car_car_wheels_sp_car_wheel on sp_car_car_wheels (wheel); +alter table sp_car_car_wheels add constraint fk_sp_car_car_wheels_sp_car_wheel foreign key (wheel) references sp_car_wheel (id); + +create index ix_car_accessory_fuse_id on car_accessory (fuse_id); +alter table car_accessory add constraint fk_car_accessory_fuse_id foreign key (fuse_id) references car_fuse (id); + +create index ix_car_accessory_car_id on car_accessory (car_id); +alter table car_accessory add constraint fk_car_accessory_car_id foreign key (car_id) references vehicle (id); + +create index ix_category_surveyobjectid on category (surveyobjectid); +alter table category add constraint fk_category_surveyobjectid foreign key (surveyobjectid) references survey (id); + +create index ix_child_person_some_bean_id on child_person (some_bean_id); +alter table child_person add constraint fk_child_person_some_bean_id foreign key (some_bean_id) references e_basic (id); + +create index ix_child_person_parent_identifier on child_person (parent_identifier); +alter table child_person add constraint fk_child_person_parent_identifier foreign key (parent_identifier) references parent_person (identifier); + +create index ix_configuration_configurations_id on configuration (configurations_id); +alter table configuration add constraint fk_configuration_configurations_id foreign key (configurations_id) references configurations (id); + +create index ix_contact_customer_id on contact (customer_id); +alter table contact add constraint fk_contact_customer_id foreign key (customer_id) references o_customer (id); + +create index ix_contact_group_id on contact (group_id); +alter table contact add constraint fk_contact_group_id foreign key (group_id) references contact_group (id); + +create index ix_contact_note_contact_id on contact_note (contact_id); +alter table contact_note add constraint fk_contact_note_contact_id foreign key (contact_id) references contact (id); + +create index ix_c_conversation_group_id on c_conversation (group_id); +alter table c_conversation add constraint fk_c_conversation_group_id foreign key (group_id) references c_group (id); + +create index ix_o_customer_billing_address_id on o_customer (billing_address_id); +alter table o_customer add constraint fk_o_customer_billing_address_id foreign key (billing_address_id) references o_address (id); + +create index ix_o_customer_shipping_address_id on o_customer (shipping_address_id); +alter table o_customer add constraint fk_o_customer_shipping_address_id foreign key (shipping_address_id) references o_address (id); + +create index ix_dcredit_drol_dcredit on dcredit_drol (dcredit_id); +alter table dcredit_drol add constraint fk_dcredit_drol_dcredit foreign key (dcredit_id) references dcredit (id); + +create index ix_dcredit_drol_drol on dcredit_drol (drol_id); +alter table dcredit_drol add constraint fk_dcredit_drol_drol foreign key (drol_id) references drol (id); + +create index ix_drot_drol_drot on drot_drol (drot_id); +alter table drot_drol add constraint fk_drot_drol_drot foreign key (drot_id) references drot (id); + +create index ix_drot_drol_drol on drot_drol (drol_id); +alter table drot_drol add constraint fk_drot_drol_drol foreign key (drol_id) references drol (id); + +create index ix_dfk_cascade_one_id on dfk_cascade (one_id); +alter table dfk_cascade add constraint fk_dfk_cascade_one_id foreign key (one_id) references dfk_cascade_one (id) on delete cascade on update cascade; + +create index ix_dfk_set_null_one_id on dfk_set_null (one_id); +alter table dfk_set_null add constraint fk_dfk_set_null_one_id foreign key (one_id) references dfk_one (id) on delete set null on update set null; + +alter table doc add constraint fk_doc_id foreign key (id) references doc_draft (id); + +create index ix_doc_link_doc on doc_link (doc_id); +alter table doc_link add constraint fk_doc_link_doc foreign key (doc_id) references doc (id); + +create index ix_doc_link_link on doc_link (link_id); +alter table doc_link add constraint fk_doc_link_link foreign key (link_id) references link (id); + +alter table document add constraint fk_document_id foreign key (id) references document_draft (id); + +create index ix_document_organisation_id on document (organisation_id); +alter table document add constraint fk_document_organisation_id foreign key (organisation_id) references organisation (id); + +create index ix_document_draft_organisation_id on document_draft (organisation_id); +alter table document_draft add constraint fk_document_draft_organisation_id foreign key (organisation_id) references organisation (id); + +create index ix_document_media_document_id on document_media (document_id); +alter table document_media add constraint fk_document_media_document_id foreign key (document_id) references document (id); + +create index ix_document_media_draft_document_id on document_media_draft (document_id); +alter table document_media_draft add constraint fk_document_media_draft_document_id foreign key (document_id) references document_draft (id); + +create index ix_ebasic_json_map_detail_owner_id on ebasic_json_map_detail (owner_id); +alter table ebasic_json_map_detail add constraint fk_ebasic_json_map_detail_owner_id foreign key (owner_id) references ebasic_json_map (id); + +create index ix_ebasic_no_sdchild_owner_id on ebasic_no_sdchild (owner_id); +alter table ebasic_no_sdchild add constraint fk_ebasic_no_sdchild_owner_id foreign key (owner_id) references ebasic_soft_delete (id); + +create index ix_ebasic_sdchild_owner_id on ebasic_sdchild (owner_id); +alter table ebasic_sdchild add constraint fk_ebasic_sdchild_owner_id foreign key (owner_id) references ebasic_soft_delete (id); + +create index ix_eemb_inner_outer_id on eemb_inner (outer_id); +alter table eemb_inner add constraint fk_eemb_inner_outer_id foreign key (outer_id) references eemb_outer (id); + +create index ix_einvoice_person_id on einvoice (person_id); +alter table einvoice add constraint fk_einvoice_person_id foreign key (person_id) references eperson (id); + +create index ix_enull_collection_detail_enull_collection_id on enull_collection_detail (enull_collection_id); +alter table enull_collection_detail add constraint fk_enull_collection_detail_enull_collection_id foreign key (enull_collection_id) references enull_collection (id); + +create index ix_eopt_one_a_b_id on eopt_one_a (b_id); +alter table eopt_one_a add constraint fk_eopt_one_a_b_id foreign key (b_id) references eopt_one_b (id); + +create index ix_eopt_one_b_c_id on eopt_one_b (c_id); +alter table eopt_one_b add constraint fk_eopt_one_b_c_id foreign key (c_id) references eopt_one_c (id); + +create index ix_esoft_del_book_lend_by_id on esoft_del_book (lend_by_id); +alter table esoft_del_book add constraint fk_esoft_del_book_lend_by_id foreign key (lend_by_id) references esoft_del_user (id); + +create index ix_esoft_del_book_esoft_del_user_esoft_del_book on esoft_del_book_esoft_del_user (esoft_del_book_id); +alter table esoft_del_book_esoft_del_user add constraint fk_esoft_del_book_esoft_del_user_esoft_del_book foreign key (esoft_del_book_id) references esoft_del_book (id); + +create index ix_esoft_del_book_esoft_del_user_esoft_del_user on esoft_del_book_esoft_del_user (esoft_del_user_id); +alter table esoft_del_book_esoft_del_user add constraint fk_esoft_del_book_esoft_del_user_esoft_del_user foreign key (esoft_del_user_id) references esoft_del_user (id); + +create index ix_esoft_del_down_esoft_del_mid_id on esoft_del_down (esoft_del_mid_id); +alter table esoft_del_down add constraint fk_esoft_del_down_esoft_del_mid_id foreign key (esoft_del_mid_id) references esoft_del_mid (id); + +create index ix_esoft_del_mid_top_id on esoft_del_mid (top_id); +alter table esoft_del_mid add constraint fk_esoft_del_mid_top_id foreign key (top_id) references esoft_del_top (id); + +create index ix_esoft_del_mid_up_id on esoft_del_mid (up_id); +alter table esoft_del_mid add constraint fk_esoft_del_mid_up_id foreign key (up_id) references esoft_del_up (id); + +alter table esoft_del_one_a add constraint fk_esoft_del_one_a_oneb_id foreign key (oneb_id) references esoft_del_one_b (id); + +create index ix_esoft_del_role_esoft_del_user_esoft_del_role on esoft_del_role_esoft_del_user (esoft_del_role_id); +alter table esoft_del_role_esoft_del_user add constraint fk_esoft_del_role_esoft_del_user_esoft_del_role foreign key (esoft_del_role_id) references esoft_del_role (id); + +create index ix_esoft_del_role_esoft_del_user_esoft_del_user on esoft_del_role_esoft_del_user (esoft_del_user_id); +alter table esoft_del_role_esoft_del_user add constraint fk_esoft_del_role_esoft_del_user_esoft_del_user foreign key (esoft_del_user_id) references esoft_del_user (id); + +create index ix_esoft_del_user_esoft_del_role_esoft_del_user on esoft_del_user_esoft_del_role (esoft_del_user_id); +alter table esoft_del_user_esoft_del_role add constraint fk_esoft_del_user_esoft_del_role_esoft_del_user foreign key (esoft_del_user_id) references esoft_del_user (id); + +create index ix_esoft_del_user_esoft_del_role_esoft_del_role on esoft_del_user_esoft_del_role (esoft_del_role_id); +alter table esoft_del_user_esoft_del_role add constraint fk_esoft_del_user_esoft_del_role_esoft_del_role foreign key (esoft_del_role_id) references esoft_del_role (id); + +create index ix_rawinherit_uncle_parent_id on rawinherit_uncle (parent_id); +alter table rawinherit_uncle add constraint fk_rawinherit_uncle_parent_id foreign key (parent_id) references rawinherit_parent (id); + +create index ix_evanilla_collection_detail_evanilla_collection_id on evanilla_collection_detail (evanilla_collection_id); +alter table evanilla_collection_detail add constraint fk_evanilla_collection_detail_evanilla_collection_id foreign key (evanilla_collection_id) references evanilla_collection (id); + +create index ix_td_child_parent_id on td_child (parent_id); +alter table td_child add constraint fk_td_child_parent_id foreign key (parent_id) references td_parent (parent_id); + +create index ix_empl_default_address_id on empl (default_address_id); +alter table empl add constraint fk_empl_default_address_id foreign key (default_address_id) references addr (id); + +create index ix_grand_parent_person_some_bean_id on grand_parent_person (some_bean_id); +alter table grand_parent_person add constraint fk_grand_parent_person_some_bean_id foreign key (some_bean_id) references e_basic (id); + +create index ix_survey_group_categoryobjectid on survey_group (categoryobjectid); +alter table survey_group add constraint fk_survey_group_categoryobjectid foreign key (categoryobjectid) references category (id); + +create index ix_hx_link_doc_hx_link on hx_link_doc (hx_link_id); +alter table hx_link_doc add constraint fk_hx_link_doc_hx_link foreign key (hx_link_id) references hx_link (id); + +create index ix_hx_link_doc_he_doc on hx_link_doc (he_doc_id); +alter table hx_link_doc add constraint fk_hx_link_doc_he_doc foreign key (he_doc_id) references he_doc (id); + +create index ix_hi_link_doc_hi_link on hi_link_doc (hi_link_id); +alter table hi_link_doc add constraint fk_hi_link_doc_hi_link foreign key (hi_link_id) references hi_link (id); + +create index ix_hi_link_doc_hi_doc on hi_link_doc (hi_doc_id); +alter table hi_link_doc add constraint fk_hi_link_doc_hi_doc foreign key (hi_doc_id) references hi_doc (id); + +create index ix_imrelated_owner_id on imrelated (owner_id); +alter table imrelated add constraint fk_imrelated_owner_id foreign key (owner_id) references imroot (id); + +create index ix_info_contact_company_id on info_contact (company_id); +alter table info_contact add constraint fk_info_contact_company_id foreign key (company_id) references info_company (id); + +alter table info_customer add constraint fk_info_customer_company_id foreign key (company_id) references info_company (id); + +alter table inner_report add constraint fk_inner_report_forecast_id foreign key (forecast_id) references stockforecast (id); + +create index ix_drel_invoice_booking on drel_invoice (booking); +alter table drel_invoice add constraint fk_drel_invoice_booking foreign key (booking) references drel_booking (id); + +create index ix_item_etype on item (customer,type); +alter table item add constraint fk_item_etype foreign key (customer,type) references type (customer,type); + +create index ix_item_eregion on item (customer,region); +alter table item add constraint fk_item_eregion foreign key (customer,region) references region (customer,type); + +alter table trainer_monkey add constraint fk_trainer_monkey_trainer foreign key (trainer_tid) references trainer (tid); + +alter table trainer_monkey add constraint fk_trainer_monkey_monkey foreign key (monkey_mid) references monkey (mid); + +alter table troop_monkey add constraint fk_troop_monkey_troop foreign key (troop_pid) references troop (pid); + +alter table troop_monkey add constraint fk_troop_monkey_monkey foreign key (monkey_mid) references monkey (mid); + +create index ix_l2_cldf_reset_bean_child_parent_id on l2_cldf_reset_bean_child (parent_id); +alter table l2_cldf_reset_bean_child add constraint fk_l2_cldf_reset_bean_child_parent_id foreign key (parent_id) references l2_cldf_reset_bean (id); + +create index ix_level1_level4_level1 on level1_level4 (level1_id); +alter table level1_level4 add constraint fk_level1_level4_level1 foreign key (level1_id) references level1 (id); + +create index ix_level1_level4_level4 on level1_level4 (level4_id); +alter table level1_level4 add constraint fk_level1_level4_level4 foreign key (level4_id) references level4 (id); + +create index ix_level1_level2_level1 on level1_level2 (level1_id); +alter table level1_level2 add constraint fk_level1_level2_level1 foreign key (level1_id) references level1 (id); + +create index ix_level1_level2_level2 on level1_level2 (level2_id); +alter table level1_level2 add constraint fk_level1_level2_level2 foreign key (level2_id) references level2 (id); + +create index ix_level2_level3_level2 on level2_level3 (level2_id); +alter table level2_level3 add constraint fk_level2_level3_level2 foreign key (level2_id) references level2 (id); + +create index ix_level2_level3_level3 on level2_level3 (level3_id); +alter table level2_level3 add constraint fk_level2_level3_level3 foreign key (level3_id) references level3 (id); + +alter table link add constraint fk_link_id foreign key (id) references link_draft (id); + +create index ix_la_attr_value_attribute_la_attr_value on la_attr_value_attribute (la_attr_value_id); +alter table la_attr_value_attribute add constraint fk_la_attr_value_attribute_la_attr_value foreign key (la_attr_value_id) references la_attr_value (id); + +create index ix_la_attr_value_attribute_attribute on la_attr_value_attribute (attribute_id); +alter table la_attr_value_attribute add constraint fk_la_attr_value_attribute_attribute foreign key (attribute_id) references attribute (id); + +create index ix_mprinter_current_state_id on mprinter (current_state_id); +alter table mprinter add constraint fk_mprinter_current_state_id foreign key (current_state_id) references mprinter_state (id); + +alter table mprinter add constraint fk_mprinter_last_swap_cyan_id foreign key (last_swap_cyan_id) references mprinter_state (id); + +alter table mprinter add constraint fk_mprinter_last_swap_magenta_id foreign key (last_swap_magenta_id) references mprinter_state (id); + +alter table mprinter add constraint fk_mprinter_last_swap_yellow_id foreign key (last_swap_yellow_id) references mprinter_state (id); + +alter table mprinter add constraint fk_mprinter_last_swap_black_id foreign key (last_swap_black_id) references mprinter_state (id); + +create index ix_mprinter_state_printer_id on mprinter_state (printer_id); +alter table mprinter_state add constraint fk_mprinter_state_printer_id foreign key (printer_id) references mprinter (id); + +create index ix_mprofile_picture_id on mprofile (picture_id); +alter table mprofile add constraint fk_mprofile_picture_id foreign key (picture_id) references mmedia (id); + +create index ix_mrole_muser_mrole on mrole_muser (mrole_roleid); +alter table mrole_muser add constraint fk_mrole_muser_mrole foreign key (mrole_roleid) references mrole (roleid); + +create index ix_mrole_muser_muser on mrole_muser (muser_userid); +alter table mrole_muser add constraint fk_mrole_muser_muser foreign key (muser_userid) references muser (userid); + +create index ix_muser_user_type_id on muser (user_type_id); +alter table muser add constraint fk_muser_user_type_id foreign key (user_type_id) references muser_type (id); + +create index ix_mail_user_inbox_mail_user on mail_user_inbox (mail_user_id); +alter table mail_user_inbox add constraint fk_mail_user_inbox_mail_user foreign key (mail_user_id) references mail_user (id); + +create index ix_mail_user_inbox_mail_box on mail_user_inbox (mail_box_id); +alter table mail_user_inbox add constraint fk_mail_user_inbox_mail_box foreign key (mail_box_id) references mail_box (id); + +create index ix_mail_user_outbox_mail_user on mail_user_outbox (mail_user_id); +alter table mail_user_outbox add constraint fk_mail_user_outbox_mail_user foreign key (mail_user_id) references mail_user (id); + +create index ix_mail_user_outbox_mail_box on mail_user_outbox (mail_box_id); +alter table mail_user_outbox add constraint fk_mail_user_outbox_mail_box foreign key (mail_box_id) references mail_box (id); + +create index ix_c_message_conversation_id on c_message (conversation_id); +alter table c_message add constraint fk_c_message_conversation_id foreign key (conversation_id) references c_conversation (id); + +create index ix_c_message_user_id on c_message (user_id); +alter table c_message add constraint fk_c_message_user_id foreign key (user_id) references c_user (id); + +create index ix_mnoc_user_mnoc_role_mnoc_user on mnoc_user_mnoc_role (mnoc_user_user_id); +alter table mnoc_user_mnoc_role add constraint fk_mnoc_user_mnoc_role_mnoc_user foreign key (mnoc_user_user_id) references mnoc_user (user_id); + +create index ix_mnoc_user_mnoc_role_mnoc_role on mnoc_user_mnoc_role (mnoc_role_role_id); +alter table mnoc_user_mnoc_role add constraint fk_mnoc_user_mnoc_role_mnoc_role foreign key (mnoc_role_role_id) references mnoc_role (role_id); + +create index ix_mny_b_a_id on mny_b (a_id); +alter table mny_b add constraint fk_mny_b_a_id foreign key (a_id) references mny_a (id); + +create index ix_mny_b_mny_c_mny_b on mny_b_mny_c (mny_b_id); +alter table mny_b_mny_c add constraint fk_mny_b_mny_c_mny_b foreign key (mny_b_id) references mny_b (id); + +create index ix_mny_b_mny_c_mny_c on mny_b_mny_c (mny_c_id); +alter table mny_b_mny_c add constraint fk_mny_b_mny_c_mny_c foreign key (mny_c_id) references mny_c (id); + +create index ix_subtopics_mny_topic_1 on subtopics (topic); +alter table subtopics add constraint fk_subtopics_mny_topic_1 foreign key (topic) references mny_topic (id); + +create index ix_subtopics_mny_topic_2 on subtopics (subtopic); +alter table subtopics add constraint fk_subtopics_mny_topic_2 foreign key (subtopic) references mny_topic (id); + +create index ix_mp_role_mp_user_id on mp_role (mp_user_id); +alter table mp_role add constraint fk_mp_role_mp_user_id foreign key (mp_user_id) references mp_user (id); + +create index ix_ms_many_a_many_b_ms_many_a on ms_many_a_many_b (ms_many_a_aid); +alter table ms_many_a_many_b add constraint fk_ms_many_a_many_b_ms_many_a foreign key (ms_many_a_aid) references ms_many_a (aid); + +create index ix_ms_many_a_many_b_ms_many_b on ms_many_a_many_b (ms_many_b_bid); +alter table ms_many_a_many_b add constraint fk_ms_many_a_many_b_ms_many_b foreign key (ms_many_b_bid) references ms_many_b (bid); + +create index ix_ms_many_b_many_a_ms_many_b on ms_many_b_many_a (ms_many_b_bid); +alter table ms_many_b_many_a add constraint fk_ms_many_b_many_a_ms_many_b foreign key (ms_many_b_bid) references ms_many_b (bid); + +create index ix_ms_many_b_many_a_ms_many_a on ms_many_b_many_a (ms_many_a_aid); +alter table ms_many_b_many_a add constraint fk_ms_many_b_many_a_ms_many_a foreign key (ms_many_a_aid) references ms_many_a (aid); + +create index ix_my_lob_size_join_many_parent_id on my_lob_size_join_many (parent_id); +alter table my_lob_size_join_many add constraint fk_my_lob_size_join_many_parent_id foreign key (parent_id) references my_lob_size (id); + +create index ix_o_cached_bean_country_o_cached_bean on o_cached_bean_country (o_cached_bean_id); +alter table o_cached_bean_country add constraint fk_o_cached_bean_country_o_cached_bean foreign key (o_cached_bean_id) references o_cached_bean (id); + +create index ix_o_cached_bean_country_o_country on o_cached_bean_country (o_country_code); +alter table o_cached_bean_country add constraint fk_o_cached_bean_country_o_country foreign key (o_country_code) references o_country (code); + +create index ix_o_cached_bean_child_cached_bean_id on o_cached_bean_child (cached_bean_id); +alter table o_cached_bean_child add constraint fk_o_cached_bean_child_cached_bean_id foreign key (cached_bean_id) references o_cached_bean (id); + +alter table oengine add constraint fk_oengine_car_id foreign key (car_id) references ocar (id); + +alter table ogear_box add constraint fk_ogear_box_car_id foreign key (car_id) references ocar (id); + +alter table oroad_show_msg add constraint fk_oroad_show_msg_company_id foreign key (company_id) references ocompany (id); + +create index ix_om_ordered_detail_master_id on om_ordered_detail (master_id); +alter table om_ordered_detail add constraint fk_om_ordered_detail_master_id foreign key (master_id) references om_ordered_master (id); + +create index ix_o_order_kcustomer_id on o_order (kcustomer_id); +alter table o_order add constraint fk_o_order_kcustomer_id foreign key (kcustomer_id) references o_customer (id); + +create index ix_o_order_detail_order_id on o_order_detail (order_id); +alter table o_order_detail add constraint fk_o_order_detail_order_id foreign key (order_id) references o_order (id); + +create index ix_o_order_detail_product_id on o_order_detail (product_id); +alter table o_order_detail add constraint fk_o_order_detail_product_id foreign key (product_id) references o_product (id); + +create index ix_s_order_items_order_uuid on s_order_items (order_uuid); +alter table s_order_items add constraint fk_s_order_items_order_uuid foreign key (order_uuid) references s_orders (uuid); + +create index ix_or_order_ship_order_id on or_order_ship (order_id); +alter table or_order_ship add constraint fk_or_order_ship_order_id foreign key (order_id) references o_order (id); + +alter table oto_bchild add constraint fk_oto_bchild_master_id foreign key (master_id) references oto_bmaster (id); + +alter table oto_child add constraint fk_oto_child_master_id foreign key (master_id) references oto_master (id); + +alter table oto_cust_address add constraint fk_oto_cust_address_customer_cid foreign key (customer_cid) references oto_cust (cid); + +alter table oto_prime_extra add constraint fk_oto_prime_extra_eid foreign key (eid) references oto_prime (pid); + +create index ix_oto_th_many_oto_th_top_id on oto_th_many (oto_th_top_id); +alter table oto_th_many add constraint fk_oto_th_many_oto_th_top_id foreign key (oto_th_top_id) references oto_th_top (id); + +alter table oto_th_one add constraint fk_oto_th_one_many_id foreign key (many_id) references oto_th_many (id); + +alter table oto_ubprime_extra add constraint fk_oto_ubprime_extra_eid foreign key (eid) references oto_ubprime (pid); + +alter table oto_uprime_extra add constraint fk_oto_uprime_extra_eid foreign key (eid) references oto_uprime (pid); + +alter table pfile add constraint fk_pfile_file_content_id foreign key (file_content_id) references pfile_content (id); + +alter table pfile add constraint fk_pfile_file_content2_id foreign key (file_content2_id) references pfile_content (id); + +alter table paggview add constraint fk_paggview_pview_id foreign key (pview_id) references pp (id); + +create index ix_pallet_location_zone_sid on pallet_location (zone_sid); +alter table pallet_location add constraint fk_pallet_location_zone_sid foreign key (zone_sid) references zones (id); + +alter table parcel_location add constraint fk_parcel_location_parcelid foreign key (parcelid) references parcel (parcelid); + +create index ix_rawinherit_parent_rawinherit_data_rawinherit_parent on rawinherit_parent_rawinherit_data (rawinherit_parent_id); +alter table rawinherit_parent_rawinherit_data add constraint fk_rawinherit_parent_rawinherit_data_rawinherit_parent foreign key (rawinherit_parent_id) references rawinherit_parent (id); + +create index ix_rawinherit_parent_rawinherit_data_rawinherit_data on rawinherit_parent_rawinherit_data (rawinherit_data_id); +alter table rawinherit_parent_rawinherit_data add constraint fk_rawinherit_parent_rawinherit_data_rawinherit_data foreign key (rawinherit_data_id) references rawinherit_data (id); + +create index ix_parent_person_some_bean_id on parent_person (some_bean_id); +alter table parent_person add constraint fk_parent_person_some_bean_id foreign key (some_bean_id) references e_basic (id); + +create index ix_parent_person_parent_identifier on parent_person (parent_identifier); +alter table parent_person add constraint fk_parent_person_parent_identifier foreign key (parent_identifier) references grand_parent_person (identifier); + +create index ix_c_participation_conversation_id on c_participation (conversation_id); +alter table c_participation add constraint fk_c_participation_conversation_id foreign key (conversation_id) references c_conversation (id); + +create index ix_c_participation_user_id on c_participation (user_id); +alter table c_participation add constraint fk_c_participation_user_id foreign key (user_id) references c_user (id); + +alter table persistent_file_content add constraint fk_persistent_file_content_persistent_file_id foreign key (persistent_file_id) references persistent_file (id); + +create index ix_person_default_address_oid on person (default_address_oid); +alter table person add constraint fk_person_default_address_oid foreign key (default_address_oid) references address (oid); + +create index ix_phones_person_id on phones (person_id); +alter table phones add constraint fk_phones_person_id foreign key (person_id) references persons (id); + +create index ix_pp_to_ww_pp on pp_to_ww (pp_id); +alter table pp_to_ww add constraint fk_pp_to_ww_pp foreign key (pp_id) references pp (id); + +create index ix_pp_to_ww_wview on pp_to_ww (ww_id); +alter table pp_to_ww add constraint fk_pp_to_ww_wview foreign key (ww_id) references wview (id); + +create index ix_question_groupobjectid on question (groupobjectid); +alter table question add constraint fk_question_groupobjectid foreign key (groupobjectid) references survey_group (id); + +create index ix_r_orders_customer on r_orders (company,customername); +alter table r_orders add constraint fk_r_orders_customer foreign key (company,customername) references rcustomer (company,name); + +create index ix_resourcefile_parentresourcefileid on resourcefile (parentresourcefileid); +alter table resourcefile add constraint fk_resourcefile_parentresourcefileid foreign key (parentresourcefileid) references resourcefile (id); + +create index ix_mt_role_tenant_id on mt_role (tenant_id); +alter table mt_role add constraint fk_mt_role_tenant_id foreign key (tenant_id) references mt_tenant (id); + +create index ix_mt_role_permission_mt_role on mt_role_permission (mt_role_id); +alter table mt_role_permission add constraint fk_mt_role_permission_mt_role foreign key (mt_role_id) references mt_role (id); + +create index ix_mt_role_permission_mt_permission on mt_role_permission (mt_permission_id); +alter table mt_role_permission add constraint fk_mt_role_permission_mt_permission foreign key (mt_permission_id) references mt_permission (id); + +alter table f_second add constraint fk_f_second_first foreign key (first) references f_first (id); + +create index ix_section_article_id on section (article_id); +alter table section add constraint fk_section_article_id foreign key (article_id) references article (id); + +create index ix_self_parent_parent_id on self_parent (parent_id); +alter table self_parent add constraint fk_self_parent_parent_id foreign key (parent_id) references self_parent (id); + +create index ix_self_ref_customer_referred_by_id on self_ref_customer (referred_by_id); +alter table self_ref_customer add constraint fk_self_ref_customer_referred_by_id foreign key (referred_by_id) references self_ref_customer (id); + +create index ix_self_ref_example_parent_id on self_ref_example (parent_id); +alter table self_ref_example add constraint fk_self_ref_example_parent_id foreign key (parent_id) references self_ref_example (id); + +create index ix_stockforecast_inner_report_id on stockforecast (inner_report_id); +alter table stockforecast add constraint fk_stockforecast_inner_report_id foreign key (inner_report_id) references inner_report (id); + +create index ix_sub_section_section_id on sub_section (section_id); +alter table sub_section add constraint fk_sub_section_section_id foreign key (section_id) references section (id); + +create index ix_tevent_many_event_id on tevent_many (event_id); +alter table tevent_many add constraint fk_tevent_many_event_id foreign key (event_id) references tevent_one (id); + +alter table tevent_one add constraint fk_tevent_one_event_id foreign key (event_id) references tevent (id); + +create index ix_t_detail_with_other_namexxxyy_master_id on t_detail_with_other_namexxxyy (master_id); +alter table t_detail_with_other_namexxxyy add constraint fk_t_detail_with_other_namexxxyy_master_id foreign key (master_id) references t_atable_thatisrelatively (id); + +create index ix_ts_detail_two_master_id on ts_detail_two (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_twheel_owner_plate_no on twheel (owner_plate_no); +alter table twheel add constraint fk_twheel_owner_plate_no foreign key (owner_plate_no) references tcar (plate_no); + +alter table tire add constraint fk_tire_wheel foreign key (wheel) references wheel (id); + +create index ix_trip_vehicle_driver_id on trip (vehicle_driver_id); +alter table trip add constraint fk_trip_vehicle_driver_id foreign key (vehicle_driver_id) references vehicle_driver (id); + +create index ix_trip_address_id on trip (address_id); +alter table trip add constraint fk_trip_address_id foreign key (address_id) references o_address (id); + +create index ix_type_sub_type_id on type (sub_type_id); +alter table type add constraint fk_type_sub_type_id foreign key (sub_type_id) references sub_type (sub_type_id); + +create index ix_ut_detail_utmaster_id on ut_detail (utmaster_id); +alter table ut_detail add constraint fk_ut_detail_utmaster_id foreign key (utmaster_id) references ut_master (id); + +create index ix_uutwo_master_id on uutwo (master_id); +alter table uutwo add constraint fk_uutwo_master_id foreign key (master_id) references uuone (id); + +create index ix_c_user_group_id on c_user (group_id); +alter table c_user add constraint fk_c_user_group_id foreign key (group_id) references c_group (id); + +alter table oto_user add constraint fk_oto_user_account_id foreign key (account_id) references oto_account (id); + +create index ix_em_user_role_user_id on em_user_role (user_id); +alter table em_user_role add constraint fk_em_user_role_user_id foreign key (user_id) references em_user (id); + +create index ix_em_user_role_role_id on em_user_role (role_id); +alter table em_user_role add constraint fk_em_user_role_role_id foreign key (role_id) references em_role (id); + +create index ix_vehicle_car_ref_id on vehicle (car_ref_id); +alter table vehicle add constraint fk_vehicle_car_ref_id foreign key (car_ref_id) references truck_ref (id); + +create index ix_vehicle_truck_ref_id on vehicle (truck_ref_id); +alter table vehicle add constraint fk_vehicle_truck_ref_id foreign key (truck_ref_id) references truck_ref (id); + +create index ix_vehicle_driver_vehicle_id on vehicle_driver (vehicle_id); +alter table vehicle_driver add constraint fk_vehicle_driver_vehicle_id foreign key (vehicle_id) references vehicle (id); + +create index ix_vehicle_driver_address_id on vehicle_driver (address_id); +alter table vehicle_driver add constraint fk_vehicle_driver_address_id foreign key (address_id) references o_address (id); + +create index ix_warehouses_officezoneid on warehouses (officezoneid); +alter table warehouses add constraint fk_warehouses_officezoneid foreign key (officezoneid) references zones (id); + +create index ix_warehousesshippingzones_warehouses on warehousesshippingzones (warehouseid); +alter table warehousesshippingzones add constraint fk_warehousesshippingzones_warehouses foreign key (warehouseid) references warehouses (id); + +create index ix_warehousesshippingzones_zones on warehousesshippingzones (shippingzoneid); +alter table warehousesshippingzones add constraint fk_warehousesshippingzones_zones foreign key (shippingzoneid) references zones (id); + +create index ix_sa_wheel_tire on sa_wheel (tire); +alter table sa_wheel add constraint fk_sa_wheel_tire foreign key (tire) references sa_tire (id); + +create index ix_sa_wheel_car on sa_wheel (car); +alter table sa_wheel add constraint fk_sa_wheel_car foreign key (car) references sa_car (id); + +create index ix_g_who_props_otm_who_created_id on g_who_props_otm (who_created_id); +alter table g_who_props_otm add constraint fk_g_who_props_otm_who_created_id foreign key (who_created_id) references g_user (id); + +create index ix_g_who_props_otm_who_modified_id on g_who_props_otm (who_modified_id); +alter table g_who_props_otm add constraint fk_g_who_props_otm_who_modified_id foreign key (who_modified_id) references g_user (id); + +create index ix_with_zero_parent_id on with_zero (parent_id); +alter table with_zero add constraint fk_with_zero_parent_id foreign key (parent_id) references parent (id); + +alter table hx_link + add sys_periodFrom datetime2 GENERATED ALWAYS AS ROW START NOT NULL DEFAULT SYSUTCDATETIME(), + sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999', +period for system_time (sys_periodFrom, sys_periodTo); +alter table hx_link set (system_versioning = on (history_table=dbo.hx_link_history)); +alter table hi_link + add sys_periodFrom datetime2 GENERATED ALWAYS AS ROW START NOT NULL DEFAULT SYSUTCDATETIME(), + sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999', +period for system_time (sys_periodFrom, sys_periodTo); +alter table hi_link set (system_versioning = on (history_table=dbo.hi_link_history)); +alter table hi_link_doc + add sys_periodFrom datetime2 GENERATED ALWAYS AS ROW START NOT NULL DEFAULT SYSUTCDATETIME(), + sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999', +period for system_time (sys_periodFrom, sys_periodTo); +alter table hi_link_doc set (system_versioning = on (history_table=dbo.hi_link_doc_history)); +alter table link + add sys_periodFrom datetime2 GENERATED ALWAYS AS ROW START NOT NULL DEFAULT SYSUTCDATETIME(), + sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999', +period for system_time (sys_periodFrom, sys_periodTo); +alter table link set (system_versioning = on (history_table=dbo.link_history)); +alter table c_user + add sys_periodFrom datetime2 GENERATED ALWAYS AS ROW START NOT NULL DEFAULT SYSUTCDATETIME(), + sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999', +period for system_time (sys_periodFrom, sys_periodTo); +alter table c_user set (system_versioning = on (history_table=dbo.c_user_history)); diff --git a/src/test/ddl-review/sqlserver-drop-all.sql b/src/test/ddl-review/sqlserver-drop-all.sql new file mode 100644 index 000000000..1669d09c8 --- /dev/null +++ b/src/test/ddl-review/sqlserver-drop-all.sql @@ -0,0 +1,1549 @@ +-- Generated by ebean unknown at 2018-03-08T04:43:42.126Z +IF OBJECT_ID('fk_bar_foo_id', 'F') IS NOT NULL alter table bar drop constraint fk_bar_foo_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bar','U') AND name = 'ix_bar_foo_id') drop index ix_bar_foo_id ON bar; + +IF OBJECT_ID('fk_addr_employee_id', 'F') IS NOT NULL alter table addr drop constraint fk_addr_employee_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('addr','U') AND name = 'ix_addr_employee_id') drop index ix_addr_employee_id ON addr; + +IF OBJECT_ID('fk_o_address_country_code', 'F') IS NOT NULL alter table o_address drop constraint fk_o_address_country_code; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_address','U') AND name = 'ix_o_address_country_code') drop index ix_o_address_country_code ON o_address; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('album','U') AND name = 'uq_album_cover_id') drop index uq_album_cover_id ON album; +IF OBJECT_ID('fk_album_cover_id', 'F') IS NOT NULL alter table album drop constraint fk_album_cover_id; + +IF OBJECT_ID('fk_animal_shelter_id', 'F') IS NOT NULL alter table animal drop constraint fk_animal_shelter_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('animal','U') AND name = 'ix_animal_shelter_id') drop index ix_animal_shelter_id ON animal; + +IF OBJECT_ID('fk_attribute_attribute_holder_id', 'F') IS NOT NULL alter table attribute drop constraint fk_attribute_attribute_holder_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('attribute','U') AND name = 'ix_attribute_attribute_holder_id') drop index ix_attribute_attribute_holder_id ON attribute; + +IF OBJECT_ID('fk_bbookmark_user_id', 'F') IS NOT NULL alter table bbookmark drop constraint fk_bbookmark_user_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bbookmark','U') AND name = 'ix_bbookmark_user_id') drop index ix_bbookmark_user_id ON bbookmark; + +IF OBJECT_ID('fk_bsite_user_site_id', 'F') IS NOT NULL alter table bsite_user drop constraint fk_bsite_user_site_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user','U') AND name = 'ix_bsite_user_site_id') drop index ix_bsite_user_site_id ON bsite_user; + +IF OBJECT_ID('fk_bsite_user_user_id', 'F') IS NOT NULL alter table bsite_user drop constraint fk_bsite_user_user_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user','U') AND name = 'ix_bsite_user_user_id') drop index ix_bsite_user_user_id ON bsite_user; + +IF OBJECT_ID('fk_bsite_user_b_site', 'F') IS NOT NULL alter table bsite_user_b drop constraint fk_bsite_user_b_site; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_b','U') AND name = 'ix_bsite_user_b_site') drop index ix_bsite_user_b_site ON bsite_user_b; + +IF OBJECT_ID('fk_bsite_user_b_usr', 'F') IS NOT NULL alter table bsite_user_b drop constraint fk_bsite_user_b_usr; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_b','U') AND name = 'ix_bsite_user_b_usr') drop index ix_bsite_user_b_usr ON bsite_user_b; + +IF OBJECT_ID('fk_bsite_user_c_site_uid', 'F') IS NOT NULL alter table bsite_user_c drop constraint fk_bsite_user_c_site_uid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_c','U') AND name = 'ix_bsite_user_c_site_uid') drop index ix_bsite_user_c_site_uid ON bsite_user_c; + +IF OBJECT_ID('fk_bsite_user_c_user_uid', 'F') IS NOT NULL alter table bsite_user_c drop constraint fk_bsite_user_c_user_uid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_c','U') AND name = 'ix_bsite_user_c_user_uid') drop index ix_bsite_user_c_user_uid ON bsite_user_c; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bwith_qident','U') AND name = 'uq_bwith_qident_name') drop index uq_bwith_qident_name ON bwith_qident; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('drel_booking','U') AND name = 'uq_drel_booking_booking_uid') drop index uq_drel_booking_booking_uid ON drel_booking; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('drel_booking','U') AND name = 'uq_drel_booking_agent_invoice') drop index uq_drel_booking_agent_invoice ON drel_booking; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('drel_booking','U') AND name = 'uq_drel_booking_client_invoice') drop index uq_drel_booking_client_invoice ON drel_booking; +IF OBJECT_ID('fk_drel_booking_agent_invoice', 'F') IS NOT NULL alter table drel_booking drop constraint fk_drel_booking_agent_invoice; + +IF OBJECT_ID('fk_drel_booking_client_invoice', 'F') IS NOT NULL alter table drel_booking drop constraint fk_drel_booking_client_invoice; + +IF OBJECT_ID('fk_ckey_detail_parent', 'F') IS NOT NULL alter table ckey_detail drop constraint fk_ckey_detail_parent; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ckey_detail','U') AND name = 'ix_ckey_detail_parent') drop index ix_ckey_detail_parent ON ckey_detail; + +IF OBJECT_ID('fk_ckey_parent_assoc_id', 'F') IS NOT NULL alter table ckey_parent drop constraint fk_ckey_parent_assoc_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ckey_parent','U') AND name = 'ix_ckey_parent_assoc_id') drop index ix_ckey_parent_assoc_id ON ckey_parent; + +IF OBJECT_ID('fk_calculation_result_product_configuration_id', 'F') IS NOT NULL alter table calculation_result drop constraint fk_calculation_result_product_configuration_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('calculation_result','U') AND name = 'ix_calculation_result_product_configuration_id') drop index ix_calculation_result_product_configuration_id ON calculation_result; + +IF OBJECT_ID('fk_calculation_result_group_configuration_id', 'F') IS NOT NULL alter table calculation_result drop constraint fk_calculation_result_group_configuration_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('calculation_result','U') AND name = 'ix_calculation_result_group_configuration_id') drop index ix_calculation_result_group_configuration_id ON calculation_result; + +IF OBJECT_ID('fk_sp_car_car_wheels_sp_car_car', 'F') IS NOT NULL alter table sp_car_car_wheels drop constraint fk_sp_car_car_wheels_sp_car_car; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('sp_car_car_wheels','U') AND name = 'ix_sp_car_car_wheels_sp_car_car') drop index ix_sp_car_car_wheels_sp_car_car ON sp_car_car_wheels; + +IF OBJECT_ID('fk_sp_car_car_wheels_sp_car_wheel', 'F') IS NOT NULL alter table sp_car_car_wheels drop constraint fk_sp_car_car_wheels_sp_car_wheel; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('sp_car_car_wheels','U') AND name = 'ix_sp_car_car_wheels_sp_car_wheel') drop index ix_sp_car_car_wheels_sp_car_wheel ON sp_car_car_wheels; + +IF OBJECT_ID('fk_car_accessory_fuse_id', 'F') IS NOT NULL alter table car_accessory drop constraint fk_car_accessory_fuse_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('car_accessory','U') AND name = 'ix_car_accessory_fuse_id') drop index ix_car_accessory_fuse_id ON car_accessory; + +IF OBJECT_ID('fk_car_accessory_car_id', 'F') IS NOT NULL alter table car_accessory drop constraint fk_car_accessory_car_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('car_accessory','U') AND name = 'ix_car_accessory_car_id') drop index ix_car_accessory_car_id ON car_accessory; + +IF OBJECT_ID('fk_category_surveyobjectid', 'F') IS NOT NULL alter table category drop constraint fk_category_surveyobjectid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('category','U') AND name = 'ix_category_surveyobjectid') drop index ix_category_surveyobjectid ON category; + +IF OBJECT_ID('fk_child_person_some_bean_id', 'F') IS NOT NULL alter table child_person drop constraint fk_child_person_some_bean_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('child_person','U') AND name = 'ix_child_person_some_bean_id') drop index ix_child_person_some_bean_id ON child_person; + +IF OBJECT_ID('fk_child_person_parent_identifier', 'F') IS NOT NULL alter table child_person drop constraint fk_child_person_parent_identifier; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('child_person','U') AND name = 'ix_child_person_parent_identifier') drop index ix_child_person_parent_identifier ON child_person; + +IF OBJECT_ID('fk_configuration_configurations_id', 'F') IS NOT NULL alter table configuration drop constraint fk_configuration_configurations_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('configuration','U') AND name = 'ix_configuration_configurations_id') drop index ix_configuration_configurations_id ON configuration; + +IF OBJECT_ID('fk_contact_customer_id', 'F') IS NOT NULL alter table contact drop constraint fk_contact_customer_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('contact','U') AND name = 'ix_contact_customer_id') drop index ix_contact_customer_id ON contact; + +IF OBJECT_ID('fk_contact_group_id', 'F') IS NOT NULL alter table contact drop constraint fk_contact_group_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('contact','U') AND name = 'ix_contact_group_id') drop index ix_contact_group_id ON contact; + +IF OBJECT_ID('fk_contact_note_contact_id', 'F') IS NOT NULL alter table contact_note drop constraint fk_contact_note_contact_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('contact_note','U') AND name = 'ix_contact_note_contact_id') drop index ix_contact_note_contact_id ON contact_note; + +IF OBJECT_ID('fk_c_conversation_group_id', 'F') IS NOT NULL alter table c_conversation drop constraint fk_c_conversation_group_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('c_conversation','U') AND name = 'ix_c_conversation_group_id') drop index ix_c_conversation_group_id ON c_conversation; + +IF OBJECT_ID('fk_o_customer_billing_address_id', 'F') IS NOT NULL alter table o_customer drop constraint fk_o_customer_billing_address_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_customer','U') AND name = 'ix_o_customer_billing_address_id') drop index ix_o_customer_billing_address_id ON o_customer; + +IF OBJECT_ID('fk_o_customer_shipping_address_id', 'F') IS NOT NULL alter table o_customer drop constraint fk_o_customer_shipping_address_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_customer','U') AND name = 'ix_o_customer_shipping_address_id') drop index ix_o_customer_shipping_address_id ON o_customer; + +IF OBJECT_ID('fk_dcredit_drol_dcredit', 'F') IS NOT NULL alter table dcredit_drol drop constraint fk_dcredit_drol_dcredit; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('dcredit_drol','U') AND name = 'ix_dcredit_drol_dcredit') drop index ix_dcredit_drol_dcredit ON dcredit_drol; + +IF OBJECT_ID('fk_dcredit_drol_drol', 'F') IS NOT NULL alter table dcredit_drol drop constraint fk_dcredit_drol_drol; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('dcredit_drol','U') AND name = 'ix_dcredit_drol_drol') drop index ix_dcredit_drol_drol ON dcredit_drol; + +IF OBJECT_ID('fk_drot_drol_drot', 'F') IS NOT NULL alter table drot_drol drop constraint fk_drot_drol_drot; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('drot_drol','U') AND name = 'ix_drot_drol_drot') drop index ix_drot_drol_drot ON drot_drol; + +IF OBJECT_ID('fk_drot_drol_drol', 'F') IS NOT NULL alter table drot_drol drop constraint fk_drot_drol_drol; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('drot_drol','U') AND name = 'ix_drot_drol_drol') drop index ix_drot_drol_drol ON drot_drol; + +IF OBJECT_ID('fk_dfk_cascade_one_id', 'F') IS NOT NULL alter table dfk_cascade drop constraint fk_dfk_cascade_one_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('dfk_cascade','U') AND name = 'ix_dfk_cascade_one_id') drop index ix_dfk_cascade_one_id ON dfk_cascade; + +IF OBJECT_ID('fk_dfk_set_null_one_id', 'F') IS NOT NULL alter table dfk_set_null drop constraint fk_dfk_set_null_one_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('dfk_set_null','U') AND name = 'ix_dfk_set_null_one_id') drop index ix_dfk_set_null_one_id ON dfk_set_null; + +IF OBJECT_ID('fk_doc_id', 'F') IS NOT NULL alter table doc drop constraint fk_doc_id; + +IF OBJECT_ID('fk_doc_link_doc', 'F') IS NOT NULL alter table doc_link drop constraint fk_doc_link_doc; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('doc_link','U') AND name = 'ix_doc_link_doc') drop index ix_doc_link_doc ON doc_link; + +IF OBJECT_ID('fk_doc_link_link', 'F') IS NOT NULL alter table doc_link drop constraint fk_doc_link_link; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('doc_link','U') AND name = 'ix_doc_link_link') drop index ix_doc_link_link ON doc_link; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('document','U') AND name = 'uq_document_title') drop index uq_document_title ON document; +IF OBJECT_ID('fk_document_id', 'F') IS NOT NULL alter table document drop constraint fk_document_id; + +IF OBJECT_ID('fk_document_organisation_id', 'F') IS NOT NULL alter table document drop constraint fk_document_organisation_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('document','U') AND name = 'ix_document_organisation_id') drop index ix_document_organisation_id ON document; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('document_draft','U') AND name = 'uq_document_draft_title') drop index uq_document_draft_title ON document_draft; +IF OBJECT_ID('fk_document_draft_organisation_id', 'F') IS NOT NULL alter table document_draft drop constraint fk_document_draft_organisation_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('document_draft','U') AND name = 'ix_document_draft_organisation_id') drop index ix_document_draft_organisation_id ON document_draft; + +IF OBJECT_ID('fk_document_media_document_id', 'F') IS NOT NULL alter table document_media drop constraint fk_document_media_document_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('document_media','U') AND name = 'ix_document_media_document_id') drop index ix_document_media_document_id ON document_media; + +IF OBJECT_ID('fk_document_media_draft_document_id', 'F') IS NOT NULL alter table document_media_draft drop constraint fk_document_media_draft_document_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('document_media_draft','U') AND name = 'ix_document_media_draft_document_id') drop index ix_document_media_draft_document_id ON document_media_draft; + +IF OBJECT_ID('fk_ebasic_json_map_detail_owner_id', 'F') IS NOT NULL alter table ebasic_json_map_detail drop constraint fk_ebasic_json_map_detail_owner_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ebasic_json_map_detail','U') AND name = 'ix_ebasic_json_map_detail_owner_id') drop index ix_ebasic_json_map_detail_owner_id ON ebasic_json_map_detail; + +IF OBJECT_ID('fk_ebasic_no_sdchild_owner_id', 'F') IS NOT NULL alter table ebasic_no_sdchild drop constraint fk_ebasic_no_sdchild_owner_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ebasic_no_sdchild','U') AND name = 'ix_ebasic_no_sdchild_owner_id') drop index ix_ebasic_no_sdchild_owner_id ON ebasic_no_sdchild; + +IF OBJECT_ID('fk_ebasic_sdchild_owner_id', 'F') IS NOT NULL alter table ebasic_sdchild drop constraint fk_ebasic_sdchild_owner_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ebasic_sdchild','U') AND name = 'ix_ebasic_sdchild_owner_id') drop index ix_ebasic_sdchild_owner_id ON ebasic_sdchild; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('e_basicverucon','U') AND name = 'uq_e_basicverucon_name') drop index uq_e_basicverucon_name ON e_basicverucon; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('e_basicverucon','U') AND name = 'uq_e_basicverucon_other_other_one') drop index uq_e_basicverucon_other_other_one ON e_basicverucon; +IF OBJECT_ID('fk_eemb_inner_outer_id', 'F') IS NOT NULL alter table eemb_inner drop constraint fk_eemb_inner_outer_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('eemb_inner','U') AND name = 'ix_eemb_inner_outer_id') drop index ix_eemb_inner_outer_id ON eemb_inner; + +IF OBJECT_ID('fk_einvoice_person_id', 'F') IS NOT NULL alter table einvoice drop constraint fk_einvoice_person_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('einvoice','U') AND name = 'ix_einvoice_person_id') drop index ix_einvoice_person_id ON einvoice; + +IF OBJECT_ID('fk_enull_collection_detail_enull_collection_id', 'F') IS NOT NULL alter table enull_collection_detail drop constraint fk_enull_collection_detail_enull_collection_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('enull_collection_detail','U') AND name = 'ix_enull_collection_detail_enull_collection_id') drop index ix_enull_collection_detail_enull_collection_id ON enull_collection_detail; + +IF OBJECT_ID('fk_eopt_one_a_b_id', 'F') IS NOT NULL alter table eopt_one_a drop constraint fk_eopt_one_a_b_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('eopt_one_a','U') AND name = 'ix_eopt_one_a_b_id') drop index ix_eopt_one_a_b_id ON eopt_one_a; + +IF OBJECT_ID('fk_eopt_one_b_c_id', 'F') IS NOT NULL alter table eopt_one_b drop constraint fk_eopt_one_b_c_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('eopt_one_b','U') AND name = 'ix_eopt_one_b_c_id') drop index ix_eopt_one_b_c_id ON eopt_one_b; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('e_person_online','U') AND name = 'uq_e_person_online_email') drop index uq_e_person_online_email ON e_person_online; +IF OBJECT_ID('fk_esoft_del_book_lend_by_id', 'F') IS NOT NULL alter table esoft_del_book drop constraint fk_esoft_del_book_lend_by_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_book','U') AND name = 'ix_esoft_del_book_lend_by_id') drop index ix_esoft_del_book_lend_by_id ON esoft_del_book; + +IF OBJECT_ID('fk_esoft_del_book_esoft_del_user_esoft_del_book', 'F') IS NOT NULL alter table esoft_del_book_esoft_del_user drop constraint fk_esoft_del_book_esoft_del_user_esoft_del_book; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_book_esoft_del_user','U') AND name = 'ix_esoft_del_book_esoft_del_user_esoft_del_book') drop index ix_esoft_del_book_esoft_del_user_esoft_del_book ON esoft_del_book_esoft_del_user; + +IF OBJECT_ID('fk_esoft_del_book_esoft_del_user_esoft_del_user', 'F') IS NOT NULL alter table esoft_del_book_esoft_del_user drop constraint fk_esoft_del_book_esoft_del_user_esoft_del_user; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_book_esoft_del_user','U') AND name = 'ix_esoft_del_book_esoft_del_user_esoft_del_user') drop index ix_esoft_del_book_esoft_del_user_esoft_del_user ON esoft_del_book_esoft_del_user; + +IF OBJECT_ID('fk_esoft_del_down_esoft_del_mid_id', 'F') IS NOT NULL alter table esoft_del_down drop constraint fk_esoft_del_down_esoft_del_mid_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_down','U') AND name = 'ix_esoft_del_down_esoft_del_mid_id') drop index ix_esoft_del_down_esoft_del_mid_id ON esoft_del_down; + +IF OBJECT_ID('fk_esoft_del_mid_top_id', 'F') IS NOT NULL alter table esoft_del_mid drop constraint fk_esoft_del_mid_top_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_mid','U') AND name = 'ix_esoft_del_mid_top_id') drop index ix_esoft_del_mid_top_id ON esoft_del_mid; + +IF OBJECT_ID('fk_esoft_del_mid_up_id', 'F') IS NOT NULL alter table esoft_del_mid drop constraint fk_esoft_del_mid_up_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_mid','U') AND name = 'ix_esoft_del_mid_up_id') drop index ix_esoft_del_mid_up_id ON esoft_del_mid; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_one_a','U') AND name = 'uq_esoft_del_one_a_oneb_id') drop index uq_esoft_del_one_a_oneb_id ON esoft_del_one_a; +IF OBJECT_ID('fk_esoft_del_one_a_oneb_id', 'F') IS NOT NULL alter table esoft_del_one_a drop constraint fk_esoft_del_one_a_oneb_id; + +IF OBJECT_ID('fk_esoft_del_role_esoft_del_user_esoft_del_role', 'F') IS NOT NULL alter table esoft_del_role_esoft_del_user drop constraint fk_esoft_del_role_esoft_del_user_esoft_del_role; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_role_esoft_del_user','U') AND name = 'ix_esoft_del_role_esoft_del_user_esoft_del_role') drop index ix_esoft_del_role_esoft_del_user_esoft_del_role ON esoft_del_role_esoft_del_user; + +IF OBJECT_ID('fk_esoft_del_role_esoft_del_user_esoft_del_user', 'F') IS NOT NULL alter table esoft_del_role_esoft_del_user drop constraint fk_esoft_del_role_esoft_del_user_esoft_del_user; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_role_esoft_del_user','U') AND name = 'ix_esoft_del_role_esoft_del_user_esoft_del_user') drop index ix_esoft_del_role_esoft_del_user_esoft_del_user ON esoft_del_role_esoft_del_user; + +IF OBJECT_ID('fk_esoft_del_user_esoft_del_role_esoft_del_user', 'F') IS NOT NULL alter table esoft_del_user_esoft_del_role drop constraint fk_esoft_del_user_esoft_del_role_esoft_del_user; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_user_esoft_del_role','U') AND name = 'ix_esoft_del_user_esoft_del_role_esoft_del_user') drop index ix_esoft_del_user_esoft_del_role_esoft_del_user ON esoft_del_user_esoft_del_role; + +IF OBJECT_ID('fk_esoft_del_user_esoft_del_role_esoft_del_role', 'F') IS NOT NULL alter table esoft_del_user_esoft_del_role drop constraint fk_esoft_del_user_esoft_del_role_esoft_del_role; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_user_esoft_del_role','U') AND name = 'ix_esoft_del_user_esoft_del_role_esoft_del_role') drop index ix_esoft_del_user_esoft_del_role_esoft_del_role ON esoft_del_user_esoft_del_role; + +IF OBJECT_ID('fk_rawinherit_uncle_parent_id', 'F') IS NOT NULL alter table rawinherit_uncle drop constraint fk_rawinherit_uncle_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('rawinherit_uncle','U') AND name = 'ix_rawinherit_uncle_parent_id') drop index ix_rawinherit_uncle_parent_id ON rawinherit_uncle; + +IF OBJECT_ID('fk_evanilla_collection_detail_evanilla_collection_id', 'F') IS NOT NULL alter table evanilla_collection_detail drop constraint fk_evanilla_collection_detail_evanilla_collection_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('evanilla_collection_detail','U') AND name = 'ix_evanilla_collection_detail_evanilla_collection_id') drop index ix_evanilla_collection_detail_evanilla_collection_id ON evanilla_collection_detail; + +IF OBJECT_ID('fk_td_child_parent_id', 'F') IS NOT NULL alter table td_child drop constraint fk_td_child_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('td_child','U') AND name = 'ix_td_child_parent_id') drop index ix_td_child_parent_id ON td_child; + +IF OBJECT_ID('fk_empl_default_address_id', 'F') IS NOT NULL alter table empl drop constraint fk_empl_default_address_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('empl','U') AND name = 'ix_empl_default_address_id') drop index ix_empl_default_address_id ON empl; + +IF OBJECT_ID('fk_grand_parent_person_some_bean_id', 'F') IS NOT NULL alter table grand_parent_person drop constraint fk_grand_parent_person_some_bean_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('grand_parent_person','U') AND name = 'ix_grand_parent_person_some_bean_id') drop index ix_grand_parent_person_some_bean_id ON grand_parent_person; + +IF OBJECT_ID('fk_survey_group_categoryobjectid', 'F') IS NOT NULL alter table survey_group drop constraint fk_survey_group_categoryobjectid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('survey_group','U') AND name = 'ix_survey_group_categoryobjectid') drop index ix_survey_group_categoryobjectid ON survey_group; + +IF OBJECT_ID('fk_hx_link_doc_hx_link', 'F') IS NOT NULL alter table hx_link_doc drop constraint fk_hx_link_doc_hx_link; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('hx_link_doc','U') AND name = 'ix_hx_link_doc_hx_link') drop index ix_hx_link_doc_hx_link ON hx_link_doc; + +IF OBJECT_ID('fk_hx_link_doc_he_doc', 'F') IS NOT NULL alter table hx_link_doc drop constraint fk_hx_link_doc_he_doc; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('hx_link_doc','U') AND name = 'ix_hx_link_doc_he_doc') drop index ix_hx_link_doc_he_doc ON hx_link_doc; + +IF OBJECT_ID('fk_hi_link_doc_hi_link', 'F') IS NOT NULL alter table hi_link_doc drop constraint fk_hi_link_doc_hi_link; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('hi_link_doc','U') AND name = 'ix_hi_link_doc_hi_link') drop index ix_hi_link_doc_hi_link ON hi_link_doc; + +IF OBJECT_ID('fk_hi_link_doc_hi_doc', 'F') IS NOT NULL alter table hi_link_doc drop constraint fk_hi_link_doc_hi_doc; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('hi_link_doc','U') AND name = 'ix_hi_link_doc_hi_doc') drop index ix_hi_link_doc_hi_doc ON hi_link_doc; + +IF OBJECT_ID('fk_imrelated_owner_id', 'F') IS NOT NULL alter table imrelated drop constraint fk_imrelated_owner_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('imrelated','U') AND name = 'ix_imrelated_owner_id') drop index ix_imrelated_owner_id ON imrelated; + +IF OBJECT_ID('fk_info_contact_company_id', 'F') IS NOT NULL alter table info_contact drop constraint fk_info_contact_company_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('info_contact','U') AND name = 'ix_info_contact_company_id') drop index ix_info_contact_company_id ON info_contact; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('info_customer','U') AND name = 'uq_info_customer_company_id') drop index uq_info_customer_company_id ON info_customer; +IF OBJECT_ID('fk_info_customer_company_id', 'F') IS NOT NULL alter table info_customer drop constraint fk_info_customer_company_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('inner_report','U') AND name = 'uq_inner_report_forecast_id') drop index uq_inner_report_forecast_id ON inner_report; +IF OBJECT_ID('fk_inner_report_forecast_id', 'F') IS NOT NULL alter table inner_report drop constraint fk_inner_report_forecast_id; + +IF OBJECT_ID('fk_drel_invoice_booking', 'F') IS NOT NULL alter table drel_invoice drop constraint fk_drel_invoice_booking; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('drel_invoice','U') AND name = 'ix_drel_invoice_booking') drop index ix_drel_invoice_booking ON drel_invoice; + +IF OBJECT_ID('fk_item_etype', 'F') IS NOT NULL alter table item drop constraint fk_item_etype; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('item','U') AND name = 'ix_item_etype') drop index ix_item_etype ON item; + +IF OBJECT_ID('fk_item_eregion', 'F') IS NOT NULL alter table item drop constraint fk_item_eregion; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('item','U') AND name = 'ix_item_eregion') drop index ix_item_eregion ON item; + +IF OBJECT_ID('fk_trainer_monkey_trainer', 'F') IS NOT NULL alter table trainer_monkey drop constraint fk_trainer_monkey_trainer; + +IF OBJECT_ID('fk_trainer_monkey_monkey', 'F') IS NOT NULL alter table trainer_monkey drop constraint fk_trainer_monkey_monkey; + +IF OBJECT_ID('fk_troop_monkey_troop', 'F') IS NOT NULL alter table troop_monkey drop constraint fk_troop_monkey_troop; + +IF OBJECT_ID('fk_troop_monkey_monkey', 'F') IS NOT NULL alter table troop_monkey drop constraint fk_troop_monkey_monkey; + +IF OBJECT_ID('fk_l2_cldf_reset_bean_child_parent_id', 'F') IS NOT NULL alter table l2_cldf_reset_bean_child drop constraint fk_l2_cldf_reset_bean_child_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('l2_cldf_reset_bean_child','U') AND name = 'ix_l2_cldf_reset_bean_child_parent_id') drop index ix_l2_cldf_reset_bean_child_parent_id ON l2_cldf_reset_bean_child; + +IF OBJECT_ID('fk_level1_level4_level1', 'F') IS NOT NULL alter table level1_level4 drop constraint fk_level1_level4_level1; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('level1_level4','U') AND name = 'ix_level1_level4_level1') drop index ix_level1_level4_level1 ON level1_level4; + +IF OBJECT_ID('fk_level1_level4_level4', 'F') IS NOT NULL alter table level1_level4 drop constraint fk_level1_level4_level4; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('level1_level4','U') AND name = 'ix_level1_level4_level4') drop index ix_level1_level4_level4 ON level1_level4; + +IF OBJECT_ID('fk_level1_level2_level1', 'F') IS NOT NULL alter table level1_level2 drop constraint fk_level1_level2_level1; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('level1_level2','U') AND name = 'ix_level1_level2_level1') drop index ix_level1_level2_level1 ON level1_level2; + +IF OBJECT_ID('fk_level1_level2_level2', 'F') IS NOT NULL alter table level1_level2 drop constraint fk_level1_level2_level2; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('level1_level2','U') AND name = 'ix_level1_level2_level2') drop index ix_level1_level2_level2 ON level1_level2; + +IF OBJECT_ID('fk_level2_level3_level2', 'F') IS NOT NULL alter table level2_level3 drop constraint fk_level2_level3_level2; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('level2_level3','U') AND name = 'ix_level2_level3_level2') drop index ix_level2_level3_level2 ON level2_level3; + +IF OBJECT_ID('fk_level2_level3_level3', 'F') IS NOT NULL alter table level2_level3 drop constraint fk_level2_level3_level3; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('level2_level3','U') AND name = 'ix_level2_level3_level3') drop index ix_level2_level3_level3 ON level2_level3; + +IF OBJECT_ID('fk_link_id', 'F') IS NOT NULL alter table link drop constraint fk_link_id; + +IF OBJECT_ID('fk_la_attr_value_attribute_la_attr_value', 'F') IS NOT NULL alter table la_attr_value_attribute drop constraint fk_la_attr_value_attribute_la_attr_value; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('la_attr_value_attribute','U') AND name = 'ix_la_attr_value_attribute_la_attr_value') drop index ix_la_attr_value_attribute_la_attr_value ON la_attr_value_attribute; + +IF OBJECT_ID('fk_la_attr_value_attribute_attribute', 'F') IS NOT NULL alter table la_attr_value_attribute drop constraint fk_la_attr_value_attribute_attribute; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('la_attr_value_attribute','U') AND name = 'ix_la_attr_value_attribute_attribute') drop index ix_la_attr_value_attribute_attribute ON la_attr_value_attribute; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mprinter','U') AND name = 'uq_mprinter_last_swap_cyan_id') drop index uq_mprinter_last_swap_cyan_id ON mprinter; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mprinter','U') AND name = 'uq_mprinter_last_swap_magenta_id') drop index uq_mprinter_last_swap_magenta_id ON mprinter; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mprinter','U') AND name = 'uq_mprinter_last_swap_yellow_id') drop index uq_mprinter_last_swap_yellow_id ON mprinter; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mprinter','U') AND name = 'uq_mprinter_last_swap_black_id') drop index uq_mprinter_last_swap_black_id ON mprinter; +IF OBJECT_ID('fk_mprinter_current_state_id', 'F') IS NOT NULL alter table mprinter drop constraint fk_mprinter_current_state_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mprinter','U') AND name = 'ix_mprinter_current_state_id') drop index ix_mprinter_current_state_id ON mprinter; + +IF OBJECT_ID('fk_mprinter_last_swap_cyan_id', 'F') IS NOT NULL alter table mprinter drop constraint fk_mprinter_last_swap_cyan_id; + +IF OBJECT_ID('fk_mprinter_last_swap_magenta_id', 'F') IS NOT NULL alter table mprinter drop constraint fk_mprinter_last_swap_magenta_id; + +IF OBJECT_ID('fk_mprinter_last_swap_yellow_id', 'F') IS NOT NULL alter table mprinter drop constraint fk_mprinter_last_swap_yellow_id; + +IF OBJECT_ID('fk_mprinter_last_swap_black_id', 'F') IS NOT NULL alter table mprinter drop constraint fk_mprinter_last_swap_black_id; + +IF OBJECT_ID('fk_mprinter_state_printer_id', 'F') IS NOT NULL alter table mprinter_state drop constraint fk_mprinter_state_printer_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mprinter_state','U') AND name = 'ix_mprinter_state_printer_id') drop index ix_mprinter_state_printer_id ON mprinter_state; + +IF OBJECT_ID('fk_mprofile_picture_id', 'F') IS NOT NULL alter table mprofile drop constraint fk_mprofile_picture_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mprofile','U') AND name = 'ix_mprofile_picture_id') drop index ix_mprofile_picture_id ON mprofile; + +IF OBJECT_ID('fk_mrole_muser_mrole', 'F') IS NOT NULL alter table mrole_muser drop constraint fk_mrole_muser_mrole; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mrole_muser','U') AND name = 'ix_mrole_muser_mrole') drop index ix_mrole_muser_mrole ON mrole_muser; + +IF OBJECT_ID('fk_mrole_muser_muser', 'F') IS NOT NULL alter table mrole_muser drop constraint fk_mrole_muser_muser; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mrole_muser','U') AND name = 'ix_mrole_muser_muser') drop index ix_mrole_muser_muser ON mrole_muser; + +IF OBJECT_ID('fk_muser_user_type_id', 'F') IS NOT NULL alter table muser drop constraint fk_muser_user_type_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('muser','U') AND name = 'ix_muser_user_type_id') drop index ix_muser_user_type_id ON muser; + +IF OBJECT_ID('fk_mail_user_inbox_mail_user', 'F') IS NOT NULL alter table mail_user_inbox drop constraint fk_mail_user_inbox_mail_user; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mail_user_inbox','U') AND name = 'ix_mail_user_inbox_mail_user') drop index ix_mail_user_inbox_mail_user ON mail_user_inbox; + +IF OBJECT_ID('fk_mail_user_inbox_mail_box', 'F') IS NOT NULL alter table mail_user_inbox drop constraint fk_mail_user_inbox_mail_box; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mail_user_inbox','U') AND name = 'ix_mail_user_inbox_mail_box') drop index ix_mail_user_inbox_mail_box ON mail_user_inbox; + +IF OBJECT_ID('fk_mail_user_outbox_mail_user', 'F') IS NOT NULL alter table mail_user_outbox drop constraint fk_mail_user_outbox_mail_user; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mail_user_outbox','U') AND name = 'ix_mail_user_outbox_mail_user') drop index ix_mail_user_outbox_mail_user ON mail_user_outbox; + +IF OBJECT_ID('fk_mail_user_outbox_mail_box', 'F') IS NOT NULL alter table mail_user_outbox drop constraint fk_mail_user_outbox_mail_box; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mail_user_outbox','U') AND name = 'ix_mail_user_outbox_mail_box') drop index ix_mail_user_outbox_mail_box ON mail_user_outbox; + +IF OBJECT_ID('fk_c_message_conversation_id', 'F') IS NOT NULL alter table c_message drop constraint fk_c_message_conversation_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('c_message','U') AND name = 'ix_c_message_conversation_id') drop index ix_c_message_conversation_id ON c_message; + +IF OBJECT_ID('fk_c_message_user_id', 'F') IS NOT NULL alter table c_message drop constraint fk_c_message_user_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('c_message','U') AND name = 'ix_c_message_user_id') drop index ix_c_message_user_id ON c_message; + +IF OBJECT_ID('fk_mnoc_user_mnoc_role_mnoc_user', 'F') IS NOT NULL alter table mnoc_user_mnoc_role drop constraint fk_mnoc_user_mnoc_role_mnoc_user; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mnoc_user_mnoc_role','U') AND name = 'ix_mnoc_user_mnoc_role_mnoc_user') drop index ix_mnoc_user_mnoc_role_mnoc_user ON mnoc_user_mnoc_role; + +IF OBJECT_ID('fk_mnoc_user_mnoc_role_mnoc_role', 'F') IS NOT NULL alter table mnoc_user_mnoc_role drop constraint fk_mnoc_user_mnoc_role_mnoc_role; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mnoc_user_mnoc_role','U') AND name = 'ix_mnoc_user_mnoc_role_mnoc_role') drop index ix_mnoc_user_mnoc_role_mnoc_role ON mnoc_user_mnoc_role; + +IF OBJECT_ID('fk_mny_b_a_id', 'F') IS NOT NULL alter table mny_b drop constraint fk_mny_b_a_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mny_b','U') AND name = 'ix_mny_b_a_id') drop index ix_mny_b_a_id ON mny_b; + +IF OBJECT_ID('fk_mny_b_mny_c_mny_b', 'F') IS NOT NULL alter table mny_b_mny_c drop constraint fk_mny_b_mny_c_mny_b; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mny_b_mny_c','U') AND name = 'ix_mny_b_mny_c_mny_b') drop index ix_mny_b_mny_c_mny_b ON mny_b_mny_c; + +IF OBJECT_ID('fk_mny_b_mny_c_mny_c', 'F') IS NOT NULL alter table mny_b_mny_c drop constraint fk_mny_b_mny_c_mny_c; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mny_b_mny_c','U') AND name = 'ix_mny_b_mny_c_mny_c') drop index ix_mny_b_mny_c_mny_c ON mny_b_mny_c; + +IF OBJECT_ID('fk_subtopics_mny_topic_1', 'F') IS NOT NULL alter table subtopics drop constraint fk_subtopics_mny_topic_1; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('subtopics','U') AND name = 'ix_subtopics_mny_topic_1') drop index ix_subtopics_mny_topic_1 ON subtopics; + +IF OBJECT_ID('fk_subtopics_mny_topic_2', 'F') IS NOT NULL alter table subtopics drop constraint fk_subtopics_mny_topic_2; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('subtopics','U') AND name = 'ix_subtopics_mny_topic_2') drop index ix_subtopics_mny_topic_2 ON subtopics; + +IF OBJECT_ID('fk_mp_role_mp_user_id', 'F') IS NOT NULL alter table mp_role drop constraint fk_mp_role_mp_user_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mp_role','U') AND name = 'ix_mp_role_mp_user_id') drop index ix_mp_role_mp_user_id ON mp_role; + +IF OBJECT_ID('fk_ms_many_a_many_b_ms_many_a', 'F') IS NOT NULL alter table ms_many_a_many_b drop constraint fk_ms_many_a_many_b_ms_many_a; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ms_many_a_many_b','U') AND name = 'ix_ms_many_a_many_b_ms_many_a') drop index ix_ms_many_a_many_b_ms_many_a ON ms_many_a_many_b; + +IF OBJECT_ID('fk_ms_many_a_many_b_ms_many_b', 'F') IS NOT NULL alter table ms_many_a_many_b drop constraint fk_ms_many_a_many_b_ms_many_b; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ms_many_a_many_b','U') AND name = 'ix_ms_many_a_many_b_ms_many_b') drop index ix_ms_many_a_many_b_ms_many_b ON ms_many_a_many_b; + +IF OBJECT_ID('fk_ms_many_b_many_a_ms_many_b', 'F') IS NOT NULL alter table ms_many_b_many_a drop constraint fk_ms_many_b_many_a_ms_many_b; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ms_many_b_many_a','U') AND name = 'ix_ms_many_b_many_a_ms_many_b') drop index ix_ms_many_b_many_a_ms_many_b ON ms_many_b_many_a; + +IF OBJECT_ID('fk_ms_many_b_many_a_ms_many_a', 'F') IS NOT NULL alter table ms_many_b_many_a drop constraint fk_ms_many_b_many_a_ms_many_a; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ms_many_b_many_a','U') AND name = 'ix_ms_many_b_many_a_ms_many_a') drop index ix_ms_many_b_many_a_ms_many_a ON ms_many_b_many_a; + +IF OBJECT_ID('fk_my_lob_size_join_many_parent_id', 'F') IS NOT NULL alter table my_lob_size_join_many drop constraint fk_my_lob_size_join_many_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('my_lob_size_join_many','U') AND name = 'ix_my_lob_size_join_many_parent_id') drop index ix_my_lob_size_join_many_parent_id ON my_lob_size_join_many; + +IF OBJECT_ID('fk_o_cached_bean_country_o_cached_bean', 'F') IS NOT NULL alter table o_cached_bean_country drop constraint fk_o_cached_bean_country_o_cached_bean; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_cached_bean_country','U') AND name = 'ix_o_cached_bean_country_o_cached_bean') drop index ix_o_cached_bean_country_o_cached_bean ON o_cached_bean_country; + +IF OBJECT_ID('fk_o_cached_bean_country_o_country', 'F') IS NOT NULL alter table o_cached_bean_country drop constraint fk_o_cached_bean_country_o_country; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_cached_bean_country','U') AND name = 'ix_o_cached_bean_country_o_country') drop index ix_o_cached_bean_country_o_country ON o_cached_bean_country; + +IF OBJECT_ID('fk_o_cached_bean_child_cached_bean_id', 'F') IS NOT NULL alter table o_cached_bean_child drop constraint fk_o_cached_bean_child_cached_bean_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_cached_bean_child','U') AND name = 'ix_o_cached_bean_child_cached_bean_id') drop index ix_o_cached_bean_child_cached_bean_id ON o_cached_bean_child; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ocompany','U') AND name = 'uq_ocompany_corp_id') drop index uq_ocompany_corp_id ON ocompany; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oengine','U') AND name = 'uq_oengine_car_id') drop index uq_oengine_car_id ON oengine; +IF OBJECT_ID('fk_oengine_car_id', 'F') IS NOT NULL alter table oengine drop constraint fk_oengine_car_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ogear_box','U') AND name = 'uq_ogear_box_car_id') drop index uq_ogear_box_car_id ON ogear_box; +IF OBJECT_ID('fk_ogear_box_car_id', 'F') IS NOT NULL alter table ogear_box drop constraint fk_ogear_box_car_id; + +IF OBJECT_ID('fk_oroad_show_msg_company_id', 'F') IS NOT NULL alter table oroad_show_msg drop constraint fk_oroad_show_msg_company_id; + +IF OBJECT_ID('fk_om_ordered_detail_master_id', 'F') IS NOT NULL alter table om_ordered_detail drop constraint fk_om_ordered_detail_master_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('om_ordered_detail','U') AND name = 'ix_om_ordered_detail_master_id') drop index ix_om_ordered_detail_master_id ON om_ordered_detail; + +IF OBJECT_ID('fk_o_order_kcustomer_id', 'F') IS NOT NULL alter table o_order drop constraint fk_o_order_kcustomer_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_order','U') AND name = 'ix_o_order_kcustomer_id') drop index ix_o_order_kcustomer_id ON o_order; + +IF OBJECT_ID('fk_o_order_detail_order_id', 'F') IS NOT NULL alter table o_order_detail drop constraint fk_o_order_detail_order_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_order_detail','U') AND name = 'ix_o_order_detail_order_id') drop index ix_o_order_detail_order_id ON o_order_detail; + +IF OBJECT_ID('fk_o_order_detail_product_id', 'F') IS NOT NULL alter table o_order_detail drop constraint fk_o_order_detail_product_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_order_detail','U') AND name = 'ix_o_order_detail_product_id') drop index ix_o_order_detail_product_id ON o_order_detail; + +IF OBJECT_ID('fk_s_order_items_order_uuid', 'F') IS NOT NULL alter table s_order_items drop constraint fk_s_order_items_order_uuid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('s_order_items','U') AND name = 'ix_s_order_items_order_uuid') drop index ix_s_order_items_order_uuid ON s_order_items; + +IF OBJECT_ID('fk_or_order_ship_order_id', 'F') IS NOT NULL alter table or_order_ship drop constraint fk_or_order_ship_order_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('or_order_ship','U') AND name = 'ix_or_order_ship_order_id') drop index ix_or_order_ship_order_id ON or_order_ship; + +IF OBJECT_ID('fk_oto_bchild_master_id', 'F') IS NOT NULL alter table oto_bchild drop constraint fk_oto_bchild_master_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oto_child','U') AND name = 'uq_oto_child_master_id') drop index uq_oto_child_master_id ON oto_child; +IF OBJECT_ID('fk_oto_child_master_id', 'F') IS NOT NULL alter table oto_child drop constraint fk_oto_child_master_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oto_cust_address','U') AND name = 'uq_oto_cust_address_customer_cid') drop index uq_oto_cust_address_customer_cid ON oto_cust_address; +IF OBJECT_ID('fk_oto_cust_address_customer_cid', 'F') IS NOT NULL alter table oto_cust_address drop constraint fk_oto_cust_address_customer_cid; + +IF OBJECT_ID('fk_oto_prime_extra_eid', 'F') IS NOT NULL alter table oto_prime_extra drop constraint fk_oto_prime_extra_eid; + +IF OBJECT_ID('fk_oto_th_many_oto_th_top_id', 'F') IS NOT NULL alter table oto_th_many drop constraint fk_oto_th_many_oto_th_top_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oto_th_many','U') AND name = 'ix_oto_th_many_oto_th_top_id') drop index ix_oto_th_many_oto_th_top_id ON oto_th_many; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oto_th_one','U') AND name = 'uq_oto_th_one_many_id') drop index uq_oto_th_one_many_id ON oto_th_one; +IF OBJECT_ID('fk_oto_th_one_many_id', 'F') IS NOT NULL alter table oto_th_one drop constraint fk_oto_th_one_many_id; + +IF OBJECT_ID('fk_oto_ubprime_extra_eid', 'F') IS NOT NULL alter table oto_ubprime_extra drop constraint fk_oto_ubprime_extra_eid; + +IF OBJECT_ID('fk_oto_uprime_extra_eid', 'F') IS NOT NULL alter table oto_uprime_extra drop constraint fk_oto_uprime_extra_eid; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('pfile','U') AND name = 'uq_pfile_file_content_id') drop index uq_pfile_file_content_id ON pfile; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('pfile','U') AND name = 'uq_pfile_file_content2_id') drop index uq_pfile_file_content2_id ON pfile; +IF OBJECT_ID('fk_pfile_file_content_id', 'F') IS NOT NULL alter table pfile drop constraint fk_pfile_file_content_id; + +IF OBJECT_ID('fk_pfile_file_content2_id', 'F') IS NOT NULL alter table pfile drop constraint fk_pfile_file_content2_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('paggview','U') AND name = 'uq_paggview_pview_id') drop index uq_paggview_pview_id ON paggview; +IF OBJECT_ID('fk_paggview_pview_id', 'F') IS NOT NULL alter table paggview drop constraint fk_paggview_pview_id; + +IF OBJECT_ID('fk_pallet_location_zone_sid', 'F') IS NOT NULL alter table pallet_location drop constraint fk_pallet_location_zone_sid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('pallet_location','U') AND name = 'ix_pallet_location_zone_sid') drop index ix_pallet_location_zone_sid ON pallet_location; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('parcel_location','U') AND name = 'uq_parcel_location_parcelid') drop index uq_parcel_location_parcelid ON parcel_location; +IF OBJECT_ID('fk_parcel_location_parcelid', 'F') IS NOT NULL alter table parcel_location drop constraint fk_parcel_location_parcelid; + +IF OBJECT_ID('fk_rawinherit_parent_rawinherit_data_rawinherit_parent', 'F') IS NOT NULL alter table rawinherit_parent_rawinherit_data drop constraint fk_rawinherit_parent_rawinherit_data_rawinherit_parent; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('rawinherit_parent_rawinherit_data','U') AND name = 'ix_rawinherit_parent_rawinherit_data_rawinherit_parent') drop index ix_rawinherit_parent_rawinherit_data_rawinherit_parent ON rawinherit_parent_rawinherit_data; + +IF OBJECT_ID('fk_rawinherit_parent_rawinherit_data_rawinherit_data', 'F') IS NOT NULL alter table rawinherit_parent_rawinherit_data drop constraint fk_rawinherit_parent_rawinherit_data_rawinherit_data; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('rawinherit_parent_rawinherit_data','U') AND name = 'ix_rawinherit_parent_rawinherit_data_rawinherit_data') drop index ix_rawinherit_parent_rawinherit_data_rawinherit_data ON rawinherit_parent_rawinherit_data; + +IF OBJECT_ID('fk_parent_person_some_bean_id', 'F') IS NOT NULL alter table parent_person drop constraint fk_parent_person_some_bean_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('parent_person','U') AND name = 'ix_parent_person_some_bean_id') drop index ix_parent_person_some_bean_id ON parent_person; + +IF OBJECT_ID('fk_parent_person_parent_identifier', 'F') IS NOT NULL alter table parent_person drop constraint fk_parent_person_parent_identifier; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('parent_person','U') AND name = 'ix_parent_person_parent_identifier') drop index ix_parent_person_parent_identifier ON parent_person; + +IF OBJECT_ID('fk_c_participation_conversation_id', 'F') IS NOT NULL alter table c_participation drop constraint fk_c_participation_conversation_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('c_participation','U') AND name = 'ix_c_participation_conversation_id') drop index ix_c_participation_conversation_id ON c_participation; + +IF OBJECT_ID('fk_c_participation_user_id', 'F') IS NOT NULL alter table c_participation drop constraint fk_c_participation_user_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('c_participation','U') AND name = 'ix_c_participation_user_id') drop index ix_c_participation_user_id ON c_participation; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('persistent_file_content','U') AND name = 'uq_persistent_file_content_persistent_file_id') drop index uq_persistent_file_content_persistent_file_id ON persistent_file_content; +IF OBJECT_ID('fk_persistent_file_content_persistent_file_id', 'F') IS NOT NULL alter table persistent_file_content drop constraint fk_persistent_file_content_persistent_file_id; + +IF OBJECT_ID('fk_person_default_address_oid', 'F') IS NOT NULL alter table person drop constraint fk_person_default_address_oid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('person','U') AND name = 'ix_person_default_address_oid') drop index ix_person_default_address_oid ON person; + +IF OBJECT_ID('fk_phones_person_id', 'F') IS NOT NULL alter table phones drop constraint fk_phones_person_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('phones','U') AND name = 'ix_phones_person_id') drop index ix_phones_person_id ON phones; + +IF OBJECT_ID('fk_pp_to_ww_pp', 'F') IS NOT NULL alter table pp_to_ww drop constraint fk_pp_to_ww_pp; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('pp_to_ww','U') AND name = 'ix_pp_to_ww_pp') drop index ix_pp_to_ww_pp ON pp_to_ww; + +IF OBJECT_ID('fk_pp_to_ww_wview', 'F') IS NOT NULL alter table pp_to_ww drop constraint fk_pp_to_ww_wview; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('pp_to_ww','U') AND name = 'ix_pp_to_ww_wview') drop index ix_pp_to_ww_wview ON pp_to_ww; + +IF OBJECT_ID('fk_question_groupobjectid', 'F') IS NOT NULL alter table question drop constraint fk_question_groupobjectid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('question','U') AND name = 'ix_question_groupobjectid') drop index ix_question_groupobjectid ON question; + +IF OBJECT_ID('fk_r_orders_customer', 'F') IS NOT NULL alter table r_orders drop constraint fk_r_orders_customer; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('r_orders','U') AND name = 'ix_r_orders_customer') drop index ix_r_orders_customer ON r_orders; + +IF OBJECT_ID('fk_resourcefile_parentresourcefileid', 'F') IS NOT NULL alter table resourcefile drop constraint fk_resourcefile_parentresourcefileid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('resourcefile','U') AND name = 'ix_resourcefile_parentresourcefileid') drop index ix_resourcefile_parentresourcefileid ON resourcefile; + +IF OBJECT_ID('fk_mt_role_tenant_id', 'F') IS NOT NULL alter table mt_role drop constraint fk_mt_role_tenant_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mt_role','U') AND name = 'ix_mt_role_tenant_id') drop index ix_mt_role_tenant_id ON mt_role; + +IF OBJECT_ID('fk_mt_role_permission_mt_role', 'F') IS NOT NULL alter table mt_role_permission drop constraint fk_mt_role_permission_mt_role; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mt_role_permission','U') AND name = 'ix_mt_role_permission_mt_role') drop index ix_mt_role_permission_mt_role ON mt_role_permission; + +IF OBJECT_ID('fk_mt_role_permission_mt_permission', 'F') IS NOT NULL alter table mt_role_permission drop constraint fk_mt_role_permission_mt_permission; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mt_role_permission','U') AND name = 'ix_mt_role_permission_mt_permission') drop index ix_mt_role_permission_mt_permission ON mt_role_permission; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('f_second','U') AND name = 'uq_f_second_first') drop index uq_f_second_first ON f_second; +IF OBJECT_ID('fk_f_second_first', 'F') IS NOT NULL alter table f_second drop constraint fk_f_second_first; + +IF OBJECT_ID('fk_section_article_id', 'F') IS NOT NULL alter table section drop constraint fk_section_article_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('section','U') AND name = 'ix_section_article_id') drop index ix_section_article_id ON section; + +IF OBJECT_ID('fk_self_parent_parent_id', 'F') IS NOT NULL alter table self_parent drop constraint fk_self_parent_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('self_parent','U') AND name = 'ix_self_parent_parent_id') drop index ix_self_parent_parent_id ON self_parent; + +IF OBJECT_ID('fk_self_ref_customer_referred_by_id', 'F') IS NOT NULL alter table self_ref_customer drop constraint fk_self_ref_customer_referred_by_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('self_ref_customer','U') AND name = 'ix_self_ref_customer_referred_by_id') drop index ix_self_ref_customer_referred_by_id ON self_ref_customer; + +IF OBJECT_ID('fk_self_ref_example_parent_id', 'F') IS NOT NULL alter table self_ref_example drop constraint fk_self_ref_example_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('self_ref_example','U') AND name = 'ix_self_ref_example_parent_id') drop index ix_self_ref_example_parent_id ON self_ref_example; + +IF OBJECT_ID('fk_stockforecast_inner_report_id', 'F') IS NOT NULL alter table stockforecast drop constraint fk_stockforecast_inner_report_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('stockforecast','U') AND name = 'ix_stockforecast_inner_report_id') drop index ix_stockforecast_inner_report_id ON stockforecast; + +IF OBJECT_ID('fk_sub_section_section_id', 'F') IS NOT NULL alter table sub_section drop constraint fk_sub_section_section_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('sub_section','U') AND name = 'ix_sub_section_section_id') drop index ix_sub_section_section_id ON sub_section; + +IF OBJECT_ID('fk_tevent_many_event_id', 'F') IS NOT NULL alter table tevent_many drop constraint fk_tevent_many_event_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('tevent_many','U') AND name = 'ix_tevent_many_event_id') drop index ix_tevent_many_event_id ON tevent_many; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('tevent_one','U') AND name = 'uq_tevent_one_event_id') drop index uq_tevent_one_event_id ON tevent_one; +IF OBJECT_ID('fk_tevent_one_event_id', 'F') IS NOT NULL alter table tevent_one drop constraint fk_tevent_one_event_id; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('t_detail_with_other_namexxxyy','U') AND name = 'uq_t_detail_with_other_namexxxyy_some_unique_value') drop index uq_t_detail_with_other_namexxxyy_some_unique_value ON t_detail_with_other_namexxxyy; +IF OBJECT_ID('fk_t_detail_with_other_namexxxyy_master_id', 'F') IS NOT NULL alter table t_detail_with_other_namexxxyy drop constraint fk_t_detail_with_other_namexxxyy_master_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('t_detail_with_other_namexxxyy','U') AND name = 'ix_t_detail_with_other_namexxxyy_master_id') drop index ix_t_detail_with_other_namexxxyy_master_id ON t_detail_with_other_namexxxyy; + +IF OBJECT_ID('fk_ts_detail_two_master_id', 'F') IS NOT NULL alter table ts_detail_two drop constraint fk_ts_detail_two_master_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ts_detail_two','U') AND name = 'ix_ts_detail_two_master_id') drop index ix_ts_detail_two_master_id ON ts_detail_two; + +IF OBJECT_ID('fk_twheel_owner_plate_no', 'F') IS NOT NULL alter table twheel drop constraint fk_twheel_owner_plate_no; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('twheel','U') AND name = 'ix_twheel_owner_plate_no') drop index ix_twheel_owner_plate_no ON twheel; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('tire','U') AND name = 'uq_tire_wheel') drop index uq_tire_wheel ON tire; +IF OBJECT_ID('fk_tire_wheel', 'F') IS NOT NULL alter table tire drop constraint fk_tire_wheel; + +IF OBJECT_ID('fk_trip_vehicle_driver_id', 'F') IS NOT NULL alter table trip drop constraint fk_trip_vehicle_driver_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('trip','U') AND name = 'ix_trip_vehicle_driver_id') drop index ix_trip_vehicle_driver_id ON trip; + +IF OBJECT_ID('fk_trip_address_id', 'F') IS NOT NULL alter table trip drop constraint fk_trip_address_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('trip','U') AND name = 'ix_trip_address_id') drop index ix_trip_address_id ON trip; + +IF OBJECT_ID('fk_type_sub_type_id', 'F') IS NOT NULL alter table type drop constraint fk_type_sub_type_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('type','U') AND name = 'ix_type_sub_type_id') drop index ix_type_sub_type_id ON type; + +IF OBJECT_ID('fk_ut_detail_utmaster_id', 'F') IS NOT NULL alter table ut_detail drop constraint fk_ut_detail_utmaster_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ut_detail','U') AND name = 'ix_ut_detail_utmaster_id') drop index ix_ut_detail_utmaster_id ON ut_detail; + +IF OBJECT_ID('fk_uutwo_master_id', 'F') IS NOT NULL alter table uutwo drop constraint fk_uutwo_master_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('uutwo','U') AND name = 'ix_uutwo_master_id') drop index ix_uutwo_master_id ON uutwo; + +IF OBJECT_ID('fk_c_user_group_id', 'F') IS NOT NULL alter table c_user drop constraint fk_c_user_group_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('c_user','U') AND name = 'ix_c_user_group_id') drop index ix_c_user_group_id ON c_user; + +IF OBJECT_ID('fk_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; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('em_user_role','U') AND name = 'ix_em_user_role_user_id') drop index ix_em_user_role_user_id ON em_user_role; + +IF OBJECT_ID('fk_em_user_role_role_id', 'F') IS NOT NULL alter table em_user_role drop constraint fk_em_user_role_role_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('em_user_role','U') AND name = 'ix_em_user_role_role_id') drop index ix_em_user_role_role_id ON em_user_role; + +IF OBJECT_ID('fk_vehicle_car_ref_id', 'F') IS NOT NULL alter table vehicle drop constraint fk_vehicle_car_ref_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('vehicle','U') AND name = 'ix_vehicle_car_ref_id') drop index ix_vehicle_car_ref_id ON vehicle; + +IF OBJECT_ID('fk_vehicle_truck_ref_id', 'F') IS NOT NULL alter table vehicle drop constraint fk_vehicle_truck_ref_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('vehicle','U') AND name = 'ix_vehicle_truck_ref_id') drop index ix_vehicle_truck_ref_id ON vehicle; + +IF OBJECT_ID('fk_vehicle_driver_vehicle_id', 'F') IS NOT NULL alter table vehicle_driver drop constraint fk_vehicle_driver_vehicle_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('vehicle_driver','U') AND name = 'ix_vehicle_driver_vehicle_id') drop index ix_vehicle_driver_vehicle_id ON vehicle_driver; + +IF OBJECT_ID('fk_vehicle_driver_address_id', 'F') IS NOT NULL alter table vehicle_driver drop constraint fk_vehicle_driver_address_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('vehicle_driver','U') AND name = 'ix_vehicle_driver_address_id') drop index ix_vehicle_driver_address_id ON vehicle_driver; + +IF OBJECT_ID('fk_warehouses_officezoneid', 'F') IS NOT NULL alter table warehouses drop constraint fk_warehouses_officezoneid; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('warehouses','U') AND name = 'ix_warehouses_officezoneid') drop index ix_warehouses_officezoneid ON warehouses; + +IF OBJECT_ID('fk_warehousesshippingzones_warehouses', 'F') IS NOT NULL alter table warehousesshippingzones drop constraint fk_warehousesshippingzones_warehouses; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('warehousesshippingzones','U') AND name = 'ix_warehousesshippingzones_warehouses') drop index ix_warehousesshippingzones_warehouses ON warehousesshippingzones; + +IF OBJECT_ID('fk_warehousesshippingzones_zones', 'F') IS NOT NULL alter table warehousesshippingzones drop constraint fk_warehousesshippingzones_zones; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('warehousesshippingzones','U') AND name = 'ix_warehousesshippingzones_zones') drop index ix_warehousesshippingzones_zones ON warehousesshippingzones; + +IF OBJECT_ID('fk_sa_wheel_tire', 'F') IS NOT NULL alter table sa_wheel drop constraint fk_sa_wheel_tire; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('sa_wheel','U') AND name = 'ix_sa_wheel_tire') drop index ix_sa_wheel_tire ON sa_wheel; + +IF OBJECT_ID('fk_sa_wheel_car', 'F') IS NOT NULL alter table sa_wheel drop constraint fk_sa_wheel_car; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('sa_wheel','U') AND name = 'ix_sa_wheel_car') drop index ix_sa_wheel_car ON sa_wheel; + +IF OBJECT_ID('fk_g_who_props_otm_who_created_id', 'F') IS NOT NULL alter table g_who_props_otm drop constraint fk_g_who_props_otm_who_created_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('g_who_props_otm','U') AND name = 'ix_g_who_props_otm_who_created_id') drop index ix_g_who_props_otm_who_created_id ON g_who_props_otm; + +IF OBJECT_ID('fk_g_who_props_otm_who_modified_id', 'F') IS NOT NULL alter table g_who_props_otm drop constraint fk_g_who_props_otm_who_modified_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('g_who_props_otm','U') AND name = 'ix_g_who_props_otm_who_modified_id') drop index ix_g_who_props_otm_who_modified_id ON g_who_props_otm; + +IF OBJECT_ID('fk_with_zero_parent_id', 'F') IS NOT NULL alter table with_zero drop constraint fk_with_zero_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('with_zero','U') AND name = 'ix_with_zero_parent_id') drop index ix_with_zero_parent_id ON with_zero; + +IF OBJECT_ID('asimple_bean', 'U') IS NOT NULL drop table asimple_bean; +IF OBJECT_ID('asimple_bean_seq', 'SO') IS NOT NULL drop sequence asimple_bean_seq; + +IF OBJECT_ID('bar', 'U') IS NOT NULL drop table bar; +IF OBJECT_ID('bar_seq', 'SO') IS NOT NULL drop sequence bar_seq; + +IF OBJECT_ID('oto_account', 'U') IS NOT NULL drop table oto_account; +IF OBJECT_ID('oto_account_seq', 'SO') IS NOT NULL drop sequence oto_account_seq; + +IF OBJECT_ID('addr', 'U') IS NOT NULL drop table addr; +IF OBJECT_ID('addr_seq', 'SO') IS NOT NULL drop sequence addr_seq; + +IF OBJECT_ID('address', 'U') IS NOT NULL drop table address; +IF OBJECT_ID('address_seq', 'SO') IS NOT NULL drop sequence address_seq; + +IF OBJECT_ID('o_address', 'U') IS NOT NULL drop table o_address; +IF OBJECT_ID('o_address_seq', 'SO') IS NOT NULL drop sequence o_address_seq; + +IF OBJECT_ID('album', 'U') IS NOT NULL drop table album; +IF OBJECT_ID('album_seq', 'SO') IS NOT NULL drop sequence album_seq; + +IF OBJECT_ID('animal', 'U') IS NOT NULL drop table animal; +IF OBJECT_ID('animal_seq', 'SO') IS NOT NULL drop sequence animal_seq; + +IF OBJECT_ID('animal_shelter', 'U') IS NOT NULL drop table animal_shelter; +IF OBJECT_ID('animal_shelter_seq', 'SO') IS NOT NULL drop sequence animal_shelter_seq; + +IF OBJECT_ID('article', 'U') IS NOT NULL drop table article; +IF OBJECT_ID('article_seq', 'SO') IS NOT NULL drop sequence article_seq; + +IF OBJECT_ID('attribute', 'U') IS NOT NULL drop table attribute; +IF OBJECT_ID('attribute_seq', 'SO') IS NOT NULL drop sequence attribute_seq; + +IF OBJECT_ID('attribute_holder', 'U') IS NOT NULL drop table attribute_holder; +IF OBJECT_ID('attribute_holder_seq', 'SO') IS NOT NULL drop sequence attribute_holder_seq; + +IF OBJECT_ID('audit_log', 'U') IS NOT NULL drop table audit_log; +IF OBJECT_ID('audit_log_seq', 'SO') IS NOT NULL drop sequence audit_log_seq; + +IF OBJECT_ID('bbookmark', 'U') IS NOT NULL drop table bbookmark; +IF OBJECT_ID('bbookmark_seq', 'SO') IS NOT NULL drop sequence bbookmark_seq; + +IF OBJECT_ID('bbookmark_user', 'U') IS NOT NULL drop table bbookmark_user; +IF OBJECT_ID('bbookmark_user_seq', 'SO') IS NOT NULL drop sequence bbookmark_user_seq; + +IF OBJECT_ID('bsimple_with_gen', 'U') IS NOT NULL drop table bsimple_with_gen; +IF OBJECT_ID('bsimple_with_gen_seq', 'SO') IS NOT NULL drop sequence bsimple_with_gen_seq; + +IF OBJECT_ID('bsite', 'U') IS NOT NULL drop table bsite; + +IF OBJECT_ID('bsite_user', 'U') IS NOT NULL drop table bsite_user; + +IF OBJECT_ID('bsite_user_b', 'U') IS NOT NULL drop table bsite_user_b; + +IF OBJECT_ID('bsite_user_c', 'U') IS NOT NULL drop table bsite_user_c; + +IF OBJECT_ID('buser', 'U') IS NOT NULL drop table buser; + +IF OBJECT_ID('bwith_qident', 'U') IS NOT NULL drop table bwith_qident; +IF OBJECT_ID('bwith_qident_seq', 'SO') IS NOT NULL drop sequence bwith_qident_seq; + +IF OBJECT_ID('basic_joda_entity', 'U') IS NOT NULL drop table basic_joda_entity; +IF OBJECT_ID('basic_joda_entity_seq', 'SO') IS NOT NULL drop sequence basic_joda_entity_seq; + +IF OBJECT_ID('bean_with_time_zone', 'U') IS NOT NULL drop table bean_with_time_zone; +IF OBJECT_ID('bean_with_time_zone_seq', 'SO') IS NOT NULL drop sequence bean_with_time_zone_seq; + +IF OBJECT_ID('drel_booking', 'U') IS NOT NULL drop table drel_booking; +IF OBJECT_ID('drel_booking_seq', 'SO') IS NOT NULL drop sequence drel_booking_seq; + +IF OBJECT_ID('cinh_root', 'U') IS NOT NULL drop table cinh_root; +IF OBJECT_ID('cinh_root_seq', 'SO') IS NOT NULL drop sequence cinh_root_seq; + +IF OBJECT_ID('ckey_assoc', 'U') IS NOT NULL drop table ckey_assoc; +IF OBJECT_ID('ckey_assoc_seq', 'SO') IS NOT NULL drop sequence ckey_assoc_seq; + +IF OBJECT_ID('ckey_detail', 'U') IS NOT NULL drop table ckey_detail; +IF OBJECT_ID('ckey_detail_seq', 'SO') IS NOT NULL drop sequence ckey_detail_seq; + +IF OBJECT_ID('ckey_parent', 'U') IS NOT NULL drop table ckey_parent; + +IF OBJECT_ID('calculation_result', 'U') IS NOT NULL drop table calculation_result; +IF OBJECT_ID('calculation_result_seq', 'SO') IS NOT NULL drop sequence calculation_result_seq; + +IF OBJECT_ID('cao_bean', 'U') IS NOT NULL drop table cao_bean; + +IF OBJECT_ID('sa_car', 'U') IS NOT NULL drop table sa_car; +IF OBJECT_ID('sa_car_seq', 'SO') IS NOT NULL drop sequence sa_car_seq; + +IF OBJECT_ID('sp_car_car', 'U') IS NOT NULL drop table sp_car_car; +IF OBJECT_ID('sp_car_car_seq', 'SO') IS NOT NULL drop sequence sp_car_car_seq; + +IF OBJECT_ID('sp_car_car_wheels', 'U') IS NOT NULL drop table sp_car_car_wheels; + +IF OBJECT_ID('car_accessory', 'U') IS NOT NULL drop table car_accessory; +IF OBJECT_ID('car_accessory_seq', 'SO') IS NOT NULL drop sequence car_accessory_seq; + +IF OBJECT_ID('car_fuse', 'U') IS NOT NULL drop table car_fuse; +IF OBJECT_ID('car_fuse_seq', 'SO') IS NOT NULL drop sequence car_fuse_seq; + +IF OBJECT_ID('category', 'U') IS NOT NULL drop table category; +IF OBJECT_ID('category_seq', 'SO') IS NOT NULL drop sequence category_seq; + +IF OBJECT_ID('child_person', 'U') IS NOT NULL drop table child_person; +IF OBJECT_ID('child_person_seq', 'SO') IS NOT NULL drop sequence child_person_seq; + +IF OBJECT_ID('configuration', 'U') IS NOT NULL drop table configuration; +IF OBJECT_ID('configuration_seq', 'SO') IS NOT NULL drop sequence configuration_seq; + +IF OBJECT_ID('configurations', 'U') IS NOT NULL drop table configurations; +IF OBJECT_ID('configurations_seq', 'SO') IS NOT NULL drop sequence configurations_seq; + +IF OBJECT_ID('contact', 'U') IS NOT NULL drop table contact; +IF OBJECT_ID('contact_seq', 'SO') IS NOT NULL drop sequence contact_seq; + +IF OBJECT_ID('contact_group', 'U') IS NOT NULL drop table contact_group; +IF OBJECT_ID('contact_group_seq', 'SO') IS NOT NULL drop sequence contact_group_seq; + +IF OBJECT_ID('contact_note', 'U') IS NOT NULL drop table contact_note; +IF OBJECT_ID('contact_note_seq', 'SO') IS NOT NULL drop sequence contact_note_seq; + +IF OBJECT_ID('c_conversation', 'U') IS NOT NULL drop table c_conversation; +IF OBJECT_ID('c_conversation_seq', 'SO') IS NOT NULL drop sequence c_conversation_seq; + +IF OBJECT_ID('o_country', 'U') IS NOT NULL drop table o_country; + +IF OBJECT_ID('cover', 'U') IS NOT NULL drop table cover; +IF OBJECT_ID('cover_seq', 'SO') IS NOT NULL drop sequence cover_seq; + +IF OBJECT_ID('o_customer', 'U') IS NOT NULL drop table o_customer; +IF OBJECT_ID('o_customer_seq', 'SO') IS NOT NULL drop sequence o_customer_seq; + +IF OBJECT_ID('dcredit', 'U') IS NOT NULL drop table dcredit; +IF OBJECT_ID('dcredit_seq', 'SO') IS NOT NULL drop sequence dcredit_seq; + +IF OBJECT_ID('dcredit_drol', 'U') IS NOT NULL drop table dcredit_drol; + +IF OBJECT_ID('dexh_entity', 'U') IS NOT NULL drop table dexh_entity; +IF OBJECT_ID('dexh_entity_seq', 'SO') IS NOT NULL drop sequence dexh_entity_seq; + +IF OBJECT_ID('dperson', 'U') IS NOT NULL drop table dperson; +IF OBJECT_ID('dperson_seq', 'SO') IS NOT NULL drop sequence dperson_seq; + +IF OBJECT_ID('drol', 'U') IS NOT NULL drop table drol; +IF OBJECT_ID('drol_seq', 'SO') IS NOT NULL drop sequence drol_seq; + +IF OBJECT_ID('drot', 'U') IS NOT NULL drop table drot; +IF OBJECT_ID('drot_seq', 'SO') IS NOT NULL drop sequence drot_seq; + +IF OBJECT_ID('drot_drol', 'U') IS NOT NULL drop table drot_drol; + +IF OBJECT_ID('rawinherit_data', 'U') IS NOT NULL drop table rawinherit_data; +IF OBJECT_ID('rawinherit_data_seq', 'SO') IS NOT NULL drop sequence rawinherit_data_seq; + +IF OBJECT_ID('dfk_cascade', 'U') IS NOT NULL drop table dfk_cascade; +IF OBJECT_ID('dfk_cascade_seq', 'SO') IS NOT NULL drop sequence dfk_cascade_seq; + +IF OBJECT_ID('dfk_cascade_one', 'U') IS NOT NULL drop table dfk_cascade_one; +IF OBJECT_ID('dfk_cascade_one_seq', 'SO') IS NOT NULL drop sequence dfk_cascade_one_seq; + +IF OBJECT_ID('dfk_none', 'U') IS NOT NULL drop table dfk_none; +IF OBJECT_ID('dfk_none_seq', 'SO') IS NOT NULL drop sequence dfk_none_seq; + +IF OBJECT_ID('dfk_none_via_join', 'U') IS NOT NULL drop table dfk_none_via_join; +IF OBJECT_ID('dfk_none_via_join_seq', 'SO') IS NOT NULL drop sequence dfk_none_via_join_seq; + +IF OBJECT_ID('dfk_one', 'U') IS NOT NULL drop table dfk_one; +IF OBJECT_ID('dfk_one_seq', 'SO') IS NOT NULL drop sequence dfk_one_seq; + +IF OBJECT_ID('dfk_set_null', 'U') IS NOT NULL drop table dfk_set_null; +IF OBJECT_ID('dfk_set_null_seq', 'SO') IS NOT NULL drop sequence dfk_set_null_seq; + +IF OBJECT_ID('doc', 'U') IS NOT NULL drop table doc; +IF OBJECT_ID('doc_seq', 'SO') IS NOT NULL drop sequence doc_seq; + +IF OBJECT_ID('doc_link', 'U') IS NOT NULL drop table doc_link; + +IF OBJECT_ID('doc_link_draft', 'U') IS NOT NULL drop table doc_link_draft; + +IF OBJECT_ID('doc_draft', 'U') IS NOT NULL drop table doc_draft; +IF OBJECT_ID('doc_draft_seq', 'SO') IS NOT NULL drop sequence doc_draft_seq; + +IF OBJECT_ID('document', 'U') IS NOT NULL drop table document; +IF OBJECT_ID('document_seq', 'SO') IS NOT NULL drop sequence document_seq; + +IF OBJECT_ID('document_draft', 'U') IS NOT NULL drop table document_draft; +IF OBJECT_ID('document_draft_seq', 'SO') IS NOT NULL drop sequence document_draft_seq; + +IF OBJECT_ID('document_media', 'U') IS NOT NULL drop table document_media; +IF OBJECT_ID('document_media_seq', 'SO') IS NOT NULL drop sequence document_media_seq; + +IF OBJECT_ID('document_media_draft', 'U') IS NOT NULL drop table document_media_draft; +IF OBJECT_ID('document_media_draft_seq', 'SO') IS NOT NULL drop sequence document_media_draft_seq; + +IF OBJECT_ID('earray_bean', 'U') IS NOT NULL drop table earray_bean; +IF OBJECT_ID('earray_bean_seq', 'SO') IS NOT NULL drop sequence earray_bean_seq; + +IF OBJECT_ID('earray_set_bean', 'U') IS NOT NULL drop table earray_set_bean; +IF OBJECT_ID('earray_set_bean_seq', 'SO') IS NOT NULL drop sequence earray_set_bean_seq; + +IF OBJECT_ID('e_basic', 'U') IS NOT NULL drop table e_basic; +IF OBJECT_ID('e_basic_seq', 'SO') IS NOT NULL drop sequence e_basic_seq; + +IF OBJECT_ID('ebasic_change_log', 'U') IS NOT NULL drop table ebasic_change_log; +IF OBJECT_ID('ebasic_change_log_seq', 'SO') IS NOT NULL drop sequence ebasic_change_log_seq; + +IF OBJECT_ID('ebasic_clob', 'U') IS NOT NULL drop table ebasic_clob; +IF OBJECT_ID('ebasic_clob_seq', 'SO') IS NOT NULL drop sequence ebasic_clob_seq; + +IF OBJECT_ID('ebasic_clob_fetch_eager', 'U') IS NOT NULL drop table ebasic_clob_fetch_eager; +IF OBJECT_ID('ebasic_clob_fetch_eager_seq', 'SO') IS NOT NULL drop sequence ebasic_clob_fetch_eager_seq; + +IF OBJECT_ID('ebasic_clob_no_ver', 'U') IS NOT NULL drop table ebasic_clob_no_ver; +IF OBJECT_ID('ebasic_clob_no_ver_seq', 'SO') IS NOT NULL drop sequence ebasic_clob_no_ver_seq; + +IF OBJECT_ID('e_basicenc', 'U') IS NOT NULL drop table e_basicenc; +IF OBJECT_ID('e_basicenc_seq', 'SO') IS NOT NULL drop sequence e_basicenc_seq; + +IF OBJECT_ID('e_basicenc_bin', 'U') IS NOT NULL drop table e_basicenc_bin; +IF OBJECT_ID('e_basicenc_bin_seq', 'SO') IS NOT NULL drop sequence e_basicenc_bin_seq; + +IF OBJECT_ID('e_basic_enum_id', 'U') IS NOT NULL drop table e_basic_enum_id; + +IF OBJECT_ID('e_basic_eni', 'U') IS NOT NULL drop table e_basic_eni; +IF OBJECT_ID('e_basic_eni_seq', 'SO') IS NOT NULL drop sequence e_basic_eni_seq; + +IF OBJECT_ID('ebasic_hstore', 'U') IS NOT NULL drop table ebasic_hstore; +IF OBJECT_ID('ebasic_hstore_seq', 'SO') IS NOT NULL drop sequence ebasic_hstore_seq; + +IF OBJECT_ID('ebasic_json_list', 'U') IS NOT NULL drop table ebasic_json_list; +IF OBJECT_ID('ebasic_json_list_seq', 'SO') IS NOT NULL drop sequence ebasic_json_list_seq; + +IF OBJECT_ID('ebasic_json_map', 'U') IS NOT NULL drop table ebasic_json_map; +IF OBJECT_ID('ebasic_json_map_seq', 'SO') IS NOT NULL drop sequence ebasic_json_map_seq; + +IF OBJECT_ID('ebasic_json_map_blob', 'U') IS NOT NULL drop table ebasic_json_map_blob; +IF OBJECT_ID('ebasic_json_map_blob_seq', 'SO') IS NOT NULL drop sequence ebasic_json_map_blob_seq; + +IF OBJECT_ID('ebasic_json_map_clob', 'U') IS NOT NULL drop table ebasic_json_map_clob; +IF OBJECT_ID('ebasic_json_map_clob_seq', 'SO') IS NOT NULL drop sequence ebasic_json_map_clob_seq; + +IF OBJECT_ID('ebasic_json_map_detail', 'U') IS NOT NULL drop table ebasic_json_map_detail; +IF OBJECT_ID('ebasic_json_map_detail_seq', 'SO') IS NOT NULL drop sequence ebasic_json_map_detail_seq; + +IF OBJECT_ID('ebasic_json_map_json_b', 'U') IS NOT NULL drop table ebasic_json_map_json_b; +IF OBJECT_ID('ebasic_json_map_json_b_seq', 'SO') IS NOT NULL drop sequence ebasic_json_map_json_b_seq; + +IF OBJECT_ID('ebasic_json_map_varchar', 'U') IS NOT NULL drop table ebasic_json_map_varchar; +IF OBJECT_ID('ebasic_json_map_varchar_seq', 'SO') IS NOT NULL drop sequence ebasic_json_map_varchar_seq; + +IF OBJECT_ID('ebasic_json_node', 'U') IS NOT NULL drop table ebasic_json_node; +IF OBJECT_ID('ebasic_json_node_seq', 'SO') IS NOT NULL drop sequence ebasic_json_node_seq; + +IF OBJECT_ID('ebasic_json_node_blob', 'U') IS NOT NULL drop table ebasic_json_node_blob; +IF OBJECT_ID('ebasic_json_node_blob_seq', 'SO') IS NOT NULL drop sequence ebasic_json_node_blob_seq; + +IF OBJECT_ID('ebasic_json_node_json_b', 'U') IS NOT NULL drop table ebasic_json_node_json_b; +IF OBJECT_ID('ebasic_json_node_json_b_seq', 'SO') IS NOT NULL drop sequence ebasic_json_node_json_b_seq; + +IF OBJECT_ID('ebasic_json_node_varchar', 'U') IS NOT NULL drop table ebasic_json_node_varchar; +IF OBJECT_ID('ebasic_json_node_varchar_seq', 'SO') IS NOT NULL drop sequence ebasic_json_node_varchar_seq; + +IF OBJECT_ID('ebasic_json_unmapped', 'U') IS NOT NULL drop table ebasic_json_unmapped; +IF OBJECT_ID('ebasic_json_unmapped_seq', 'SO') IS NOT NULL drop sequence ebasic_json_unmapped_seq; + +IF OBJECT_ID('e_basic_ndc', 'U') IS NOT NULL drop table e_basic_ndc; +IF OBJECT_ID('e_basic_ndc_seq', 'SO') IS NOT NULL drop sequence e_basic_ndc_seq; + +IF OBJECT_ID('ebasic_no_sdchild', 'U') IS NOT NULL drop table ebasic_no_sdchild; +IF OBJECT_ID('ebasic_no_sdchild_seq', 'SO') IS NOT NULL drop sequence ebasic_no_sdchild_seq; + +IF OBJECT_ID('ebasic_sdchild', 'U') IS NOT NULL drop table ebasic_sdchild; +IF OBJECT_ID('ebasic_sdchild_seq', 'SO') IS NOT NULL drop sequence ebasic_sdchild_seq; + +IF OBJECT_ID('ebasic_soft_delete', 'U') IS NOT NULL drop table ebasic_soft_delete; +IF OBJECT_ID('ebasic_soft_delete_seq', 'SO') IS NOT NULL drop sequence ebasic_soft_delete_seq; + +IF OBJECT_ID('e_basicver', 'U') IS NOT NULL drop table e_basicver; +IF OBJECT_ID('e_basicver_seq', 'SO') IS NOT NULL drop sequence e_basicver_seq; + +IF OBJECT_ID('e_basic_withlife', 'U') IS NOT NULL drop table e_basic_withlife; +IF OBJECT_ID('e_basic_withlife_seq', 'SO') IS NOT NULL drop sequence e_basic_withlife_seq; + +IF OBJECT_ID('e_basicverucon', 'U') IS NOT NULL drop table e_basicverucon; +IF OBJECT_ID('e_basicverucon_seq', 'SO') IS NOT NULL drop sequence e_basicverucon_seq; + +IF OBJECT_ID('e_col_ab', 'U') IS NOT NULL drop table e_col_ab; +IF OBJECT_ID('e_col_ab_seq', 'SO') IS NOT NULL drop sequence e_col_ab_seq; + +IF OBJECT_ID('ecustom_id', 'U') IS NOT NULL drop table ecustom_id; + +IF OBJECT_ID('eemb_inner', 'U') IS NOT NULL drop table eemb_inner; +IF OBJECT_ID('eemb_inner_seq', 'SO') IS NOT NULL drop sequence eemb_inner_seq; + +IF OBJECT_ID('eemb_outer', 'U') IS NOT NULL drop table eemb_outer; +IF OBJECT_ID('eemb_outer_seq', 'SO') IS NOT NULL drop sequence eemb_outer_seq; + +IF OBJECT_ID('egen_props', 'U') IS NOT NULL drop table egen_props; +IF OBJECT_ID('egen_props_seq', 'SO') IS NOT NULL drop sequence egen_props_seq; + +IF OBJECT_ID('einvoice', 'U') IS NOT NULL drop table einvoice; +IF OBJECT_ID('einvoice_seq', 'SO') IS NOT NULL drop sequence einvoice_seq; + +IF OBJECT_ID('e_main', 'U') IS NOT NULL drop table e_main; +IF OBJECT_ID('e_main_seq', 'SO') IS NOT NULL drop sequence e_main_seq; + +IF OBJECT_ID('enull_collection', 'U') IS NOT NULL drop table enull_collection; +IF OBJECT_ID('enull_collection_seq', 'SO') IS NOT NULL drop sequence enull_collection_seq; + +IF OBJECT_ID('enull_collection_detail', 'U') IS NOT NULL drop table enull_collection_detail; +IF OBJECT_ID('enull_collection_detail_seq', 'SO') IS NOT NULL drop sequence enull_collection_detail_seq; + +IF OBJECT_ID('eopt_one_a', 'U') IS NOT NULL drop table eopt_one_a; +IF OBJECT_ID('eopt_one_a_seq', 'SO') IS NOT NULL drop sequence eopt_one_a_seq; + +IF OBJECT_ID('eopt_one_b', 'U') IS NOT NULL drop table eopt_one_b; +IF OBJECT_ID('eopt_one_b_seq', 'SO') IS NOT NULL drop sequence eopt_one_b_seq; + +IF OBJECT_ID('eopt_one_c', 'U') IS NOT NULL drop table eopt_one_c; +IF OBJECT_ID('eopt_one_c_seq', 'SO') IS NOT NULL drop sequence eopt_one_c_seq; + +IF OBJECT_ID('eperson', 'U') IS NOT NULL drop table eperson; +IF OBJECT_ID('eperson_seq', 'SO') IS NOT NULL drop sequence eperson_seq; + +IF OBJECT_ID('e_person_online', 'U') IS NOT NULL drop table e_person_online; +IF OBJECT_ID('e_person_online_seq', 'SO') IS NOT NULL drop sequence e_person_online_seq; + +IF OBJECT_ID('esimple', 'U') IS NOT NULL drop table esimple; + +IF OBJECT_ID('esoft_del_book', 'U') IS NOT NULL drop table esoft_del_book; +IF OBJECT_ID('esoft_del_book_seq', 'SO') IS NOT NULL drop sequence esoft_del_book_seq; + +IF OBJECT_ID('esoft_del_book_esoft_del_user', 'U') IS NOT NULL drop table esoft_del_book_esoft_del_user; + +IF OBJECT_ID('esoft_del_down', 'U') IS NOT NULL drop table esoft_del_down; +IF OBJECT_ID('esoft_del_down_seq', 'SO') IS NOT NULL drop sequence esoft_del_down_seq; + +IF OBJECT_ID('esoft_del_mid', 'U') IS NOT NULL drop table esoft_del_mid; +IF OBJECT_ID('esoft_del_mid_seq', 'SO') IS NOT NULL drop sequence esoft_del_mid_seq; + +IF OBJECT_ID('esoft_del_one_a', 'U') IS NOT NULL drop table esoft_del_one_a; +IF OBJECT_ID('esoft_del_one_a_seq', 'SO') IS NOT NULL drop sequence esoft_del_one_a_seq; + +IF OBJECT_ID('esoft_del_one_b', 'U') IS NOT NULL drop table esoft_del_one_b; +IF OBJECT_ID('esoft_del_one_b_seq', 'SO') IS NOT NULL drop sequence esoft_del_one_b_seq; + +IF OBJECT_ID('esoft_del_role', 'U') IS NOT NULL drop table esoft_del_role; +IF OBJECT_ID('esoft_del_role_seq', 'SO') IS NOT NULL drop sequence esoft_del_role_seq; + +IF OBJECT_ID('esoft_del_role_esoft_del_user', 'U') IS NOT NULL drop table esoft_del_role_esoft_del_user; + +IF OBJECT_ID('esoft_del_top', 'U') IS NOT NULL drop table esoft_del_top; +IF OBJECT_ID('esoft_del_top_seq', 'SO') IS NOT NULL drop sequence esoft_del_top_seq; + +IF OBJECT_ID('esoft_del_up', 'U') IS NOT NULL drop table esoft_del_up; +IF OBJECT_ID('esoft_del_up_seq', 'SO') IS NOT NULL drop sequence esoft_del_up_seq; + +IF OBJECT_ID('esoft_del_user', 'U') IS NOT NULL drop table esoft_del_user; +IF OBJECT_ID('esoft_del_user_seq', 'SO') IS NOT NULL drop sequence esoft_del_user_seq; + +IF OBJECT_ID('esoft_del_user_esoft_del_role', 'U') IS NOT NULL drop table esoft_del_user_esoft_del_role; + +IF OBJECT_ID('esome_convert_type', 'U') IS NOT NULL drop table esome_convert_type; +IF OBJECT_ID('esome_convert_type_seq', 'SO') IS NOT NULL drop sequence esome_convert_type_seq; + +IF OBJECT_ID('esome_type', 'U') IS NOT NULL drop table esome_type; +IF OBJECT_ID('esome_type_seq', 'SO') IS NOT NULL drop sequence esome_type_seq; + +IF OBJECT_ID('etrans_many', 'U') IS NOT NULL drop table etrans_many; +IF OBJECT_ID('etrans_many_seq', 'SO') IS NOT NULL drop sequence etrans_many_seq; + +IF OBJECT_ID('rawinherit_uncle', 'U') IS NOT NULL drop table rawinherit_uncle; +IF OBJECT_ID('rawinherit_uncle_seq', 'SO') IS NOT NULL drop sequence rawinherit_uncle_seq; + +IF OBJECT_ID('evanilla_collection', 'U') IS NOT NULL drop table evanilla_collection; +IF OBJECT_ID('evanilla_collection_seq', 'SO') IS NOT NULL drop sequence evanilla_collection_seq; + +IF OBJECT_ID('evanilla_collection_detail', 'U') IS NOT NULL drop table evanilla_collection_detail; +IF OBJECT_ID('evanilla_collection_detail_seq', 'SO') IS NOT NULL drop sequence evanilla_collection_detail_seq; + +IF OBJECT_ID('ewho_props', 'U') IS NOT NULL drop table ewho_props; +IF OBJECT_ID('ewho_props_seq', 'SO') IS NOT NULL drop sequence ewho_props_seq; + +IF OBJECT_ID('e_withinet', 'U') IS NOT NULL drop table e_withinet; +IF OBJECT_ID('e_withinet_seq', 'SO') IS NOT NULL drop sequence e_withinet_seq; + +IF OBJECT_ID('td_child', 'U') IS NOT NULL drop table td_child; +IF OBJECT_ID('td_child_seq', 'SO') IS NOT NULL drop sequence td_child_seq; + +IF OBJECT_ID('td_parent', 'U') IS NOT NULL drop table td_parent; +IF OBJECT_ID('td_parent_seq', 'SO') IS NOT NULL drop sequence td_parent_seq; + +IF OBJECT_ID('empl', 'U') IS NOT NULL drop table empl; +IF OBJECT_ID('empl_seq', 'SO') IS NOT NULL drop sequence empl_seq; + +IF OBJECT_ID('feature_desc', 'U') IS NOT NULL drop table feature_desc; +IF OBJECT_ID('feature_desc_seq', 'SO') IS NOT NULL drop sequence feature_desc_seq; + +IF OBJECT_ID('f_first', 'U') IS NOT NULL drop table f_first; +IF OBJECT_ID('f_first_seq', 'SO') IS NOT NULL drop sequence f_first_seq; + +IF OBJECT_ID('foo', 'U') IS NOT NULL drop table foo; +IF OBJECT_ID('foo_seq', 'SO') IS NOT NULL drop sequence foo_seq; + +IF OBJECT_ID('gen_key_identity', 'U') IS NOT NULL drop table gen_key_identity; + +IF OBJECT_ID('gen_key_sequence', 'U') IS NOT NULL drop table gen_key_sequence; +IF OBJECT_ID('SEQ', 'SO') IS NOT NULL drop sequence SEQ; + +IF OBJECT_ID('gen_key_table', 'U') IS NOT NULL drop table gen_key_table; +IF OBJECT_ID('gen_key_table_seq', 'SO') IS NOT NULL drop sequence gen_key_table_seq; + +IF OBJECT_ID('grand_parent_person', 'U') IS NOT NULL drop table grand_parent_person; +IF OBJECT_ID('grand_parent_person_seq', 'SO') IS NOT NULL drop sequence grand_parent_person_seq; + +IF OBJECT_ID('survey_group', 'U') IS NOT NULL drop table survey_group; +IF OBJECT_ID('survey_group_seq', 'SO') IS NOT NULL drop sequence survey_group_seq; + +IF OBJECT_ID('c_group', 'U') IS NOT NULL drop table c_group; +IF OBJECT_ID('c_group_seq', 'SO') IS NOT NULL drop sequence c_group_seq; + +IF OBJECT_ID('he_doc', 'U') IS NOT NULL drop table he_doc; +IF OBJECT_ID('he_doc_seq', 'SO') IS NOT NULL drop sequence he_doc_seq; + +IF OBJECT_ID('hx_link', 'U') IS NOT NULL alter table hx_link set (system_versioning = off); +IF OBJECT_ID('hx_link_history', 'U') IS NOT NULL drop table hx_link_history; +IF OBJECT_ID('hx_link', 'U') IS NOT NULL drop table hx_link; +IF OBJECT_ID('hx_link_seq', 'SO') IS NOT NULL drop sequence hx_link_seq; + +IF OBJECT_ID('hx_link_doc', 'U') IS NOT NULL drop table hx_link_doc; + +IF OBJECT_ID('hi_doc', 'U') IS NOT NULL drop table hi_doc; +IF OBJECT_ID('hi_doc_seq', 'SO') IS NOT NULL drop sequence hi_doc_seq; + +IF OBJECT_ID('hi_link', 'U') IS NOT NULL alter table hi_link set (system_versioning = off); +IF OBJECT_ID('hi_link_history', 'U') IS NOT NULL drop table hi_link_history; +IF OBJECT_ID('hi_link', 'U') IS NOT NULL drop table hi_link; +IF OBJECT_ID('hi_link_seq', 'SO') IS NOT NULL drop sequence hi_link_seq; + +IF OBJECT_ID('hi_link_doc', 'U') IS NOT NULL alter table hi_link_doc set (system_versioning = off); +IF OBJECT_ID('hi_link_doc_history', 'U') IS NOT NULL drop table hi_link_doc_history; +IF OBJECT_ID('hi_link_doc', 'U') IS NOT NULL drop table hi_link_doc; + +IF OBJECT_ID('imrelated', 'U') IS NOT NULL drop table imrelated; +IF OBJECT_ID('imrelated_seq', 'SO') IS NOT NULL drop sequence imrelated_seq; + +IF OBJECT_ID('imroot', 'U') IS NOT NULL drop table imroot; +IF OBJECT_ID('imroot_seq', 'SO') IS NOT NULL drop sequence imroot_seq; + +IF OBJECT_ID('ixresource', 'U') IS NOT NULL drop table ixresource; + +IF OBJECT_ID('info_company', 'U') IS NOT NULL drop table info_company; +IF OBJECT_ID('info_company_seq', 'SO') IS NOT NULL drop sequence info_company_seq; + +IF OBJECT_ID('info_contact', 'U') IS NOT NULL drop table info_contact; +IF OBJECT_ID('info_contact_seq', 'SO') IS NOT NULL drop sequence info_contact_seq; + +IF OBJECT_ID('info_customer', 'U') IS NOT NULL drop table info_customer; +IF OBJECT_ID('info_customer_seq', 'SO') IS NOT NULL drop sequence info_customer_seq; + +IF OBJECT_ID('inner_report', 'U') IS NOT NULL drop table inner_report; +IF OBJECT_ID('inner_report_seq', 'SO') IS NOT NULL drop sequence inner_report_seq; + +IF OBJECT_ID('drel_invoice', 'U') IS NOT NULL drop table drel_invoice; +IF OBJECT_ID('drel_invoice_seq', 'SO') IS NOT NULL drop sequence drel_invoice_seq; + +IF OBJECT_ID('item', 'U') IS NOT NULL drop table item; + +IF OBJECT_ID('monkey', 'U') IS NOT NULL drop table monkey; +IF OBJECT_ID('monkey_seq', 'SO') IS NOT NULL drop sequence monkey_seq; + +IF OBJECT_ID('trainer', 'U') IS NOT NULL drop table trainer; +IF OBJECT_ID('trainer_seq', 'SO') IS NOT NULL drop sequence trainer_seq; + +IF OBJECT_ID('trainer_monkey', 'U') IS NOT NULL drop table trainer_monkey; + +IF OBJECT_ID('troop', 'U') IS NOT NULL drop table troop; +IF OBJECT_ID('troop_seq', 'SO') IS NOT NULL drop sequence troop_seq; + +IF OBJECT_ID('troop_monkey', 'U') IS NOT NULL drop table troop_monkey; + +IF OBJECT_ID('l2_cldf_reset_bean', 'U') IS NOT NULL drop table l2_cldf_reset_bean; +IF OBJECT_ID('l2_cldf_reset_bean_seq', 'SO') IS NOT NULL drop sequence l2_cldf_reset_bean_seq; + +IF OBJECT_ID('l2_cldf_reset_bean_child', 'U') IS NOT NULL drop table l2_cldf_reset_bean_child; +IF OBJECT_ID('l2_cldf_reset_bean_child_seq', 'SO') IS NOT NULL drop sequence l2_cldf_reset_bean_child_seq; + +IF OBJECT_ID('level1', 'U') IS NOT NULL drop table level1; +IF OBJECT_ID('level1_seq', 'SO') IS NOT NULL drop sequence level1_seq; + +IF OBJECT_ID('level1_level4', 'U') IS NOT NULL drop table level1_level4; + +IF OBJECT_ID('level1_level2', 'U') IS NOT NULL drop table level1_level2; + +IF OBJECT_ID('level2', 'U') IS NOT NULL drop table level2; +IF OBJECT_ID('level2_seq', 'SO') IS NOT NULL drop sequence level2_seq; + +IF OBJECT_ID('level2_level3', 'U') IS NOT NULL drop table level2_level3; + +IF OBJECT_ID('level3', 'U') IS NOT NULL drop table level3; +IF OBJECT_ID('level3_seq', 'SO') IS NOT NULL drop sequence level3_seq; + +IF OBJECT_ID('level4', 'U') IS NOT NULL drop table level4; +IF OBJECT_ID('level4_seq', 'SO') IS NOT NULL drop sequence level4_seq; + +IF OBJECT_ID('link', 'U') IS NOT NULL alter table link set (system_versioning = off); +IF OBJECT_ID('link_history', 'U') IS NOT NULL drop table link_history; +IF OBJECT_ID('link', 'U') IS NOT NULL drop table link; +IF OBJECT_ID('link_seq', 'SO') IS NOT NULL drop sequence link_seq; + +IF OBJECT_ID('link_draft', 'U') IS NOT NULL drop table link_draft; +IF OBJECT_ID('link_draft_seq', 'SO') IS NOT NULL drop sequence link_draft_seq; + +IF OBJECT_ID('la_attr_value', 'U') IS NOT NULL drop table la_attr_value; +IF OBJECT_ID('la_attr_value_seq', 'SO') IS NOT NULL drop sequence la_attr_value_seq; + +IF OBJECT_ID('la_attr_value_attribute', 'U') IS NOT NULL drop table la_attr_value_attribute; + +IF OBJECT_ID('mmedia', 'U') IS NOT NULL drop table mmedia; +IF OBJECT_ID('mmedia_seq', 'SO') IS NOT NULL drop sequence mmedia_seq; + +IF OBJECT_ID('non_updateprop', 'U') IS NOT NULL drop table non_updateprop; +IF OBJECT_ID('non_updateprop_seq', 'SO') IS NOT NULL drop sequence non_updateprop_seq; + +IF OBJECT_ID('mprinter', 'U') IS NOT NULL drop table mprinter; +IF OBJECT_ID('mprinter_seq', 'SO') IS NOT NULL drop sequence mprinter_seq; + +IF OBJECT_ID('mprinter_state', 'U') IS NOT NULL drop table mprinter_state; +IF OBJECT_ID('mprinter_state_seq', 'SO') IS NOT NULL drop sequence mprinter_state_seq; + +IF OBJECT_ID('mprofile', 'U') IS NOT NULL drop table mprofile; +IF OBJECT_ID('mprofile_seq', 'SO') IS NOT NULL drop sequence mprofile_seq; + +IF OBJECT_ID('mprotected_construct_bean', 'U') IS NOT NULL drop table mprotected_construct_bean; +IF OBJECT_ID('mprotected_construct_bean_seq', 'SO') IS NOT NULL drop sequence mprotected_construct_bean_seq; + +IF OBJECT_ID('mrole', 'U') IS NOT NULL drop table mrole; +IF OBJECT_ID('mrole_seq', 'SO') IS NOT NULL drop sequence mrole_seq; + +IF OBJECT_ID('mrole_muser', 'U') IS NOT NULL drop table mrole_muser; + +IF OBJECT_ID('msome_other', 'U') IS NOT NULL drop table msome_other; +IF OBJECT_ID('msome_other_seq', 'SO') IS NOT NULL drop sequence msome_other_seq; + +IF OBJECT_ID('muser', 'U') IS NOT NULL drop table muser; +IF OBJECT_ID('muser_seq', 'SO') IS NOT NULL drop sequence muser_seq; + +IF OBJECT_ID('muser_type', 'U') IS NOT NULL drop table muser_type; +IF OBJECT_ID('muser_type_seq', 'SO') IS NOT NULL drop sequence muser_type_seq; + +IF OBJECT_ID('mail_box', 'U') IS NOT NULL drop table mail_box; +IF OBJECT_ID('mail_box_seq', 'SO') IS NOT NULL drop sequence mail_box_seq; + +IF OBJECT_ID('mail_user', 'U') IS NOT NULL drop table mail_user; +IF OBJECT_ID('mail_user_seq', 'SO') IS NOT NULL drop sequence mail_user_seq; + +IF OBJECT_ID('mail_user_inbox', 'U') IS NOT NULL drop table mail_user_inbox; + +IF OBJECT_ID('mail_user_outbox', 'U') IS NOT NULL drop table mail_user_outbox; + +IF OBJECT_ID('map_super_actual', 'U') IS NOT NULL drop table map_super_actual; +IF OBJECT_ID('map_super_actual_seq', 'SO') IS NOT NULL drop sequence map_super_actual_seq; + +IF OBJECT_ID('c_message', 'U') IS NOT NULL drop table c_message; +IF OBJECT_ID('c_message_seq', 'SO') IS NOT NULL drop sequence c_message_seq; + +IF OBJECT_ID('mnoc_role', 'U') IS NOT NULL drop table mnoc_role; +IF OBJECT_ID('mnoc_role_seq', 'SO') IS NOT NULL drop sequence mnoc_role_seq; + +IF OBJECT_ID('mnoc_user', 'U') IS NOT NULL drop table mnoc_user; +IF OBJECT_ID('mnoc_user_seq', 'SO') IS NOT NULL drop sequence mnoc_user_seq; + +IF OBJECT_ID('mnoc_user_mnoc_role', 'U') IS NOT NULL drop table mnoc_user_mnoc_role; + +IF OBJECT_ID('mny_a', 'U') IS NOT NULL drop table mny_a; +IF OBJECT_ID('mny_a_seq', 'SO') IS NOT NULL drop sequence mny_a_seq; + +IF OBJECT_ID('mny_b', 'U') IS NOT NULL drop table mny_b; +IF OBJECT_ID('mny_b_seq', 'SO') IS NOT NULL drop sequence mny_b_seq; + +IF OBJECT_ID('mny_b_mny_c', 'U') IS NOT NULL drop table mny_b_mny_c; + +IF OBJECT_ID('mny_c', 'U') IS NOT NULL drop table mny_c; +IF OBJECT_ID('mny_c_seq', 'SO') IS NOT NULL drop sequence mny_c_seq; + +IF OBJECT_ID('mny_topic', 'U') IS NOT NULL drop table mny_topic; +IF OBJECT_ID('mny_topic_seq', 'SO') IS NOT NULL drop sequence mny_topic_seq; + +IF OBJECT_ID('subtopics', 'U') IS NOT NULL drop table subtopics; + +IF OBJECT_ID('mp_role', 'U') IS NOT NULL drop table mp_role; +IF OBJECT_ID('mp_role_seq', 'SO') IS NOT NULL drop sequence mp_role_seq; + +IF OBJECT_ID('mp_user', 'U') IS NOT NULL drop table mp_user; +IF OBJECT_ID('mp_user_seq', 'SO') IS NOT NULL drop sequence mp_user_seq; + +IF OBJECT_ID('ms_many_a', 'U') IS NOT NULL drop table ms_many_a; +IF OBJECT_ID('ms_many_a_seq', 'SO') IS NOT NULL drop sequence ms_many_a_seq; + +IF OBJECT_ID('ms_many_a_many_b', 'U') IS NOT NULL drop table ms_many_a_many_b; + +IF OBJECT_ID('ms_many_b', 'U') IS NOT NULL drop table ms_many_b; +IF OBJECT_ID('ms_many_b_seq', 'SO') IS NOT NULL drop sequence ms_many_b_seq; + +IF OBJECT_ID('ms_many_b_many_a', 'U') IS NOT NULL drop table ms_many_b_many_a; + +IF OBJECT_ID('my_lob_size', 'U') IS NOT NULL drop table my_lob_size; +IF OBJECT_ID('my_lob_size_seq', 'SO') IS NOT NULL drop sequence my_lob_size_seq; + +IF OBJECT_ID('my_lob_size_join_many', 'U') IS NOT NULL drop table my_lob_size_join_many; +IF OBJECT_ID('my_lob_size_join_many_seq', 'SO') IS NOT NULL drop sequence my_lob_size_join_many_seq; + +IF OBJECT_ID('noidbean', 'U') IS NOT NULL drop table noidbean; + +IF OBJECT_ID('o_cached_bean', 'U') IS NOT NULL drop table o_cached_bean; +IF OBJECT_ID('o_cached_bean_seq', 'SO') IS NOT NULL drop sequence o_cached_bean_seq; + +IF OBJECT_ID('o_cached_bean_country', 'U') IS NOT NULL drop table o_cached_bean_country; + +IF OBJECT_ID('o_cached_bean_child', 'U') IS NOT NULL drop table o_cached_bean_child; +IF OBJECT_ID('o_cached_bean_child_seq', 'SO') IS NOT NULL drop sequence o_cached_bean_child_seq; + +IF OBJECT_ID('o_cached_natkey', 'U') IS NOT NULL drop table o_cached_natkey; +IF OBJECT_ID('o_cached_natkey_seq', 'SO') IS NOT NULL drop sequence o_cached_natkey_seq; + +IF OBJECT_ID('o_cached_natkey3', 'U') IS NOT NULL drop table o_cached_natkey3; +IF OBJECT_ID('o_cached_natkey3_seq', 'SO') IS NOT NULL drop sequence o_cached_natkey3_seq; + +IF OBJECT_ID('ocar', 'U') IS NOT NULL drop table ocar; +IF OBJECT_ID('ocar_seq', 'SO') IS NOT NULL drop sequence ocar_seq; + +IF OBJECT_ID('ocompany', 'U') IS NOT NULL drop table ocompany; +IF OBJECT_ID('ocompany_seq', 'SO') IS NOT NULL drop sequence ocompany_seq; + +IF OBJECT_ID('oengine', 'U') IS NOT NULL drop table oengine; + +IF OBJECT_ID('ogear_box', 'U') IS NOT NULL drop table ogear_box; + +IF OBJECT_ID('oroad_show_msg', 'U') IS NOT NULL drop table oroad_show_msg; +IF OBJECT_ID('oroad_show_msg_seq', 'SO') IS NOT NULL drop sequence oroad_show_msg_seq; + +IF OBJECT_ID('om_ordered_detail', 'U') IS NOT NULL drop table om_ordered_detail; +IF OBJECT_ID('om_ordered_detail_seq', 'SO') IS NOT NULL drop sequence om_ordered_detail_seq; + +IF OBJECT_ID('om_ordered_master', 'U') IS NOT NULL drop table om_ordered_master; +IF OBJECT_ID('om_ordered_master_seq', 'SO') IS NOT NULL drop sequence om_ordered_master_seq; + +IF OBJECT_ID('o_order', 'U') IS NOT NULL drop table o_order; +IF OBJECT_ID('o_order_seq', 'SO') IS NOT NULL drop sequence o_order_seq; + +IF OBJECT_ID('o_order_detail', 'U') IS NOT NULL drop table o_order_detail; +IF OBJECT_ID('o_order_detail_seq', 'SO') IS NOT NULL drop sequence o_order_detail_seq; + +IF OBJECT_ID('s_orders', 'U') IS NOT NULL drop table s_orders; + +IF OBJECT_ID('s_order_items', 'U') IS NOT NULL drop table s_order_items; + +IF OBJECT_ID('or_order_ship', 'U') IS NOT NULL drop table or_order_ship; +IF OBJECT_ID('or_order_ship_seq', 'SO') IS NOT NULL drop sequence or_order_ship_seq; + +IF OBJECT_ID('organisation', 'U') IS NOT NULL drop table organisation; +IF OBJECT_ID('organisation_seq', 'SO') IS NOT NULL drop sequence organisation_seq; + +IF OBJECT_ID('oto_bchild', 'U') IS NOT NULL drop table oto_bchild; +IF OBJECT_ID('oto_bchild_seq', 'SO') IS NOT NULL drop sequence oto_bchild_seq; + +IF OBJECT_ID('oto_bmaster', 'U') IS NOT NULL drop table oto_bmaster; +IF OBJECT_ID('oto_bmaster_seq', 'SO') IS NOT NULL drop sequence oto_bmaster_seq; + +IF OBJECT_ID('oto_child', 'U') IS NOT NULL drop table oto_child; +IF OBJECT_ID('oto_child_seq', 'SO') IS NOT NULL drop sequence oto_child_seq; + +IF OBJECT_ID('oto_cust', 'U') IS NOT NULL drop table oto_cust; +IF OBJECT_ID('oto_cust_seq', 'SO') IS NOT NULL drop sequence oto_cust_seq; + +IF OBJECT_ID('oto_cust_address', 'U') IS NOT NULL drop table oto_cust_address; +IF OBJECT_ID('oto_cust_address_seq', 'SO') IS NOT NULL drop sequence oto_cust_address_seq; + +IF OBJECT_ID('oto_master', 'U') IS NOT NULL drop table oto_master; +IF OBJECT_ID('oto_master_seq', 'SO') IS NOT NULL drop sequence oto_master_seq; + +IF OBJECT_ID('oto_prime', 'U') IS NOT NULL drop table oto_prime; +IF OBJECT_ID('oto_prime_seq', 'SO') IS NOT NULL drop sequence oto_prime_seq; + +IF OBJECT_ID('oto_prime_extra', 'U') IS NOT NULL drop table oto_prime_extra; + +IF OBJECT_ID('oto_th_many', 'U') IS NOT NULL drop table oto_th_many; +IF OBJECT_ID('oto_th_many_seq', 'SO') IS NOT NULL drop sequence oto_th_many_seq; + +IF OBJECT_ID('oto_th_one', 'U') IS NOT NULL drop table oto_th_one; +IF OBJECT_ID('oto_th_one_seq', 'SO') IS NOT NULL drop sequence oto_th_one_seq; + +IF OBJECT_ID('oto_th_top', 'U') IS NOT NULL drop table oto_th_top; +IF OBJECT_ID('oto_th_top_seq', 'SO') IS NOT NULL drop sequence oto_th_top_seq; + +IF OBJECT_ID('oto_ubprime', 'U') IS NOT NULL drop table oto_ubprime; + +IF OBJECT_ID('oto_ubprime_extra', 'U') IS NOT NULL drop table oto_ubprime_extra; + +IF OBJECT_ID('oto_uprime', 'U') IS NOT NULL drop table oto_uprime; + +IF OBJECT_ID('oto_uprime_extra', 'U') IS NOT NULL drop table oto_uprime_extra; + +IF OBJECT_ID('pfile', 'U') IS NOT NULL drop table pfile; +IF OBJECT_ID('pfile_seq', 'SO') IS NOT NULL drop sequence pfile_seq; + +IF OBJECT_ID('pfile_content', 'U') IS NOT NULL drop table pfile_content; +IF OBJECT_ID('pfile_content_seq', 'SO') IS NOT NULL drop sequence pfile_content_seq; + +IF OBJECT_ID('paggview', 'U') IS NOT NULL drop table paggview; + +IF OBJECT_ID('pallet_location', 'U') IS NOT NULL drop table pallet_location; +IF OBJECT_ID('pallet_location_seq', 'SO') IS NOT NULL drop sequence pallet_location_seq; + +IF OBJECT_ID('parcel', 'U') IS NOT NULL drop table parcel; +IF OBJECT_ID('parcel_seq', 'SO') IS NOT NULL drop sequence parcel_seq; + +IF OBJECT_ID('parcel_location', 'U') IS NOT NULL drop table parcel_location; +IF OBJECT_ID('parcel_location_seq', 'SO') IS NOT NULL drop sequence parcel_location_seq; + +IF OBJECT_ID('rawinherit_parent', 'U') IS NOT NULL drop table rawinherit_parent; +IF OBJECT_ID('rawinherit_parent_seq', 'SO') IS NOT NULL drop sequence rawinherit_parent_seq; + +IF OBJECT_ID('rawinherit_parent_rawinherit_data', 'U') IS NOT NULL drop table rawinherit_parent_rawinherit_data; + +IF OBJECT_ID('parent_person', 'U') IS NOT NULL drop table parent_person; +IF OBJECT_ID('parent_person_seq', 'SO') IS NOT NULL drop sequence parent_person_seq; + +IF OBJECT_ID('c_participation', 'U') IS NOT NULL drop table c_participation; +IF OBJECT_ID('c_participation_seq', 'SO') IS NOT NULL drop sequence c_participation_seq; + +IF OBJECT_ID('mt_permission', 'U') IS NOT NULL drop table mt_permission; + +IF OBJECT_ID('persistent_file', 'U') IS NOT NULL drop table persistent_file; +IF OBJECT_ID('persistent_file_seq', 'SO') IS NOT NULL drop sequence persistent_file_seq; + +IF OBJECT_ID('persistent_file_content', 'U') IS NOT NULL drop table persistent_file_content; +IF OBJECT_ID('persistent_file_content_seq', 'SO') IS NOT NULL drop sequence persistent_file_content_seq; + +IF OBJECT_ID('persons', 'U') IS NOT NULL drop table persons; +IF OBJECT_ID('PERSONS_seq', 'SO') IS NOT NULL drop sequence PERSONS_seq; + +IF OBJECT_ID('person', 'U') IS NOT NULL drop table person; +IF OBJECT_ID('person_seq', 'SO') IS NOT NULL drop sequence person_seq; + +IF OBJECT_ID('phones', 'U') IS NOT NULL drop table phones; +IF OBJECT_ID('PHONES_seq', 'SO') IS NOT NULL drop sequence PHONES_seq; + +IF OBJECT_ID('primary_revision', 'U') IS NOT NULL drop table primary_revision; + +IF OBJECT_ID('o_product', 'U') IS NOT NULL drop table o_product; +IF OBJECT_ID('o_product_seq', 'SO') IS NOT NULL drop sequence o_product_seq; + +IF OBJECT_ID('pp', 'U') IS NOT NULL drop table pp; + +IF OBJECT_ID('pp_to_ww', 'U') IS NOT NULL drop table pp_to_ww; + +IF OBJECT_ID('question', 'U') IS NOT NULL drop table question; +IF OBJECT_ID('question_seq', 'SO') IS NOT NULL drop sequence question_seq; + +IF OBJECT_ID('rcustomer', 'U') IS NOT NULL drop table rcustomer; + +IF OBJECT_ID('r_orders', 'U') IS NOT NULL drop table r_orders; + +IF OBJECT_ID('region', 'U') IS NOT NULL drop table region; + +IF OBJECT_ID('resourcefile', 'U') IS NOT NULL drop table resourcefile; + +IF OBJECT_ID('em_role', 'U') IS NOT NULL drop table em_role; +IF OBJECT_ID('em_role_seq', 'SO') IS NOT NULL drop sequence em_role_seq; + +IF OBJECT_ID('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('f_second', 'U') IS NOT NULL drop table f_second; +IF OBJECT_ID('f_second_seq', 'SO') IS NOT NULL drop sequence f_second_seq; + +IF OBJECT_ID('section', 'U') IS NOT NULL drop table section; +IF OBJECT_ID('section_seq', 'SO') IS NOT NULL drop sequence section_seq; + +IF OBJECT_ID('self_parent', 'U') IS NOT NULL drop table self_parent; +IF OBJECT_ID('self_parent_seq', 'SO') IS NOT NULL drop sequence self_parent_seq; + +IF OBJECT_ID('self_ref_customer', 'U') IS NOT NULL drop table self_ref_customer; +IF OBJECT_ID('self_ref_customer_seq', 'SO') IS NOT NULL drop sequence self_ref_customer_seq; + +IF OBJECT_ID('self_ref_example', 'U') IS NOT NULL drop table self_ref_example; +IF OBJECT_ID('self_ref_example_seq', 'SO') IS NOT NULL drop sequence self_ref_example_seq; + +IF OBJECT_ID('some_enum_bean', 'U') IS NOT NULL drop table some_enum_bean; +IF OBJECT_ID('some_enum_bean_seq', 'SO') IS NOT NULL drop sequence some_enum_bean_seq; + +IF OBJECT_ID('some_file_bean', 'U') IS NOT NULL drop table some_file_bean; +IF OBJECT_ID('some_file_bean_seq', 'SO') IS NOT NULL drop sequence some_file_bean_seq; + +IF OBJECT_ID('some_new_types_bean', 'U') IS NOT NULL drop table some_new_types_bean; +IF OBJECT_ID('some_new_types_bean_seq', 'SO') IS NOT NULL drop sequence some_new_types_bean_seq; + +IF OBJECT_ID('some_period_bean', 'U') IS NOT NULL drop table some_period_bean; +IF OBJECT_ID('some_period_bean_seq', 'SO') IS NOT NULL drop sequence some_period_bean_seq; + +IF OBJECT_ID('stockforecast', 'U') IS NOT NULL drop table stockforecast; +IF OBJECT_ID('stockforecast_seq', 'SO') IS NOT NULL drop sequence stockforecast_seq; + +IF OBJECT_ID('sub_section', 'U') IS NOT NULL drop table sub_section; +IF OBJECT_ID('sub_section_seq', 'SO') IS NOT NULL drop sequence sub_section_seq; + +IF OBJECT_ID('sub_type', 'U') IS NOT NULL drop table sub_type; +IF OBJECT_ID('sub_type_seq', 'SO') IS NOT NULL drop sequence sub_type_seq; + +IF OBJECT_ID('survey', 'U') IS NOT NULL drop table survey; +IF OBJECT_ID('survey_seq', 'SO') IS NOT NULL drop sequence survey_seq; + +IF OBJECT_ID('tbytes_only', 'U') IS NOT NULL drop table tbytes_only; +IF OBJECT_ID('tbytes_only_seq', 'SO') IS NOT NULL drop sequence tbytes_only_seq; + +IF OBJECT_ID('tcar', 'U') IS NOT NULL drop table tcar; + +IF OBJECT_ID('tevent', 'U') IS NOT NULL drop table tevent; +IF OBJECT_ID('tevent_seq', 'SO') IS NOT NULL drop sequence tevent_seq; + +IF OBJECT_ID('tevent_many', 'U') IS NOT NULL drop table tevent_many; +IF OBJECT_ID('tevent_many_seq', 'SO') IS NOT NULL drop sequence tevent_many_seq; + +IF OBJECT_ID('tevent_one', 'U') IS NOT NULL drop table tevent_one; +IF OBJECT_ID('tevent_one_seq', 'SO') IS NOT NULL drop sequence tevent_one_seq; + +IF OBJECT_ID('tint_root', 'U') IS NOT NULL drop table tint_root; +IF OBJECT_ID('tint_root_seq', 'SO') IS NOT NULL drop sequence tint_root_seq; + +IF OBJECT_ID('tjoda_entity', 'U') IS NOT NULL drop table tjoda_entity; +IF OBJECT_ID('tjoda_entity_seq', 'SO') IS NOT NULL drop sequence tjoda_entity_seq; + +IF OBJECT_ID('t_mapsuper1', 'U') IS NOT NULL drop table t_mapsuper1; +IF OBJECT_ID('t_mapsuper1_seq', 'SO') IS NOT NULL drop sequence t_mapsuper1_seq; + +IF OBJECT_ID('t_oneb', 'U') IS NOT NULL drop table t_oneb; +IF OBJECT_ID('t_oneb_seq', 'SO') IS NOT NULL drop sequence t_oneb_seq; + +IF OBJECT_ID('t_detail_with_other_namexxxyy', 'U') IS NOT NULL drop table t_detail_with_other_namexxxyy; +IF OBJECT_ID('t_atable_detail_seq', 'SO') IS NOT NULL drop sequence t_atable_detail_seq; + +IF OBJECT_ID('ts_detail_two', 'U') IS NOT NULL drop table ts_detail_two; +IF OBJECT_ID('ts_detail_two_seq', 'SO') IS NOT NULL drop sequence ts_detail_two_seq; + +IF OBJECT_ID('t_atable_thatisrelatively', 'U') IS NOT NULL drop table t_atable_thatisrelatively; +IF OBJECT_ID('t_atable_master_seq', 'SO') IS NOT NULL drop sequence t_atable_master_seq; + +IF OBJECT_ID('ts_master_two', 'U') IS NOT NULL drop table ts_master_two; +IF OBJECT_ID('ts_master_two_seq', 'SO') IS NOT NULL drop sequence ts_master_two_seq; + +IF OBJECT_ID('tuuid_entity', 'U') IS NOT NULL drop table tuuid_entity; + +IF OBJECT_ID('twheel', 'U') IS NOT NULL drop table twheel; +IF OBJECT_ID('twheel_seq', 'SO') IS NOT NULL drop sequence twheel_seq; + +IF OBJECT_ID('twith_pre_insert', 'U') IS NOT NULL drop table twith_pre_insert; +IF OBJECT_ID('twith_pre_insert_seq', 'SO') IS NOT NULL drop sequence twith_pre_insert_seq; + +IF OBJECT_ID('mt_tenant', 'U') IS NOT NULL drop table mt_tenant; + +IF OBJECT_ID('test_annotation_base_entity', 'U') IS NOT NULL drop table test_annotation_base_entity; + +IF OBJECT_ID('tire', 'U') IS NOT NULL drop table tire; +IF OBJECT_ID('tire_seq', 'SO') IS NOT NULL drop sequence tire_seq; + +IF OBJECT_ID('sa_tire', 'U') IS NOT NULL drop table sa_tire; +IF OBJECT_ID('sa_tire_seq', 'SO') IS NOT NULL drop sequence sa_tire_seq; + +IF OBJECT_ID('trip', 'U') IS NOT NULL drop table trip; +IF OBJECT_ID('trip_seq', 'SO') IS NOT NULL drop sequence trip_seq; + +IF OBJECT_ID('truck_ref', 'U') IS NOT NULL drop table truck_ref; +IF OBJECT_ID('truck_ref_seq', 'SO') IS NOT NULL drop sequence truck_ref_seq; + +IF OBJECT_ID('type', 'U') IS NOT NULL drop table type; + +IF OBJECT_ID('tz_bean', 'U') IS NOT NULL drop table tz_bean; +IF OBJECT_ID('tz_bean_seq', 'SO') IS NOT NULL drop sequence tz_bean_seq; + +IF OBJECT_ID('ut_detail', 'U') IS NOT NULL drop table ut_detail; +IF OBJECT_ID('ut_detail_seq', 'SO') IS NOT NULL drop sequence ut_detail_seq; + +IF OBJECT_ID('ut_master', 'U') IS NOT NULL drop table ut_master; +IF OBJECT_ID('ut_master_seq', 'SO') IS NOT NULL drop sequence ut_master_seq; + +IF OBJECT_ID('uuone', 'U') IS NOT NULL drop table uuone; + +IF OBJECT_ID('uutwo', 'U') IS NOT NULL drop table uutwo; + +IF OBJECT_ID('c_user', 'U') IS NOT NULL alter table c_user set (system_versioning = off); +IF OBJECT_ID('c_user_history', 'U') IS NOT NULL drop table c_user_history; +IF OBJECT_ID('c_user', 'U') IS NOT NULL drop table c_user; +IF OBJECT_ID('c_user_seq', 'SO') IS NOT NULL drop sequence c_user_seq; + +IF OBJECT_ID('tx_user', 'U') IS NOT NULL drop table tx_user; +IF OBJECT_ID('tx_user_seq', 'SO') IS NOT NULL drop sequence tx_user_seq; + +IF OBJECT_ID('g_user', 'U') IS NOT NULL drop table g_user; +IF OBJECT_ID('g_user_seq', 'SO') IS NOT NULL drop sequence g_user_seq; + +IF OBJECT_ID('em_user', 'U') IS NOT NULL drop table em_user; +IF OBJECT_ID('em_user_seq', 'SO') IS NOT NULL drop sequence em_user_seq; + +IF OBJECT_ID('oto_user', 'U') IS NOT NULL drop table oto_user; +IF OBJECT_ID('oto_user_seq', 'SO') IS NOT NULL drop sequence oto_user_seq; + +IF OBJECT_ID('em_user_role', 'U') IS NOT NULL drop table em_user_role; + +IF OBJECT_ID('vehicle', 'U') IS NOT NULL drop table vehicle; +IF OBJECT_ID('vehicle_seq', 'SO') IS NOT NULL drop sequence vehicle_seq; + +IF OBJECT_ID('vehicle_driver', 'U') IS NOT NULL drop table vehicle_driver; +IF OBJECT_ID('vehicle_driver_seq', 'SO') IS NOT NULL drop sequence vehicle_driver_seq; + +IF OBJECT_ID('warehouses', 'U') IS NOT NULL drop table warehouses; +IF OBJECT_ID('warehouses_seq', 'SO') IS NOT NULL drop sequence warehouses_seq; + +IF OBJECT_ID('warehousesshippingzones', 'U') IS NOT NULL drop table warehousesshippingzones; + +IF OBJECT_ID('sa_wheel', 'U') IS NOT NULL drop table sa_wheel; +IF OBJECT_ID('sa_wheel_seq', 'SO') IS NOT NULL drop sequence sa_wheel_seq; + +IF OBJECT_ID('wheel', 'U') IS NOT NULL drop table wheel; +IF OBJECT_ID('wheel_seq', 'SO') IS NOT NULL drop sequence wheel_seq; + +IF OBJECT_ID('sp_car_wheel', 'U') IS NOT NULL drop table sp_car_wheel; +IF OBJECT_ID('sp_car_wheel_seq', 'SO') IS NOT NULL drop sequence sp_car_wheel_seq; + +IF OBJECT_ID('g_who_props_otm', 'U') IS NOT NULL drop table g_who_props_otm; +IF OBJECT_ID('g_who_props_otm_seq', 'SO') IS NOT NULL drop sequence g_who_props_otm_seq; + +IF OBJECT_ID('with_zero', 'U') IS NOT NULL drop table with_zero; +IF OBJECT_ID('with_zero_seq', 'SO') IS NOT NULL drop sequence with_zero_seq; + +IF OBJECT_ID('parent', 'U') IS NOT NULL drop table parent; +IF OBJECT_ID('parent_seq', 'SO') IS NOT NULL drop sequence parent_seq; + +IF OBJECT_ID('wview', 'U') IS NOT NULL drop table wview; + +IF OBJECT_ID('zones', 'U') IS NOT NULL drop table zones; +IF OBJECT_ID('zones_seq', 'SO') IS NOT NULL drop sequence zones_seq; + +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('contact','U') AND name = 'ix_contact_last_name_first_name') drop index ix_contact_last_name_first_name ON contact; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('e_basic','U') AND name = 'ix_e_basic_name') drop index ix_e_basic_name ON e_basic;