From eacc4b907d1bafcf56975d8eb3b7f1c673c58f86 Mon Sep 17 00:00:00 2001 From: rbygrave Date: Sun, 22 Aug 2021 15:55:45 +1200 Subject: [PATCH] Update ddl review only - for #2326 --- .../src/test/ddl-review/h2-create-all.sql | 8 +- .../src/test/ddl-review/h2-drop-all.sql | 2 +- .../test/ddl-review/sqlserver-create-all.sql | 597 +++++++++++++++++- .../test/ddl-review/sqlserver-drop-all.sql | 258 +++++++- 4 files changed, 828 insertions(+), 37 deletions(-) diff --git a/ebean-core/src/test/ddl-review/h2-create-all.sql b/ebean-core/src/test/ddl-review/h2-create-all.sql index d6cc91a8f..ab1dff363 100644 --- a/ebean-core/src/test/ddl-review/h2-create-all.sql +++ b/ebean-core/src/test/ddl-review/h2-create-all.sql @@ -1,4 +1,4 @@ --- Generated by ebean unknown at 2021-08-20T21:43:22.648422335Z +-- Generated by ebean unknown at 2021-08-22T03:33:37.079509Z create table asimple_bean ( id bigint generated by default as identity not null, name varchar(255), @@ -215,7 +215,8 @@ create table bsite_user_d ( user_id uuid not null, access_level integer, version bigint not null, - constraint ck_bsite_user_d_access_level check ( access_level in (0,1,2)) + constraint ck_bsite_user_d_access_level check ( access_level in (0,1,2)), + constraint pk_bsite_user_d primary key (site_id,user_id) ); create table bsite_user_dmany ( @@ -223,7 +224,8 @@ create table bsite_user_dmany ( user_id uuid not null, name varchar(255) not null, many varchar(255), - version bigint not null + version bigint not null, + constraint pk_bsite_user_dmany primary key (site_id,user_id,name) ); create table bsite_user_e ( diff --git a/ebean-core/src/test/ddl-review/h2-drop-all.sql b/ebean-core/src/test/ddl-review/h2-drop-all.sql index 195cc29c0..bc3915d07 100644 --- a/ebean-core/src/test/ddl-review/h2-drop-all.sql +++ b/ebean-core/src/test/ddl-review/h2-drop-all.sql @@ -1,4 +1,4 @@ --- Generated by ebean unknown at 2021-08-20T21:43:22.648422335Z +-- Generated by ebean unknown at 2021-08-22T03:33:37.079509Z alter table bar drop constraint if exists fk_bar_foo_id; drop index if exists ix_bar_foo_id; diff --git a/ebean-core/src/test/ddl-review/sqlserver-create-all.sql b/ebean-core/src/test/ddl-review/sqlserver-create-all.sql index 40e48e28e..554e79f2c 100644 --- a/ebean-core/src/test/ddl-review/sqlserver-create-all.sql +++ b/ebean-core/src/test/ddl-review/sqlserver-create-all.sql @@ -1,4 +1,4 @@ --- Generated by ebean unknown at 2020-03-04T08:21:26.827349Z +-- Generated by ebean unknown at 2021-08-22T03:36:08.393487Z -- init script create procs -- Initial script to create stored procedures etc for sqlserver platform @@ -226,6 +226,20 @@ create table animal_shelter ( ); create sequence animal_shelter_seq as bigint start with 1 increment by 50; +create table app_config ( + id integer not null, + constraint pk_app_config primary key (id) +); +create sequence app_config_seq as bigint start with 1 increment by 50; + +create table app_config_control ( + id integer not null, + name nvarchar(255), + config_id integer, + constraint pk_app_config_control primary key (id) +); +create sequence app_config_control_seq as bigint start with 1 increment by 50; + create table article ( id integer not null, name nvarchar(255), @@ -334,7 +348,17 @@ create table bsite_user_d ( user_id uniqueidentifier not null, access_level integer, version numeric(19) not null, - constraint ck_bsite_user_d_access_level check ( access_level in (0,1,2)) + constraint ck_bsite_user_d_access_level check ( access_level in (0,1,2)), + constraint pk_bsite_user_d primary key (site_id,user_id) +); + +create table bsite_user_dmany ( + site_id uniqueidentifier not null, + user_id uniqueidentifier not null, + name nvarchar(255) not null, + many nvarchar(255), + version numeric(19) not null, + constraint pk_bsite_user_dmany primary key (site_id,user_id,name) ); create table bsite_user_e ( @@ -446,6 +470,31 @@ create table cepproduct_category ( priority integer ); +create table ciaddress ( + id numeric(19) not null, + street_id numeric(19), + constraint pk_ciaddress primary key (id) +); +create sequence ciaddress_seq as bigint start with 1 increment by 50; + +create table cicustomer_parent ( + dtype integer not null, + id numeric(19) not null, + address_id numeric(19), + notes nvarchar(255), + constraint pk_cicustomer_parent primary key (id) +); +create sequence cicustomer_parent_seq as bigint start with 1 increment by 50; + +create table cistreet_parent ( + dtype integer not null, + id numeric(19) not null, + name nvarchar(255), + num nvarchar(255), + constraint pk_cistreet_parent primary key (id) +); +create sequence cistreet_parent_seq as bigint start with 1 increment by 50; + create table cinh_ref ( id integer not null, ref_id integer, @@ -520,6 +569,20 @@ create table coroot ( create unique nonclustered index uq_coroot_one_id on coroot(one_id) where one_id is not null; create sequence coroot_seq as bigint start with 1 increment by 50; +create table calcd_data ( + id integer not null, + name nvarchar(255), + constraint pk_calcd_data primary key (id) +); +create sequence calcd_data_seq as bigint start with 1 increment by 50; + +create table calcd_input ( + id integer not null, + name nvarchar(255), + constraint pk_calcd_input primary key (id) +); +create sequence calcd_input_seq as bigint start with 1 increment by 50; + create table calculation_result ( id integer not null, charge float(32) not null, @@ -616,6 +679,14 @@ create table child_person ( ); create sequence child_person_seq as bigint start with 1 increment by 50; +create table child_with_cache ( + id numeric(19) not null, + name nvarchar(255), + address nvarchar(255), + constraint pk_child_with_cache primary key (id) +); +create sequence child_with_cache_seq as bigint start with 1 increment by 50; + create table cke_client ( cod_cpny integer not null, cod_client nvarchar(100) not null, @@ -804,7 +875,7 @@ create table d_machine_aux_use ( name nvarchar(255), edate date, use_secs numeric(19) not null, - fuel numeric(28), + fuel numeric(16,3), version numeric(19) not null, constraint pk_d_machine_aux_use primary key (id) ); @@ -816,8 +887,8 @@ create table d_machine_stats ( edate date, total_kms numeric(19) not null, hours numeric(19) not null, - rate numeric(28), - cost numeric(28), + rate numeric(16,3), + cost numeric(16,3), version numeric(19) not null, constraint pk_d_machine_stats primary key (id) ); @@ -829,7 +900,7 @@ create table d_machine_use ( edate date, distance_kms numeric(19) not null, time_secs numeric(19) not null, - fuel numeric(28), + fuel numeric(9,3), version numeric(19) not null, constraint pk_d_machine_use primary key (id) ); @@ -847,7 +918,7 @@ create table dperson ( id numeric(19) not null, first_name nvarchar(255), last_name nvarchar(255), - salary numeric(28), + salary numeric(16,3), constraint pk_dperson primary key (id) ); create sequence dperson_seq as bigint start with 1 increment by 50; @@ -902,6 +973,18 @@ create table dc_master ( ); create sequence dc_master_seq as bigint start with 1 increment by 50; +create table defaults_model ( + id integer not null, + constraint pk_defaults_model primary key (id) +); +create sequence defaults_model_seq as bigint start with 1 increment by 50; + +create table defaults_model_draft ( + id integer not null, + constraint pk_defaults_model_draft primary key (id) +); +create sequence defaults_model_draft_seq as bigint start with 1 increment by 50; + create table dfk_cascade ( id numeric(19) not null, name nvarchar(255), @@ -1077,6 +1160,7 @@ create table earray_set_bean ( uids varchar(1000), other_ids varchar(1000), doubs varchar(1000), + status varchar(1000), version numeric(19) not null, constraint pk_earray_set_bean primary key (id) ); @@ -1098,6 +1182,7 @@ create table ebasic_change_log ( name nvarchar(20), short_description nvarchar(50), long_description nvarchar(100), + plain_bean nvarchar(500), who_created nvarchar(255) not null, who_modified nvarchar(255) not null, when_created datetime2 not null, @@ -1139,7 +1224,7 @@ create table e_basicenc ( id integer not null, name nvarchar(255), description varbinary(80), - dob varbinary(20), + dob varbinary(80), status varbinary(20), last_update datetime2, constraint pk_e_basicenc primary key (id) @@ -1228,10 +1313,21 @@ create table ebasic_json_jackson2 ( ); create sequence ebasic_json_jackson2_seq as bigint start with 1 increment by 50; +create table ebasic_json_jackson3 ( + id numeric(19) not null, + name nvarchar(255), + plain_value nvarchar(500), + plain_value2 nvarchar(500), + plain_value3 nvarchar(500), + version numeric(19) not null, + constraint pk_ebasic_json_jackson3 primary key (id) +); +create sequence ebasic_json_jackson3_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), + beans nvarchar(700), bean_list nvarchar(max), bean_map nvarchar(700), plain_bean nvarchar(500), @@ -1297,6 +1393,17 @@ create table ebasic_json_map_varchar ( ); create sequence ebasic_json_map_varchar_seq as bigint start with 1 increment by 50; +create table ebasic_json_multi ( + id numeric(19) not null, + name nvarchar(255), + plain_value1 nvarchar(500), + plain_value2 nvarchar(500), + plain_value3 nvarchar(500), + version numeric(19) not null, + constraint pk_ebasic_json_multi primary key (id) +); +create sequence ebasic_json_multi_seq as bigint start with 1 increment by 50; + create table ebasic_json_node ( id numeric(19) not null, name nvarchar(255), @@ -1341,6 +1448,13 @@ create table ebasic_json_unmapped ( ); create sequence ebasic_json_unmapped_seq as bigint start with 1 increment by 50; +create table e_basic_log ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_e_basic_log primary key (id) +); +create sequence e_basic_log_seq as bigint start with 1 increment by 50; + create table e_basic_ndc ( id integer not null, name nvarchar(255), @@ -1358,6 +1472,34 @@ create table ebasic_no_sdchild ( ); create sequence ebasic_no_sdchild_seq as bigint start with 1 increment by 50; +create table ebasic_old_value ( + id numeric(19) not null, + name nvarchar(255), + string_set nvarchar(max), + long_set nvarchar(max), + int_set nvarchar(max), + string_list nvarchar(max), + long_list nvarchar(max), + int_list nvarchar(max), + object_map nvarchar(max), + long_map nvarchar(max), + int_map nvarchar(max), + json_node nvarchar(max), + string_arr varchar(1000), + constraint pk_ebasic_old_value primary key (id) +); +create sequence ebasic_old_value_seq as bigint start with 1 increment by 50; + +create table ebasic_plain ( + id numeric(19) not null, + attr nvarchar(255), + plain_bean nvarchar(500), + plain_bean2 nvarchar(500), + version numeric(19) not null, + constraint pk_ebasic_plain primary key (id) +); +create sequence ebasic_plain_seq as bigint start with 1 increment by 50; + create table ebasic_sdchild ( id numeric(19) not null, owner_id numeric(19) not null, @@ -1407,6 +1549,15 @@ create table e_basic_with_ex ( ); create sequence e_basic_with_ex_seq as bigint start with 1 increment by 50; +create table e_basic_withlog ( + id numeric(19) not null, + name nvarchar(255), + deleted integer default 0 not null, + version numeric(19) not null, + constraint pk_e_basic_withlog primary key (id) +); +create sequence e_basic_withlog_seq as bigint start with 1 increment by 50; + create table e_basicverucon ( id integer not null, name nvarchar(127), @@ -1540,10 +1691,14 @@ create table einvoice ( ship_suburb nvarchar(255), ship_city nvarchar(255), ship_status nvarchar(3), + ship_jbean nvarchar(max), + ship_jraw nvarchar(max), bill_street nvarchar(255), bill_suburb nvarchar(255), bill_city nvarchar(255), bill_status nvarchar(3), + bill_jbean nvarchar(max), + bill_jraw nvarchar(max), 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')), @@ -1628,12 +1783,45 @@ create table eperson ( suburb nvarchar(255), addr_city nvarchar(255), addr_status nvarchar(3), + addr_jbean nvarchar(max), + jraw nvarchar(max), 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 eperson2 ( + id numeric(19) not null, + name nvarchar(255), + notes nvarchar(255), + street nvarchar(10), + suburb nvarchar(100), + city nvarchar(255), + status nvarchar(3), + jbean nvarchar(max), + jraw nvarchar(max), + version numeric(19) not null, + constraint ck_eperson2_status check ( status in ('ONE','TWO')), + constraint pk_eperson2 primary key (id) +); +create sequence eperson2_seq as bigint start with 1 increment by 50; + +create table eperson3 ( + id numeric(19) not null, + name nvarchar(255), + street nvarchar(255), + suburb nvarchar(255), + city nvarchar(255), + status nvarchar(3), + jbean nvarchar(max), + jraw nvarchar(max), + version numeric(19) not null, + constraint ck_eperson3_status check ( status in ('ONE','TWO')), + constraint pk_eperson3 primary key (id) +); +create sequence eperson3_seq as bigint start with 1 increment by 50; + create table e_person_online ( id numeric(19) not null, email nvarchar(127), @@ -1754,10 +1942,35 @@ create table esoft_del_user_esoft_del_role ( constraint pk_esoft_del_user_esoft_del_role primary key (esoft_del_user_id,esoft_del_role_id) ); +create table esoft_del_x ( + id uniqueidentifier not null, + y_id numeric(19), + organization_id numeric(19), + deleted integer default 0 not null, + constraint pk_esoft_del_x primary key (id) +); +create unique nonclustered index uq_esoft_del_x_y_id on esoft_del_x(y_id) where y_id is not null; + +create table esoft_del_y ( + id numeric(19) not null, + organization_id numeric(19), + deleted integer default 0 not null, + constraint pk_esoft_del_y primary key (id) +); +create sequence esoft_del_y_seq as bigint start with 1 increment by 50; + +create table esoft_del_z ( + id numeric(19) not null, + uuid uniqueidentifier, + deleted integer default 0 not null, + constraint pk_esoft_del_z primary key (id) +); +create sequence esoft_del_z_seq as bigint start with 1 increment by 50; + create table esome_convert_type ( id numeric(19) not null, name nvarchar(255), - money numeric(28), + money numeric(16,3), constraint pk_esome_convert_type primary key (id) ); create sequence esome_convert_type_seq as bigint start with 1 increment by 50; @@ -2075,14 +2288,7 @@ create table gen_key_sequence ( description nvarchar(255), constraint pk_gen_key_sequence primary key (id) ); -create sequence gen_key_sequence_seq as bigint start with 1 increment by 50; - -create table gen_key_table ( - id numeric(19) not null, - description nvarchar(255), - constraint pk_gen_key_table primary key (id) -); -create sequence gen_key_table_seq as bigint start with 1 increment by 50; +create sequence SEQ_NAME as bigint start with 1 increment by 50; create table grand_parent_person ( identifier integer not null, @@ -2115,6 +2321,15 @@ create table c_group ( ); create sequence c_group_seq as bigint start with 1 increment by 50; +create table hembi_bean ( + part numeric(19) not null, + brand nvarchar(20) not null, + name nvarchar(255), + description nvarchar(255), + version numeric(19) not null, + constraint pk_hembi_bean primary key (part,brand) +); + create table he_doc ( id numeric(19) not null, name nvarchar(255), @@ -2497,6 +2712,31 @@ create table looney ( ); create sequence looney_seq as bigint start with 1 increment by 50; +create table m2_mcache_child ( + id integer not null, + name nvarchar(255), + constraint pk_m2_mcache_child primary key (id) +); +create sequence m2_mcache_child_seq as bigint start with 1 increment by 50; + +create table m2_mcache_master ( + id integer not null, + constraint pk_m2_mcache_master primary key (id) +); +create sequence m2_mcache_master_seq as bigint start with 1 increment by 50; + +create table m2mcache_set1 ( + m2_mcache_master_id integer not null, + m2_mcache_child_id integer not null, + constraint pk_m2mcache_set1 primary key (m2_mcache_master_id,m2_mcache_child_id) +); + +create table m2mcache_set2 ( + m2_mcache_master_id integer not null, + m2_mcache_child_id integer not null, + constraint pk_m2mcache_set2 primary key (m2_mcache_master_id,m2_mcache_child_id) +); + create table maddress ( id uniqueidentifier not null, street nvarchar(255), @@ -2812,6 +3052,24 @@ create table mny_c ( ); create sequence mny_c_seq as bigint start with 1 increment by 50; +create table mny_edge ( + id integer not null, + from_id integer, + to_id integer, + flags integer not null, + constraint pk_mny_edge primary key (id) +); +create unique nonclustered index uq_mny_edge_from_id_to_id on mny_edge(from_id,to_id) where from_id is not null and to_id is not null; +create unique nonclustered index uq_mny_edge_to_id_from_id on mny_edge(to_id,from_id) where to_id is not null and from_id is not null; +create sequence mny_edge_seq as bigint start with 1 increment by 50; + +create table mny_node ( + id integer not null, + name nvarchar(255), + constraint pk_mny_node primary key (id) +); +create sequence mny_node_seq as bigint start with 1 increment by 50; + create table mny_topic ( id numeric(19) not null, name nvarchar(255), @@ -3076,6 +3334,22 @@ create table om_basic_parent ( ); create sequence om_basic_parent_seq as bigint start with 1 increment by 50; +create table om_bean_list_child ( + id numeric(19) not null, + name nvarchar(255), + parent_id numeric(19), + version numeric(19) not null, + constraint pk_om_bean_list_child primary key (id) +); +create sequence om_bean_list_child_seq as bigint start with 1 increment by 50; + +create table om_bean_list_parent ( + id numeric(19) not null, + version numeric(19) not null, + constraint pk_om_bean_list_parent primary key (id) +); +create sequence om_bean_list_parent_seq as bigint start with 1 increment by 50; + create table om_ordered_detail ( id numeric(19) not null, name nvarchar(255), @@ -3094,6 +3368,26 @@ create table om_ordered_master ( ); create sequence om_ordered_master_seq as bigint start with 1 increment by 50; +create table oml_bar ( + id numeric(19) not null, + constraint pk_oml_bar primary key (id) +); +create sequence oml_bar_seq as bigint start with 1 increment by 50; + +create table oml_baz ( + id numeric(19) not null, + foo_id numeric(19) not null, + constraint pk_oml_baz primary key (id) +); +create sequence oml_baz_seq as bigint start with 1 increment by 50; + +create table oml_foo ( + id numeric(19) not null, + bar_id numeric(19) not null, + constraint pk_oml_foo primary key (id) +); +create sequence oml_foo_seq as bigint start with 1 increment by 50; + create table only_id_entity ( id numeric(19) not null, constraint pk_only_id_entity primary key (id) @@ -3136,10 +3430,33 @@ create table s_order_items ( product_variant_uuid nvarchar(255), order_uuid nvarchar(40), quantity integer not null, - amount numeric(28), + amount numeric(16,3), constraint pk_s_order_items primary key (uuid) ); +create table order_master ( + id numeric(19) not null, + constraint pk_order_master primary key (id) +); +create sequence order_master_seq as bigint start with 1 increment by 50; + +create table order_master_inheritance ( + id integer not null, + constraint pk_order_master_inheritance primary key (id) +); +create sequence order_master_inheritance_seq as bigint start with 1 increment by 50; + +create table order_referenced_parent ( + type nvarchar(31) not null, + id numeric(19) not null, + name nvarchar(255), + child_name nvarchar(255), + master_id numeric(19), + sort_order integer, + constraint pk_order_referenced_parent primary key (id) +); +create sequence order_referenced_parent_seq as bigint start with 1 increment by 50; + create table or_order_ship ( id integer not null, order_id integer, @@ -3151,6 +3468,27 @@ create table or_order_ship ( ); create sequence or_order_ship_seq as bigint start with 1 increment by 50; +create table order_toy ( + id integer not null, + title nvarchar(255), + child_id numeric(19), + sort_order integer, + constraint pk_order_toy primary key (id) +); +create sequence order_toy_seq as bigint start with 1 increment by 50; + +create table ordered_parent ( + dtype nvarchar(31) not null, + id integer not null, + order_master_inheritance_id integer not null, + common_name nvarchar(255), + sort_order integer, + ordered_aname nvarchar(255), + ordered_bname nvarchar(255), + constraint pk_ordered_parent primary key (id) +); +create sequence ordered_parent_seq as bigint start with 1 increment by 50; + create table organisation ( id numeric(19) not null, name nvarchar(255), @@ -3493,6 +3831,21 @@ create table e_save_test_c ( ); create sequence e_save_test_c_seq as bigint start with 1 increment by 50; +create table parent_a ( + id numeric(19) not null, + child_id numeric(19), + name nvarchar(255), + constraint pk_parent_a primary key (id) +); +create sequence parent_a_seq as bigint start with 1 increment by 50; + +create table parent_b ( + id numeric(19) not null, + child_id numeric(19), + constraint pk_parent_b primary key (id) +); +create sequence parent_b_seq as bigint start with 1 increment by 50; + create table parent_person ( identifier integer not null, name nvarchar(255), @@ -3636,6 +3989,25 @@ create table person_cache_info ( constraint pk_person_cache_info primary key (person_id) ); +create table person_other ( + id nvarchar(128) not null, + email nvarchar(255), + when_created datetime2 not null, + when_modified datetime2 not null, + version numeric(19) not null, + constraint pk_person_other primary key (id) +); + +create table persona ( + id numeric(19) not null, + persona nvarchar(255), + person_oid numeric(19), + version integer not null, + constraint pk_persona primary key (id) +); +create unique nonclustered index uq_persona_person_oid on persona(person_oid) where person_oid is not null; +create sequence persona_seq as bigint start with 1 increment by 50; + create table phones ( id numeric(19) not null, phone_number nvarchar(7) not null, @@ -3708,6 +4080,22 @@ create table r_orders ( constraint pk_r_orders primary key (company,order_number) ); +create table referenced_defaults_model ( + id integer not null, + defaults_model_id integer not null, + name nvarchar(255), + constraint pk_referenced_defaults_model primary key (id) +); +create sequence referenced_defaults_model_seq as bigint start with 1 increment by 50; + +create table referenced_defaults_model_draft ( + id integer not null, + defaults_model_id integer not null, + name nvarchar(255), + constraint pk_referenced_defaults_model_draft primary key (id) +); +create sequence referenced_defaults_model_draft_seq as bigint start with 1 increment by 50; + create table referencing_bean ( id uniqueidentifier not null, constraint pk_referencing_bean primary key (id) @@ -3738,6 +4126,13 @@ create table rel_master ( ); create sequence rel_master_seq as bigint start with 1 increment by 50; +create table app_config_re ( + id integer not null, + config_id integer, + constraint pk_app_config_re primary key (id) +); +create sequence app_config_re_seq as bigint start with 1 increment by 50; + create table resourcefile ( id nvarchar(64) not null, parentresourcefileid nvarchar(64), @@ -3797,6 +4192,19 @@ create table section ( ); create sequence section_seq as bigint start with 1 increment by 50; +create table self_many_many ( + id numeric(19) not null, + name nvarchar(255), + constraint pk_self_many_many primary key (id) +); +create sequence self_many_many_seq as bigint start with 1 increment by 50; + +create table self_many_bridge ( + self_1_id numeric(19) not null, + self_2_id numeric(19) not null, + constraint pk_self_many_bridge primary key (self_1_id,self_2_id) +); + create table self_parent ( id numeric(19) not null, name nvarchar(255), @@ -3964,6 +4372,7 @@ 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, + deleted integer default 0 not null, truckload numeric(19), constraint pk_tcar primary key (plate_no) ); @@ -3980,7 +4389,7 @@ create table tevent_many ( id numeric(19) not null, description nvarchar(255), event_id numeric(19), - units integer not null, + my_units integer not null, amount float(32) not null, version numeric(19) not null, constraint pk_tevent_many primary key (id) @@ -4043,7 +4452,7 @@ create table t_detail_with_other_namexxxyy ( constraint pk_t_detail_with_other_namexxxyy primary key (id) ); create unique nonclustered index uq_t_detail_with_other_namexxxyy_some_unique_value on t_detail_with_other_namexxxyy(some_unique_value) where some_unique_value is not null; -create sequence t_detail_with_other_namexxxyy_seq as bigint start with 1 increment by 50; +create sequence t_atable_detail_seq as bigint start with 1 increment by 50; create table t_atable_thatisrelatively ( id integer not null, @@ -4052,7 +4461,7 @@ create table t_atable_thatisrelatively ( active integer default 0 not null, constraint pk_t_atable_thatisrelatively primary key (id) ); -create sequence t_atable_thatisrelatively_seq as bigint start with 1 increment by 50; +create sequence t_atable_master_seq as bigint start with 1 increment by 50; create table ttruck_holder ( id numeric(19) not null, @@ -4118,6 +4527,16 @@ create table test_annotation_base_entity ( null3 nvarchar(255) ); +create table test_jakarta_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), @@ -4349,14 +4768,42 @@ create table vehicle_lease ( active_start date, active_end date, version numeric(19) not null, - bond numeric(28), + bond numeric(16,3), min_duration integer not null, - day_rate numeric(28), + day_rate numeric(16,3), max_days integer, constraint pk_vehicle_lease primary key (id) ); create sequence vehicle_lease_seq as bigint start with 1 increment by 50; +create table version_child ( + id integer not null, + name nvarchar(255), + parent_id integer, + version integer not null, + position integer, + constraint pk_version_child primary key (id) +); +create sequence version_child_seq as bigint start with 1 increment by 50; + +create table version_parent ( + id integer not null, + name nvarchar(255), + version integer not null, + constraint pk_version_parent primary key (id) +); +create sequence version_parent_seq as bigint start with 1 increment by 50; + +create table version_toy ( + id integer not null, + name nvarchar(255), + child_id integer, + version integer not null, + position integer, + constraint pk_version_toy primary key (id) +); +create sequence version_toy_seq as bigint start with 1 increment by 50; + create table warehouses ( id integer not null, officezoneid integer, @@ -4442,7 +4889,9 @@ create index ix_contact_last_name_first_name on contact (last_name,first_name); create index ix_e_basic_name on e_basic (name); create index ix_efile2_no_fk_owner_id on efile2_no_fk (owner_id); create index ix_ecsm_values_host_id on ecsm_values (host_id); +create index ix_order_referenced_parent_type on order_referenced_parent (type); create index ix_organization_node_kind on organization_node (kind); +create index ano_3 on test_annotation_base_entity (direct); create index ix_bar_foo_id on bar (foo_id); alter table bar add constraint fk_bar_foo_id foreign key (foo_id) references foo (foo_id); @@ -4463,6 +4912,9 @@ alter table album add constraint fk_album_cover_id foreign key (cover_id) refere 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_app_config_control_config_id on app_config_control (config_id); +alter table app_config_control add constraint fk_app_config_control_config_id foreign key (config_id) references app_config (id); + 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); @@ -4490,6 +4942,9 @@ alter table bsite_user_c add constraint fk_bsite_user_c_site_uid foreign key (si create index ix_bsite_user_c_user_uid on bsite_user_c (user_uid); alter table bsite_user_c add constraint fk_bsite_user_c_user_uid foreign key (user_uid) references buser (id); +create index ix_bsite_user_dmany_bsite_user_d on bsite_user_dmany (site_id,user_id); +alter table bsite_user_dmany add constraint fk_bsite_user_dmany_bsite_user_d foreign key (site_id,user_id) references bsite_user_d (site_id,user_id); + create index ix_bsite_user_e_site_id on bsite_user_e (site_id); alter table bsite_user_e add constraint fk_bsite_user_e_site_id foreign key (site_id) references bsite (id); @@ -4508,6 +4963,12 @@ alter table cepproduct_category add constraint fk_cepproduct_category_category_i create index ix_cepproduct_category_product_id on cepproduct_category (product_id); alter table cepproduct_category add constraint fk_cepproduct_category_product_id foreign key (product_id) references cepproduct (id); +create index ix_ciaddress_street_id on ciaddress (street_id); +alter table ciaddress add constraint fk_ciaddress_street_id foreign key (street_id) references cistreet_parent (id); + +create index ix_cicustomer_parent_address_id on cicustomer_parent (address_id); +alter table cicustomer_parent add constraint fk_cicustomer_parent_address_id foreign key (address_id) references ciaddress (id); + create index ix_cinh_ref_ref_id on cinh_ref (ref_id); alter table cinh_ref add constraint fk_cinh_ref_ref_id foreign key (ref_id) references cinh_root (id); @@ -4522,6 +4983,8 @@ alter table coone_many add constraint fk_coone_many_coone_id foreign key (coone_ alter table coroot add constraint fk_coroot_one_id foreign key (one_id) references coone (id); +alter table calcd_data add constraint fk_calcd_data_id foreign key (id) references calcd_input (id) on delete cascade; + 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); @@ -4615,11 +5078,13 @@ alter table drot_drol add constraint fk_drot_drol_drol foreign key (drol_id) ref create index ix_dc_detail_master_id on dc_detail (master_id); alter table dc_detail add constraint fk_dc_detail_master_id foreign key (master_id) references dc_master (id); +alter table defaults_model add constraint fk_defaults_model_id foreign key (id) references defaults_model_draft (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; +alter table dfk_cascade add constraint fk_dfk_cascade_one_id foreign key (one_id) references dfk_cascade_one (id) on delete cascade; create index ix_dfk_set_null_one_id on dfk_set_null (one_id); -alter table dfk_set_null add constraint fk_dfk_set_null_one_id foreign key (one_id) references dfk_one (id) on delete set null on update set null; +alter table dfk_set_null add constraint fk_dfk_set_null_one_id foreign key (one_id) references dfk_one (id) on delete set null; alter table doc add constraint fk_doc_id foreign key (id) references doc_draft (id); @@ -4710,6 +5175,14 @@ alter table esoft_del_user_esoft_del_role add constraint fk_esoft_del_user_esoft 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); +alter table esoft_del_x add constraint fk_esoft_del_x_y_id foreign key (y_id) references esoft_del_y (id); + +create index ix_esoft_del_x_organization_id on esoft_del_x (organization_id); +alter table esoft_del_x add constraint fk_esoft_del_x_organization_id foreign key (organization_id) references esoft_del_z (id); + +create index ix_esoft_del_y_organization_id on esoft_del_y (organization_id); +alter table esoft_del_y add constraint fk_esoft_del_y_organization_id foreign key (organization_id) references esoft_del_z (id); + 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); @@ -4853,6 +5326,18 @@ alter table la_attr_value_attribute add constraint fk_la_attr_value_attribute_at create index ix_looney_tune_id on looney (tune_id); alter table looney add constraint fk_looney_tune_id foreign key (tune_id) references tune (id); +create index ix_m2mcache_set1_m2_mcache_master on m2mcache_set1 (m2_mcache_master_id); +alter table m2mcache_set1 add constraint fk_m2mcache_set1_m2_mcache_master foreign key (m2_mcache_master_id) references m2_mcache_master (id); + +create index ix_m2mcache_set1_m2_mcache_child on m2mcache_set1 (m2_mcache_child_id); +alter table m2mcache_set1 add constraint fk_m2mcache_set1_m2_mcache_child foreign key (m2_mcache_child_id) references m2_mcache_child (id); + +create index ix_m2mcache_set2_m2_mcache_master on m2mcache_set2 (m2_mcache_master_id); +alter table m2mcache_set2 add constraint fk_m2mcache_set2_m2_mcache_master foreign key (m2_mcache_master_id) references m2_mcache_master (id); + +create index ix_m2mcache_set2_m2_mcache_child on m2mcache_set2 (m2_mcache_child_id); +alter table m2mcache_set2 add constraint fk_m2mcache_set2_m2_mcache_child foreign key (m2_mcache_child_id) references m2_mcache_child (id); + create index ix_mcontact_customer_id on mcontact (customer_id); alter table mcontact add constraint fk_mcontact_customer_id foreign key (customer_id) references mcustomer (id); @@ -4938,6 +5423,12 @@ alter table mny_b_mny_c add constraint fk_mny_b_mny_c_mny_b foreign key (mny_b_i 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_mny_edge_from_id on mny_edge (from_id); +alter table mny_edge add constraint fk_mny_edge_from_id foreign key (from_id) references mny_node (id); + +create index ix_mny_edge_to_id on mny_edge (to_id); +alter table mny_edge add constraint fk_mny_edge_to_id foreign key (to_id) references mny_node (id); + 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); @@ -4992,9 +5483,18 @@ alter table om_account_child_dbo add constraint fk_om_account_child_dbo_banana_r create index ix_om_basic_child_parent_id on om_basic_child (parent_id); alter table om_basic_child add constraint fk_om_basic_child_parent_id foreign key (parent_id) references om_basic_parent (id); +create index ix_om_bean_list_child_parent_id on om_bean_list_child (parent_id); +alter table om_bean_list_child add constraint fk_om_bean_list_child_parent_id foreign key (parent_id) references om_bean_list_parent (id); + 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_oml_baz_foo_id on oml_baz (foo_id); +alter table oml_baz add constraint fk_oml_baz_foo_id foreign key (foo_id) references oml_foo (id); + +create index ix_oml_foo_bar_id on oml_foo (bar_id); +alter table oml_foo add constraint fk_oml_foo_bar_id foreign key (bar_id) references oml_bar (id); + 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); @@ -5007,9 +5507,18 @@ alter table o_order_detail add constraint fk_o_order_detail_product_id foreign k 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_order_referenced_parent_master_id on order_referenced_parent (master_id); +alter table order_referenced_parent add constraint fk_order_referenced_parent_master_id foreign key (master_id) references order_master (id); + 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); +create index ix_order_toy_child_id on order_toy (child_id); +alter table order_toy add constraint fk_order_toy_child_id foreign key (child_id) references order_referenced_parent (id); + +create index ix_ordered_parent_order_master_inheritance_id on ordered_parent (order_master_inheritance_id); +alter table ordered_parent add constraint fk_ordered_parent_order_master_inheritance_id foreign key (order_master_inheritance_id) references order_master_inheritance (id); + alter table organization_node add constraint fk_organization_node_parent_tree_node_id foreign key (parent_tree_node_id) references organization_tree_node (id); create index ix_orp_detail_master_id on orp_detail (master_id); @@ -5060,6 +5569,12 @@ alter table rawinherit_parent_rawinherit_data add constraint fk_rawinherit_paren 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_a_child_id on parent_a (child_id); +alter table parent_a add constraint fk_parent_a_child_id foreign key (child_id) references child_with_cache (id); + +create index ix_parent_b_child_id on parent_b (child_id); +alter table parent_b add constraint fk_parent_b_child_id foreign key (child_id) references child_with_cache (id); + 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); @@ -5093,6 +5608,8 @@ alter table person add constraint fk_person_default_address_oid foreign key (def create index ix_person_cache_email_person_info_person_id on person_cache_email (person_info_person_id); alter table person_cache_email add constraint fk_person_cache_email_person_info_person_id foreign key (person_info_person_id) references person_cache_info (person_id); +alter table persona add constraint fk_persona_person_oid foreign key (person_oid) references person (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); @@ -5111,9 +5628,20 @@ alter table question add constraint fk_question_groupobjectid foreign key (group 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); +alter table referenced_defaults_model add constraint fk_referenced_defaults_model_id foreign key (id) references referenced_defaults_model_draft (id); + +create index ix_referenced_defaults_model_defaults_model_id on referenced_defaults_model (defaults_model_id); +alter table referenced_defaults_model add constraint fk_referenced_defaults_model_defaults_model_id foreign key (defaults_model_id) references defaults_model (id); + +create index ix_referenced_defaults_model_draft_defaults_model_id on referenced_defaults_model_draft (defaults_model_id); +alter table referenced_defaults_model_draft add constraint fk_referenced_defaults_model_draft_defaults_model_id foreign key (defaults_model_id) references defaults_model_draft (id); + create index ix_rel_master_detail_id on rel_master (detail_id); alter table rel_master add constraint fk_rel_master_detail_id foreign key (detail_id) references rel_detail (id); +create index ix_app_config_re_config_id on app_config_re (config_id); +alter table app_config_re add constraint fk_app_config_re_config_id foreign key (config_id) references app_config (id); + create index ix_resourcefile_parentresourcefileid on resourcefile (parentresourcefileid); alter table resourcefile add constraint fk_resourcefile_parentresourcefileid foreign key (parentresourcefileid) references resourcefile (id); @@ -5134,6 +5662,12 @@ alter table f_second add constraint fk_f_second_first foreign key (first) refere 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_many_bridge_self_many_many_1 on self_many_bridge (self_1_id); +alter table self_many_bridge add constraint fk_self_many_bridge_self_many_many_1 foreign key (self_1_id) references self_many_many (id); + +create index ix_self_many_bridge_self_many_many_2 on self_many_bridge (self_2_id); +alter table self_many_bridge add constraint fk_self_many_bridge_self_many_many_2 foreign key (self_2_id) references self_many_many (id); + 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); @@ -5232,6 +5766,12 @@ alter table vehicle_driver add constraint fk_vehicle_driver_vehicle_id foreign k 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_version_child_parent_id on version_child (parent_id); +alter table version_child add constraint fk_version_child_parent_id foreign key (parent_id) references version_parent (id); + +create index ix_version_toy_child_id on version_toy (child_id); +alter table version_toy add constraint fk_version_toy_child_id foreign key (child_id) references version_child (id); + create index ix_warehouses_officezoneid on warehouses (officezoneid); alter table warehouses add constraint fk_warehouses_officezoneid foreign key (officezoneid) references zones (id); @@ -5256,6 +5796,11 @@ alter table g_who_props_otm add constraint fk_g_who_props_otm_who_modified_id fo 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 hembi_bean + 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 hembi_bean set (system_versioning = on (history_table=dbo.hembi_bean_history)); 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', diff --git a/ebean-core/src/test/ddl-review/sqlserver-drop-all.sql b/ebean-core/src/test/ddl-review/sqlserver-drop-all.sql index 867ef2963..16d8b49fd 100644 --- a/ebean-core/src/test/ddl-review/sqlserver-drop-all.sql +++ b/ebean-core/src/test/ddl-review/sqlserver-drop-all.sql @@ -1,4 +1,4 @@ --- Generated by ebean unknown at 2020-03-04T08:21:26.827349Z +-- Generated by ebean unknown at 2021-08-22T03:36:08.393487Z 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; @@ -20,6 +20,9 @@ IF OBJECT_ID('fk_album_cover_id', 'F') IS NOT NULL alter table album drop constr 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_app_config_control_config_id', 'F') IS NOT NULL alter table app_config_control drop constraint fk_app_config_control_config_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('app_config_control','U') AND name = 'ix_app_config_control_config_id') drop index ix_app_config_control_config_id ON app_config_control; + 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; @@ -47,6 +50,9 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_ IF OBJECT_ID('fk_bsite_user_c_user_uid', 'F') IS NOT NULL alter table bsite_user_c drop constraint fk_bsite_user_c_user_uid; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_c','U') AND name = 'ix_bsite_user_c_user_uid') drop index ix_bsite_user_c_user_uid ON bsite_user_c; +IF OBJECT_ID('fk_bsite_user_dmany_bsite_user_d', 'F') IS NOT NULL alter table bsite_user_dmany drop constraint fk_bsite_user_dmany_bsite_user_d; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_dmany','U') AND name = 'ix_bsite_user_dmany_bsite_user_d') drop index ix_bsite_user_dmany_bsite_user_d ON bsite_user_dmany; + IF OBJECT_ID('fk_bsite_user_e_site_id', 'F') IS NOT NULL alter table bsite_user_e drop constraint fk_bsite_user_e_site_id; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bsite_user_e','U') AND name = 'ix_bsite_user_e_site_id') drop index ix_bsite_user_e_site_id ON bsite_user_e; @@ -69,6 +75,12 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('cepproduct_ IF OBJECT_ID('fk_cepproduct_category_product_id', 'F') IS NOT NULL alter table cepproduct_category drop constraint fk_cepproduct_category_product_id; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('cepproduct_category','U') AND name = 'ix_cepproduct_category_product_id') drop index ix_cepproduct_category_product_id ON cepproduct_category; +IF OBJECT_ID('fk_ciaddress_street_id', 'F') IS NOT NULL alter table ciaddress drop constraint fk_ciaddress_street_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ciaddress','U') AND name = 'ix_ciaddress_street_id') drop index ix_ciaddress_street_id ON ciaddress; + +IF OBJECT_ID('fk_cicustomer_parent_address_id', 'F') IS NOT NULL alter table cicustomer_parent drop constraint fk_cicustomer_parent_address_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('cicustomer_parent','U') AND name = 'ix_cicustomer_parent_address_id') drop index ix_cicustomer_parent_address_id ON cicustomer_parent; + IF OBJECT_ID('fk_cinh_ref_ref_id', 'F') IS NOT NULL alter table cinh_ref drop constraint fk_cinh_ref_ref_id; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('cinh_ref','U') AND name = 'ix_cinh_ref_ref_id') drop index ix_cinh_ref_ref_id ON cinh_ref; @@ -84,6 +96,8 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('coone_many' IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('coroot','U') AND name = 'uq_coroot_one_id') drop index uq_coroot_one_id ON coroot; IF OBJECT_ID('fk_coroot_one_id', 'F') IS NOT NULL alter table coroot drop constraint fk_coroot_one_id; +IF OBJECT_ID('fk_calcd_data_id', 'F') IS NOT NULL alter table calcd_data drop constraint fk_calcd_data_id; + IF OBJECT_ID('fk_calculation_result_product_configuration_id', 'F') IS NOT NULL alter table calculation_result drop constraint fk_calculation_result_product_configuration_id; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('calculation_result','U') AND name = 'ix_calculation_result_product_configuration_id') drop index ix_calculation_result_product_configuration_id ON calculation_result; @@ -178,6 +192,8 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('drot_drol', IF OBJECT_ID('fk_dc_detail_master_id', 'F') IS NOT NULL alter table dc_detail drop constraint fk_dc_detail_master_id; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('dc_detail','U') AND name = 'ix_dc_detail_master_id') drop index ix_dc_detail_master_id ON dc_detail; +IF OBJECT_ID('fk_defaults_model_id', 'F') IS NOT NULL alter table defaults_model drop constraint fk_defaults_model_id; + 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; @@ -280,6 +296,15 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_u 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 EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_x','U') AND name = 'uq_esoft_del_x_y_id') drop index uq_esoft_del_x_y_id ON esoft_del_x; +IF OBJECT_ID('fk_esoft_del_x_y_id', 'F') IS NOT NULL alter table esoft_del_x drop constraint fk_esoft_del_x_y_id; + +IF OBJECT_ID('fk_esoft_del_x_organization_id', 'F') IS NOT NULL alter table esoft_del_x drop constraint fk_esoft_del_x_organization_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_x','U') AND name = 'ix_esoft_del_x_organization_id') drop index ix_esoft_del_x_organization_id ON esoft_del_x; + +IF OBJECT_ID('fk_esoft_del_y_organization_id', 'F') IS NOT NULL alter table esoft_del_y drop constraint fk_esoft_del_y_organization_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('esoft_del_y','U') AND name = 'ix_esoft_del_y_organization_id') drop index ix_esoft_del_y_organization_id ON esoft_del_y; + 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; @@ -426,6 +451,18 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('la_attr_val IF OBJECT_ID('fk_looney_tune_id', 'F') IS NOT NULL alter table looney drop constraint fk_looney_tune_id; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('looney','U') AND name = 'ix_looney_tune_id') drop index ix_looney_tune_id ON looney; +IF OBJECT_ID('fk_m2mcache_set1_m2_mcache_master', 'F') IS NOT NULL alter table m2mcache_set1 drop constraint fk_m2mcache_set1_m2_mcache_master; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('m2mcache_set1','U') AND name = 'ix_m2mcache_set1_m2_mcache_master') drop index ix_m2mcache_set1_m2_mcache_master ON m2mcache_set1; + +IF OBJECT_ID('fk_m2mcache_set1_m2_mcache_child', 'F') IS NOT NULL alter table m2mcache_set1 drop constraint fk_m2mcache_set1_m2_mcache_child; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('m2mcache_set1','U') AND name = 'ix_m2mcache_set1_m2_mcache_child') drop index ix_m2mcache_set1_m2_mcache_child ON m2mcache_set1; + +IF OBJECT_ID('fk_m2mcache_set2_m2_mcache_master', 'F') IS NOT NULL alter table m2mcache_set2 drop constraint fk_m2mcache_set2_m2_mcache_master; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('m2mcache_set2','U') AND name = 'ix_m2mcache_set2_m2_mcache_master') drop index ix_m2mcache_set2_m2_mcache_master ON m2mcache_set2; + +IF OBJECT_ID('fk_m2mcache_set2_m2_mcache_child', 'F') IS NOT NULL alter table m2mcache_set2 drop constraint fk_m2mcache_set2_m2_mcache_child; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('m2mcache_set2','U') AND name = 'ix_m2mcache_set2_m2_mcache_child') drop index ix_m2mcache_set2_m2_mcache_child ON m2mcache_set2; + IF OBJECT_ID('fk_mcontact_customer_id', 'F') IS NOT NULL alter table mcontact drop constraint fk_mcontact_customer_id; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mcontact','U') AND name = 'ix_mcontact_customer_id') drop index ix_mcontact_customer_id ON mcontact; @@ -517,6 +554,14 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('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 EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mny_edge','U') AND name = 'uq_mny_edge_from_id_to_id') drop index uq_mny_edge_from_id_to_id ON mny_edge; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mny_edge','U') AND name = 'uq_mny_edge_to_id_from_id') drop index uq_mny_edge_to_id_from_id ON mny_edge; +IF OBJECT_ID('fk_mny_edge_from_id', 'F') IS NOT NULL alter table mny_edge drop constraint fk_mny_edge_from_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mny_edge','U') AND name = 'ix_mny_edge_from_id') drop index ix_mny_edge_from_id ON mny_edge; + +IF OBJECT_ID('fk_mny_edge_to_id', 'F') IS NOT NULL alter table mny_edge drop constraint fk_mny_edge_to_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('mny_edge','U') AND name = 'ix_mny_edge_to_id') drop index ix_mny_edge_to_id ON mny_edge; + 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; @@ -576,9 +621,18 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('om_account_ IF OBJECT_ID('fk_om_basic_child_parent_id', 'F') IS NOT NULL alter table om_basic_child drop constraint fk_om_basic_child_parent_id; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('om_basic_child','U') AND name = 'ix_om_basic_child_parent_id') drop index ix_om_basic_child_parent_id ON om_basic_child; +IF OBJECT_ID('fk_om_bean_list_child_parent_id', 'F') IS NOT NULL alter table om_bean_list_child drop constraint fk_om_bean_list_child_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('om_bean_list_child','U') AND name = 'ix_om_bean_list_child_parent_id') drop index ix_om_bean_list_child_parent_id ON om_bean_list_child; + IF OBJECT_ID('fk_om_ordered_detail_master_id', 'F') IS NOT NULL alter table om_ordered_detail drop constraint fk_om_ordered_detail_master_id; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('om_ordered_detail','U') AND name = 'ix_om_ordered_detail_master_id') drop index ix_om_ordered_detail_master_id ON om_ordered_detail; +IF OBJECT_ID('fk_oml_baz_foo_id', 'F') IS NOT NULL alter table oml_baz drop constraint fk_oml_baz_foo_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oml_baz','U') AND name = 'ix_oml_baz_foo_id') drop index ix_oml_baz_foo_id ON oml_baz; + +IF OBJECT_ID('fk_oml_foo_bar_id', 'F') IS NOT NULL alter table oml_foo drop constraint fk_oml_foo_bar_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('oml_foo','U') AND name = 'ix_oml_foo_bar_id') drop index ix_oml_foo_bar_id ON oml_foo; + 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; @@ -591,9 +645,18 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('o_order_det 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_order_referenced_parent_master_id', 'F') IS NOT NULL alter table order_referenced_parent drop constraint fk_order_referenced_parent_master_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('order_referenced_parent','U') AND name = 'ix_order_referenced_parent_master_id') drop index ix_order_referenced_parent_master_id ON order_referenced_parent; + 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_order_toy_child_id', 'F') IS NOT NULL alter table order_toy drop constraint fk_order_toy_child_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('order_toy','U') AND name = 'ix_order_toy_child_id') drop index ix_order_toy_child_id ON order_toy; + +IF OBJECT_ID('fk_ordered_parent_order_master_inheritance_id', 'F') IS NOT NULL alter table ordered_parent drop constraint fk_ordered_parent_order_master_inheritance_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ordered_parent','U') AND name = 'ix_ordered_parent_order_master_inheritance_id') drop index ix_ordered_parent_order_master_inheritance_id ON ordered_parent; + IF OBJECT_ID('fk_organization_node_parent_tree_node_id', 'F') IS NOT NULL alter table organization_node drop constraint fk_organization_node_parent_tree_node_id; IF OBJECT_ID('fk_orp_detail_master_id', 'F') IS NOT NULL alter table orp_detail drop constraint fk_orp_detail_master_id; @@ -656,6 +719,12 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('rawinherit_ 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_a_child_id', 'F') IS NOT NULL alter table parent_a drop constraint fk_parent_a_child_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('parent_a','U') AND name = 'ix_parent_a_child_id') drop index ix_parent_a_child_id ON parent_a; + +IF OBJECT_ID('fk_parent_b_child_id', 'F') IS NOT NULL alter table parent_b drop constraint fk_parent_b_child_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('parent_b','U') AND name = 'ix_parent_b_child_id') drop index ix_parent_b_child_id ON parent_b; + 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; @@ -690,6 +759,9 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('person','U' IF OBJECT_ID('fk_person_cache_email_person_info_person_id', 'F') IS NOT NULL alter table person_cache_email drop constraint fk_person_cache_email_person_info_person_id; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('person_cache_email','U') AND name = 'ix_person_cache_email_person_info_person_id') drop index ix_person_cache_email_person_info_person_id ON person_cache_email; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('persona','U') AND name = 'uq_persona_person_oid') drop index uq_persona_person_oid ON persona; +IF OBJECT_ID('fk_persona_person_oid', 'F') IS NOT NULL alter table persona drop constraint fk_persona_person_oid; + 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; @@ -708,9 +780,20 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('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_referenced_defaults_model_id', 'F') IS NOT NULL alter table referenced_defaults_model drop constraint fk_referenced_defaults_model_id; + +IF OBJECT_ID('fk_referenced_defaults_model_defaults_model_id', 'F') IS NOT NULL alter table referenced_defaults_model drop constraint fk_referenced_defaults_model_defaults_model_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('referenced_defaults_model','U') AND name = 'ix_referenced_defaults_model_defaults_model_id') drop index ix_referenced_defaults_model_defaults_model_id ON referenced_defaults_model; + +IF OBJECT_ID('fk_referenced_defaults_model_draft_defaults_model_id', 'F') IS NOT NULL alter table referenced_defaults_model_draft drop constraint fk_referenced_defaults_model_draft_defaults_model_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('referenced_defaults_model_draft','U') AND name = 'ix_referenced_defaults_model_draft_defaults_model_id') drop index ix_referenced_defaults_model_draft_defaults_model_id ON referenced_defaults_model_draft; + IF OBJECT_ID('fk_rel_master_detail_id', 'F') IS NOT NULL alter table rel_master drop constraint fk_rel_master_detail_id; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('rel_master','U') AND name = 'ix_rel_master_detail_id') drop index ix_rel_master_detail_id ON rel_master; +IF OBJECT_ID('fk_app_config_re_config_id', 'F') IS NOT NULL alter table app_config_re drop constraint fk_app_config_re_config_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('app_config_re','U') AND name = 'ix_app_config_re_config_id') drop index ix_app_config_re_config_id ON app_config_re; + 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; @@ -732,6 +815,12 @@ IF OBJECT_ID('fk_f_second_first', 'F') IS NOT NULL alter table f_second drop con 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_many_bridge_self_many_many_1', 'F') IS NOT NULL alter table self_many_bridge drop constraint fk_self_many_bridge_self_many_many_1; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('self_many_bridge','U') AND name = 'ix_self_many_bridge_self_many_many_1') drop index ix_self_many_bridge_self_many_many_1 ON self_many_bridge; + +IF OBJECT_ID('fk_self_many_bridge_self_many_many_2', 'F') IS NOT NULL alter table self_many_bridge drop constraint fk_self_many_bridge_self_many_many_2; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('self_many_bridge','U') AND name = 'ix_self_many_bridge_self_many_many_2') drop index ix_self_many_bridge_self_many_many_2 ON self_many_bridge; + 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; @@ -837,6 +926,12 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('vehicle_dri 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_version_child_parent_id', 'F') IS NOT NULL alter table version_child drop constraint fk_version_child_parent_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('version_child','U') AND name = 'ix_version_child_parent_id') drop index ix_version_child_parent_id ON version_child; + +IF OBJECT_ID('fk_version_toy_child_id', 'F') IS NOT NULL alter table version_toy drop constraint fk_version_toy_child_id; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('version_toy','U') AND name = 'ix_version_toy_child_id') drop index ix_version_toy_child_id ON version_toy; + 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; @@ -904,6 +999,12 @@ 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('app_config', 'U') IS NOT NULL drop table app_config; +IF OBJECT_ID('app_config_seq', 'SO') IS NOT NULL drop sequence app_config_seq; + +IF OBJECT_ID('app_config_control', 'U') IS NOT NULL drop table app_config_control; +IF OBJECT_ID('app_config_control_seq', 'SO') IS NOT NULL drop sequence app_config_control_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; @@ -938,6 +1039,8 @@ IF OBJECT_ID('bsite_user_c', 'U') IS NOT NULL drop table bsite_user_c; IF OBJECT_ID('bsite_user_d', 'U') IS NOT NULL drop table bsite_user_d; +IF OBJECT_ID('bsite_user_dmany', 'U') IS NOT NULL drop table bsite_user_dmany; + IF OBJECT_ID('bsite_user_e', 'U') IS NOT NULL drop table bsite_user_e; IF OBJECT_ID('buser', 'U') IS NOT NULL drop table buser; @@ -971,6 +1074,15 @@ IF OBJECT_ID('cepproduct_seq', 'SO') IS NOT NULL drop sequence cepproduct_seq; IF OBJECT_ID('cepproduct_category', 'U') IS NOT NULL drop table cepproduct_category; +IF OBJECT_ID('ciaddress', 'U') IS NOT NULL drop table ciaddress; +IF OBJECT_ID('ciaddress_seq', 'SO') IS NOT NULL drop sequence ciaddress_seq; + +IF OBJECT_ID('cicustomer_parent', 'U') IS NOT NULL drop table cicustomer_parent; +IF OBJECT_ID('cicustomer_parent_seq', 'SO') IS NOT NULL drop sequence cicustomer_parent_seq; + +IF OBJECT_ID('cistreet_parent', 'U') IS NOT NULL drop table cistreet_parent; +IF OBJECT_ID('cistreet_parent_seq', 'SO') IS NOT NULL drop sequence cistreet_parent_seq; + IF OBJECT_ID('cinh_ref', 'U') IS NOT NULL drop table cinh_ref; IF OBJECT_ID('cinh_ref_seq', 'SO') IS NOT NULL drop sequence cinh_ref_seq; @@ -994,6 +1106,12 @@ IF OBJECT_ID('coone_many_seq', 'SO') IS NOT NULL drop sequence coone_many_seq; IF OBJECT_ID('coroot', 'U') IS NOT NULL drop table coroot; IF OBJECT_ID('coroot_seq', 'SO') IS NOT NULL drop sequence coroot_seq; +IF OBJECT_ID('calcd_data', 'U') IS NOT NULL drop table calcd_data; +IF OBJECT_ID('calcd_data_seq', 'SO') IS NOT NULL drop sequence calcd_data_seq; + +IF OBJECT_ID('calcd_input', 'U') IS NOT NULL drop table calcd_input; +IF OBJECT_ID('calcd_input_seq', 'SO') IS NOT NULL drop sequence calcd_input_seq; + IF OBJECT_ID('calculation_result', 'U') IS NOT NULL drop table calculation_result; IF OBJECT_ID('calculation_result_seq', 'SO') IS NOT NULL drop sequence calculation_result_seq; @@ -1024,6 +1142,9 @@ IF OBJECT_ID('e_save_test_d_seq', 'SO') IS NOT NULL drop sequence e_save_test_d_ 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('child_with_cache', 'U') IS NOT NULL drop table child_with_cache; +IF OBJECT_ID('child_with_cache_seq', 'SO') IS NOT NULL drop sequence child_with_cache_seq; + IF OBJECT_ID('cke_client', 'U') IS NOT NULL drop table cke_client; IF OBJECT_ID('cke_user', 'U') IS NOT NULL drop table cke_user; @@ -1113,6 +1234,12 @@ IF OBJECT_ID('dc_detail_seq', 'SO') IS NOT NULL drop sequence dc_detail_seq; IF OBJECT_ID('dc_master', 'U') IS NOT NULL drop table dc_master; IF OBJECT_ID('dc_master_seq', 'SO') IS NOT NULL drop sequence dc_master_seq; +IF OBJECT_ID('defaults_model', 'U') IS NOT NULL drop table defaults_model; +IF OBJECT_ID('defaults_model_seq', 'SO') IS NOT NULL drop sequence defaults_model_seq; + +IF OBJECT_ID('defaults_model_draft', 'U') IS NOT NULL drop table defaults_model_draft; +IF OBJECT_ID('defaults_model_draft_seq', 'SO') IS NOT NULL drop sequence defaults_model_draft_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; @@ -1208,6 +1335,9 @@ IF OBJECT_ID('ebasic_json_jackson_seq', 'SO') IS NOT NULL drop sequence ebasic_j IF OBJECT_ID('ebasic_json_jackson2', 'U') IS NOT NULL drop table ebasic_json_jackson2; IF OBJECT_ID('ebasic_json_jackson2_seq', 'SO') IS NOT NULL drop sequence ebasic_json_jackson2_seq; +IF OBJECT_ID('ebasic_json_jackson3', 'U') IS NOT NULL drop table ebasic_json_jackson3; +IF OBJECT_ID('ebasic_json_jackson3_seq', 'SO') IS NOT NULL drop sequence ebasic_json_jackson3_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; @@ -1229,6 +1359,9 @@ IF OBJECT_ID('ebasic_json_map_json_b_seq', 'SO') IS NOT NULL drop sequence ebasi 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_multi', 'U') IS NOT NULL drop table ebasic_json_multi; +IF OBJECT_ID('ebasic_json_multi_seq', 'SO') IS NOT NULL drop sequence ebasic_json_multi_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; @@ -1244,12 +1377,21 @@ IF OBJECT_ID('ebasic_json_node_varchar_seq', 'SO') IS NOT NULL drop sequence eba 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_log', 'U') IS NOT NULL drop table e_basic_log; +IF OBJECT_ID('e_basic_log_seq', 'SO') IS NOT NULL drop sequence e_basic_log_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_old_value', 'U') IS NOT NULL drop table ebasic_old_value; +IF OBJECT_ID('ebasic_old_value_seq', 'SO') IS NOT NULL drop sequence ebasic_old_value_seq; + +IF OBJECT_ID('ebasic_plain', 'U') IS NOT NULL drop table ebasic_plain; +IF OBJECT_ID('ebasic_plain_seq', 'SO') IS NOT NULL drop sequence ebasic_plain_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; @@ -1265,6 +1407,9 @@ IF OBJECT_ID('e_basic_withlife_seq', 'SO') IS NOT NULL drop sequence e_basic_wit IF OBJECT_ID('e_basic_with_ex', 'U') IS NOT NULL drop table e_basic_with_ex; IF OBJECT_ID('e_basic_with_ex_seq', 'SO') IS NOT NULL drop sequence e_basic_with_ex_seq; +IF OBJECT_ID('e_basic_withlog', 'U') IS NOT NULL drop table e_basic_withlog; +IF OBJECT_ID('e_basic_withlog_seq', 'SO') IS NOT NULL drop sequence e_basic_withlog_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; @@ -1327,6 +1472,12 @@ IF OBJECT_ID('eper_addr_seq', 'SO') IS NOT NULL drop sequence eper_addr_seq; IF OBJECT_ID('eperson', 'U') IS NOT NULL drop table eperson; IF OBJECT_ID('eperson_seq', 'SO') IS NOT NULL drop sequence eperson_seq; +IF OBJECT_ID('eperson2', 'U') IS NOT NULL drop table eperson2; +IF OBJECT_ID('eperson2_seq', 'SO') IS NOT NULL drop sequence eperson2_seq; + +IF OBJECT_ID('eperson3', 'U') IS NOT NULL drop table eperson3; +IF OBJECT_ID('eperson3_seq', 'SO') IS NOT NULL drop sequence eperson3_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; @@ -1365,6 +1516,14 @@ IF OBJECT_ID('esoft_del_user_seq', 'SO') IS NOT NULL drop sequence esoft_del_use IF OBJECT_ID('esoft_del_user_esoft_del_role', 'U') IS NOT NULL drop table esoft_del_user_esoft_del_role; +IF OBJECT_ID('esoft_del_x', 'U') IS NOT NULL drop table esoft_del_x; + +IF OBJECT_ID('esoft_del_y', 'U') IS NOT NULL drop table esoft_del_y; +IF OBJECT_ID('esoft_del_y_seq', 'SO') IS NOT NULL drop sequence esoft_del_y_seq; + +IF OBJECT_ID('esoft_del_z', 'U') IS NOT NULL drop table esoft_del_z; +IF OBJECT_ID('esoft_del_z_seq', 'SO') IS NOT NULL drop sequence esoft_del_z_seq; + 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; @@ -1476,10 +1635,7 @@ IF OBJECT_ID('foo_seq', 'SO') IS NOT NULL drop sequence foo_seq; IF OBJECT_ID('gen_key_identity', 'U') IS NOT NULL drop table gen_key_identity; IF OBJECT_ID('gen_key_sequence', 'U') IS NOT NULL drop table gen_key_sequence; -IF OBJECT_ID('gen_key_sequence_seq', 'SO') IS NOT NULL drop sequence gen_key_sequence_seq; - -IF OBJECT_ID('gen_key_table', 'U') IS NOT NULL drop table gen_key_table; -IF OBJECT_ID('gen_key_table_seq', 'SO') IS NOT NULL drop sequence gen_key_table_seq; +IF OBJECT_ID('SEQ_NAME', 'SO') IS NOT NULL drop sequence SEQ_NAME; 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; @@ -1490,6 +1646,10 @@ IF OBJECT_ID('survey_group_seq', 'SO') IS NOT NULL drop sequence survey_group_se 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('hembi_bean', 'U') IS NOT NULL alter table hembi_bean set (system_versioning = off); +IF OBJECT_ID('hembi_bean_history', 'U') IS NOT NULL drop table hembi_bean_history; +IF OBJECT_ID('hembi_bean', 'U') IS NOT NULL drop table hembi_bean; + 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; @@ -1626,6 +1786,16 @@ IF OBJECT_ID('la_attr_value_attribute', 'U') IS NOT NULL drop table la_attr_valu IF OBJECT_ID('looney', 'U') IS NOT NULL drop table looney; IF OBJECT_ID('looney_seq', 'SO') IS NOT NULL drop sequence looney_seq; +IF OBJECT_ID('m2_mcache_child', 'U') IS NOT NULL drop table m2_mcache_child; +IF OBJECT_ID('m2_mcache_child_seq', 'SO') IS NOT NULL drop sequence m2_mcache_child_seq; + +IF OBJECT_ID('m2_mcache_master', 'U') IS NOT NULL drop table m2_mcache_master; +IF OBJECT_ID('m2_mcache_master_seq', 'SO') IS NOT NULL drop sequence m2_mcache_master_seq; + +IF OBJECT_ID('m2mcache_set1', 'U') IS NOT NULL drop table m2mcache_set1; + +IF OBJECT_ID('m2mcache_set2', 'U') IS NOT NULL drop table m2mcache_set2; + IF OBJECT_ID('maddress', 'U') IS NOT NULL drop table maddress; IF OBJECT_ID('mcontact', 'U') IS NOT NULL drop table mcontact; @@ -1723,6 +1893,12 @@ 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_edge', 'U') IS NOT NULL drop table mny_edge; +IF OBJECT_ID('mny_edge_seq', 'SO') IS NOT NULL drop sequence mny_edge_seq; + +IF OBJECT_ID('mny_node', 'U') IS NOT NULL drop table mny_node; +IF OBJECT_ID('mny_node_seq', 'SO') IS NOT NULL drop sequence mny_node_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; @@ -1810,12 +1986,27 @@ IF OBJECT_ID('om_basic_child_seq', 'SO') IS NOT NULL drop sequence om_basic_chil IF OBJECT_ID('om_basic_parent', 'U') IS NOT NULL drop table om_basic_parent; IF OBJECT_ID('om_basic_parent_seq', 'SO') IS NOT NULL drop sequence om_basic_parent_seq; +IF OBJECT_ID('om_bean_list_child', 'U') IS NOT NULL drop table om_bean_list_child; +IF OBJECT_ID('om_bean_list_child_seq', 'SO') IS NOT NULL drop sequence om_bean_list_child_seq; + +IF OBJECT_ID('om_bean_list_parent', 'U') IS NOT NULL drop table om_bean_list_parent; +IF OBJECT_ID('om_bean_list_parent_seq', 'SO') IS NOT NULL drop sequence om_bean_list_parent_seq; + IF OBJECT_ID('om_ordered_detail', 'U') IS NOT NULL drop table om_ordered_detail; IF OBJECT_ID('om_ordered_detail_seq', 'SO') IS NOT NULL drop sequence om_ordered_detail_seq; IF OBJECT_ID('om_ordered_master', 'U') IS NOT NULL drop table om_ordered_master; IF OBJECT_ID('om_ordered_master_seq', 'SO') IS NOT NULL drop sequence om_ordered_master_seq; +IF OBJECT_ID('oml_bar', 'U') IS NOT NULL drop table oml_bar; +IF OBJECT_ID('oml_bar_seq', 'SO') IS NOT NULL drop sequence oml_bar_seq; + +IF OBJECT_ID('oml_baz', 'U') IS NOT NULL drop table oml_baz; +IF OBJECT_ID('oml_baz_seq', 'SO') IS NOT NULL drop sequence oml_baz_seq; + +IF OBJECT_ID('oml_foo', 'U') IS NOT NULL drop table oml_foo; +IF OBJECT_ID('oml_foo_seq', 'SO') IS NOT NULL drop sequence oml_foo_seq; + IF OBJECT_ID('only_id_entity', 'U') IS NOT NULL drop table only_id_entity; IF OBJECT_ID('only_id_entity_seq', 'SO') IS NOT NULL drop sequence only_id_entity_seq; @@ -1829,9 +2020,24 @@ 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('order_master', 'U') IS NOT NULL drop table order_master; +IF OBJECT_ID('order_master_seq', 'SO') IS NOT NULL drop sequence order_master_seq; + +IF OBJECT_ID('order_master_inheritance', 'U') IS NOT NULL drop table order_master_inheritance; +IF OBJECT_ID('order_master_inheritance_seq', 'SO') IS NOT NULL drop sequence order_master_inheritance_seq; + +IF OBJECT_ID('order_referenced_parent', 'U') IS NOT NULL drop table order_referenced_parent; +IF OBJECT_ID('order_referenced_parent_seq', 'SO') IS NOT NULL drop sequence order_referenced_parent_seq; + 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('order_toy', 'U') IS NOT NULL drop table order_toy; +IF OBJECT_ID('order_toy_seq', 'SO') IS NOT NULL drop sequence order_toy_seq; + +IF OBJECT_ID('ordered_parent', 'U') IS NOT NULL drop table ordered_parent; +IF OBJECT_ID('ordered_parent_seq', 'SO') IS NOT NULL drop sequence ordered_parent_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; @@ -1940,6 +2146,12 @@ IF OBJECT_ID('rawinherit_parent_rawinherit_data', 'U') IS NOT NULL drop table ra IF OBJECT_ID('e_save_test_c', 'U') IS NOT NULL drop table e_save_test_c; IF OBJECT_ID('e_save_test_c_seq', 'SO') IS NOT NULL drop sequence e_save_test_c_seq; +IF OBJECT_ID('parent_a', 'U') IS NOT NULL drop table parent_a; +IF OBJECT_ID('parent_a_seq', 'SO') IS NOT NULL drop sequence parent_a_seq; + +IF OBJECT_ID('parent_b', 'U') IS NOT NULL drop table parent_b; +IF OBJECT_ID('parent_b_seq', 'SO') IS NOT NULL drop sequence parent_b_seq; + IF OBJECT_ID('parent_person', 'U') IS NOT NULL drop table parent_person; IF OBJECT_ID('parent_person_seq', 'SO') IS NOT NULL drop sequence parent_person_seq; @@ -1982,6 +2194,11 @@ IF OBJECT_ID('person_cache_email', 'U') IS NOT NULL drop table person_cache_emai IF OBJECT_ID('person_cache_info', 'U') IS NOT NULL drop table person_cache_info; +IF OBJECT_ID('person_other', 'U') IS NOT NULL drop table person_other; + +IF OBJECT_ID('persona', 'U') IS NOT NULL drop table persona; +IF OBJECT_ID('persona_seq', 'SO') IS NOT NULL drop sequence persona_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; @@ -2004,6 +2221,12 @@ 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('referenced_defaults_model', 'U') IS NOT NULL drop table referenced_defaults_model; +IF OBJECT_ID('referenced_defaults_model_seq', 'SO') IS NOT NULL drop sequence referenced_defaults_model_seq; + +IF OBJECT_ID('referenced_defaults_model_draft', 'U') IS NOT NULL drop table referenced_defaults_model_draft; +IF OBJECT_ID('referenced_defaults_model_draft_seq', 'SO') IS NOT NULL drop sequence referenced_defaults_model_draft_seq; + IF OBJECT_ID('referencing_bean', 'U') IS NOT NULL drop table referencing_bean; IF OBJECT_ID('region', 'U') IS NOT NULL drop table region; @@ -2014,6 +2237,9 @@ IF OBJECT_ID('rel_detail_seq', 'SO') IS NOT NULL drop sequence rel_detail_seq; IF OBJECT_ID('rel_master', 'U') IS NOT NULL drop table rel_master; IF OBJECT_ID('rel_master_seq', 'SO') IS NOT NULL drop sequence rel_master_seq; +IF OBJECT_ID('app_config_re', 'U') IS NOT NULL drop table app_config_re; +IF OBJECT_ID('app_config_re_seq', 'SO') IS NOT NULL drop sequence app_config_re_seq; + IF OBJECT_ID('resourcefile', 'U') IS NOT NULL drop table resourcefile; IF OBJECT_ID('mt_role', 'U') IS NOT NULL drop table mt_role; @@ -2031,6 +2257,11 @@ 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_many_many', 'U') IS NOT NULL drop table self_many_many; +IF OBJECT_ID('self_many_many_seq', 'SO') IS NOT NULL drop sequence self_many_many_seq; + +IF OBJECT_ID('self_many_bridge', 'U') IS NOT NULL drop table self_many_bridge; + 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; @@ -2103,10 +2334,10 @@ IF OBJECT_ID('t_oneb', 'U') IS NOT NULL drop table t_oneb; IF OBJECT_ID('t_oneb_seq', 'SO') IS NOT NULL drop sequence t_oneb_seq; IF OBJECT_ID('t_detail_with_other_namexxxyy', 'U') IS NOT NULL drop table t_detail_with_other_namexxxyy; -IF OBJECT_ID('t_detail_with_other_namexxxyy_seq', 'SO') IS NOT NULL drop sequence t_detail_with_other_namexxxyy_seq; +IF OBJECT_ID('t_atable_detail_seq', 'SO') IS NOT NULL drop sequence t_atable_detail_seq; IF OBJECT_ID('t_atable_thatisrelatively', 'U') IS NOT NULL drop table t_atable_thatisrelatively; -IF OBJECT_ID('t_atable_thatisrelatively_seq', 'SO') IS NOT NULL drop sequence t_atable_thatisrelatively_seq; +IF OBJECT_ID('t_atable_master_seq', 'SO') IS NOT NULL drop sequence t_atable_master_seq; IF OBJECT_ID('ttruck_holder', 'U') IS NOT NULL drop table ttruck_holder; IF OBJECT_ID('ttruck_holder_seq', 'SO') IS NOT NULL drop sequence ttruck_holder_seq; @@ -2128,6 +2359,8 @@ 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('test_jakarta_annotation_base_entity', 'U') IS NOT NULL drop table test_jakarta_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; @@ -2199,6 +2432,15 @@ IF OBJECT_ID('vehicle_driver_seq', 'SO') IS NOT NULL drop sequence vehicle_drive IF OBJECT_ID('vehicle_lease', 'U') IS NOT NULL drop table vehicle_lease; IF OBJECT_ID('vehicle_lease_seq', 'SO') IS NOT NULL drop sequence vehicle_lease_seq; +IF OBJECT_ID('version_child', 'U') IS NOT NULL drop table version_child; +IF OBJECT_ID('version_child_seq', 'SO') IS NOT NULL drop sequence version_child_seq; + +IF OBJECT_ID('version_parent', 'U') IS NOT NULL drop table version_parent; +IF OBJECT_ID('version_parent_seq', 'SO') IS NOT NULL drop sequence version_parent_seq; + +IF OBJECT_ID('version_toy', 'U') IS NOT NULL drop table version_toy; +IF OBJECT_ID('version_toy_seq', 'SO') IS NOT NULL drop sequence version_toy_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; @@ -2231,4 +2473,6 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('contact','U IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('e_basic','U') AND name = 'ix_e_basic_name') drop index ix_e_basic_name ON e_basic; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('efile2_no_fk','U') AND name = 'ix_efile2_no_fk_owner_id') drop index ix_efile2_no_fk_owner_id ON efile2_no_fk; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('ecsm_values','U') AND name = 'ix_ecsm_values_host_id') drop index ix_ecsm_values_host_id ON ecsm_values; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('order_referenced_parent','U') AND name = 'ix_order_referenced_parent_type') drop index ix_order_referenced_parent_type ON order_referenced_parent; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('organization_node','U') AND name = 'ix_organization_node_kind') drop index ix_organization_node_kind ON organization_node; +IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('test_annotation_base_entity','U') AND name = 'ano_3') drop index ano_3 ON test_annotation_base_entity;