CREATE TABLE databasechangelog (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP WITHOUT TIME ZONE NOT NULL, ORDEREXECUTED INTEGER NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10));

-- *********************************************************************
-- Update Database Script
-- *********************************************************************
-- Change Log: src/main/resources/db_resources/changelog/db.rebuild.xml
-- Ran at: 8/8/25, 1:07 PM
-- Against: meveo@offline:postgresql?outputLiquibaseSql=true
-- Liquibase version: 4.29.0
-- *********************************************************************

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild_pg_operators::AndriusKarpavicius
CREATE OPERATOR ^|(
            PROCEDURE = jsonb_exists_any,
            LEFTARG = jsonb,
            RIGHTARG = _text,
            RESTRICT = contsel,
            JOIN = contjoinsel);

CREATE OPERATOR CLASS jsonb_ops_custom
            FOR TYPE jsonb USING gin AS
            OPERATOR 10  ^|(jsonb, _text),
            FUNCTION 1  gin_compare_jsonb(text, text),
            FUNCTION 2  gin_extract_jsonb(jsonb, internal, internal),
            FUNCTION 3  gin_extract_jsonb_query(jsonb, internal, smallint, internal, internal, internal, internal),
            FUNCTION 4  gin_consistent_jsonb(internal, smallint, jsonb, integer, internal, internal, internal, internal),
            FUNCTION 6  gin_triconsistent_jsonb(internal, smallint, jsonb, integer, internal, internal, internal);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild_pg_operators', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 1, '9:10e7971c9c38e2505d9d479abccb8f9c', 'sql; sql', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild_pg_extension::MohamedSTITANE
create extension "uuid-ossp";

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild_pg_extension', 'MohamedSTITANE', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 3, '9:b53f2dedb09454284566655b3bb1add6', 'sql', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-seq-1::AndriusKarpavicius
CREATE SEQUENCE  IF NOT EXISTS meveo_script_instance_cat_seq;

CREATE SEQUENCE  IF NOT EXISTS crm_customer_sequence_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_payment_schedule_tmpl_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_payment_schedule_inst_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_payment_schedule_inst_item_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_ddrequest_builder_seq;

CREATE SEQUENCE  IF NOT EXISTS bill_seq_invoice_seq;

CREATE SEQUENCE  IF NOT EXISTS adm_gdpr_configuration_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS dwh_report_extract_execution_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_finance_segment_seq;

CREATE SEQUENCE  IF NOT EXISTS crm_address_book_seq;

CREATE SEQUENCE  IF NOT EXISTS com_communication_entity_seq;

CREATE SEQUENCE  IF NOT EXISTS crm_additional_details_seq;

CREATE SEQUENCE  IF NOT EXISTS ord_order_history_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_accounting_code_seq;

CREATE SEQUENCE  IF NOT EXISTS account_entity_seq;

CREATE SEQUENCE  IF NOT EXISTS adm_country_seq START WITH 238;

CREATE SEQUENCE  IF NOT EXISTS adm_currency_seq START WITH 169;

CREATE SEQUENCE  IF NOT EXISTS adm_inbound_request_seq;

CREATE SEQUENCE  IF NOT EXISTS adm_input_history_seq;

CREATE SEQUENCE  IF NOT EXISTS adm_language_seq START WITH 34;

CREATE SEQUENCE  IF NOT EXISTS adm_notif_history_seq;

CREATE SEQUENCE  IF NOT EXISTS adm_notification_seq;

CREATE SEQUENCE  IF NOT EXISTS adm_role_seq START WITH 5;

CREATE SEQUENCE  IF NOT EXISTS adm_secured_entity_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS adm_title_seq START WITH 38;

CREATE SEQUENCE  IF NOT EXISTS adm_user_seq START WITH 3;

CREATE SEQUENCE  IF NOT EXISTS ar_account_operation_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_action_dunning_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_bank_operation_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_ddrequest_item_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_ddrequest_lot_op_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_ddrequest_lot_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_due_date_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_dunning_lot_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_matching_amount_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_matching_code_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_occ_template_seq START WITH 26;

CREATE SEQUENCE  IF NOT EXISTS bi_job_history_seq;

CREATE SEQUENCE  IF NOT EXISTS bi_job_seq;

CREATE SEQUENCE  IF NOT EXISTS bi_report_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_billing_run_list_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_billing_run_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_charge_instance_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_counter_instance_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_counter_period_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_cycle_seq START WITH 3;

CREATE SEQUENCE  IF NOT EXISTS billing_disc_inst_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_discount_language_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_discount_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_inv_sub_cat_country_seq START WITH 5;

CREATE SEQUENCE  IF NOT EXISTS billing_invoice_agregate_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_invoice_cat_lang_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_invoice_cat_seq START WITH 3;

CREATE SEQUENCE  IF NOT EXISTS billing_invoice_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_invoice_sub_cat_seq START WITH 3;

CREATE SEQUENCE  IF NOT EXISTS billing_invoice_template_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_rated_transaction_seq INCREMENT BY 5000;

CREATE SEQUENCE  IF NOT EXISTS billing_rejected_ba_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_reservation_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_service_instance_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_sub_term_reason_seq START WITH 4;

CREATE SEQUENCE  IF NOT EXISTS billing_subscription_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_tax_language_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_tax_seq START WITH 4;

CREATE SEQUENCE  IF NOT EXISTS billing_trading_country_seq START WITH 3;

CREATE SEQUENCE  IF NOT EXISTS billing_trading_currency_seq START WITH 3;

CREATE SEQUENCE  IF NOT EXISTS billing_trading_language_seq START WITH 3;

CREATE SEQUENCE  IF NOT EXISTS billing_wallet_operation_seq INCREMENT BY 5000;

CREATE SEQUENCE  IF NOT EXISTS billing_wallet_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_calendar_interval_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_calendar_seq START WITH 4;

CREATE SEQUENCE  IF NOT EXISTS cat_charge_template_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_counter_template_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_day_in_year_seq START WITH 367;

CREATE SEQUENCE  IF NOT EXISTS cat_discount_plan_item_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_discount_plan_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_hour_in_day_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_offer_template_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_price_plan_matrix_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_serv_recchrg_templt_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_serv_subchrg_templt_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_serv_trmchrg_templt_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_serv_usagechrg_templt_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_service_template_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_triggered_edr_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_unit_of_measure_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_wallet_template_seq;

CREATE SEQUENCE  IF NOT EXISTS com_campaign_seq;

CREATE SEQUENCE  IF NOT EXISTS com_contact_coords_seq;

CREATE SEQUENCE  IF NOT EXISTS com_contact_seq;

CREATE SEQUENCE  IF NOT EXISTS com_message_seq;

CREATE SEQUENCE  IF NOT EXISTS com_msg_tmpl_seq;

CREATE SEQUENCE  IF NOT EXISTS com_msg_tmpl_var_seq;

CREATE SEQUENCE  IF NOT EXISTS com_msg_var_val_seq;

CREATE SEQUENCE  IF NOT EXISTS com_prov_pol_seq;

CREATE SEQUENCE  IF NOT EXISTS com_sndr_conf_seq;

CREATE SEQUENCE  IF NOT EXISTS crm_custom_fld_tmp_seq;

CREATE SEQUENCE  IF NOT EXISTS crm_customer_brand_seq START WITH 2;

CREATE SEQUENCE  IF NOT EXISTS crm_customer_category_seq START WITH 3;

CREATE SEQUENCE  IF NOT EXISTS crm_email_seq;

CREATE SEQUENCE  IF NOT EXISTS crm_provider_contact_seq START WITH 2;

CREATE SEQUENCE  IF NOT EXISTS crm_provider_seq START WITH 2;

CREATE SEQUENCE  IF NOT EXISTS crm_seller_seq START WITH 4;

CREATE SEQUENCE  IF NOT EXISTS dwh_account_operation_seq;

CREATE SEQUENCE  IF NOT EXISTS dwh_journal_entries_seq;

CREATE SEQUENCE  IF NOT EXISTS dwh_measurable_quant_seq;

CREATE SEQUENCE  IF NOT EXISTS dwh_measured_value_seq;

CREATE SEQUENCE  IF NOT EXISTS job_execution_seq;

CREATE SEQUENCE  IF NOT EXISTS medina_access_seq;

CREATE SEQUENCE  IF NOT EXISTS meveo_timer_seq START WITH 2;

CREATE SEQUENCE  IF NOT EXISTS rating_edr_seq INCREMENT BY 5000;

CREATE SEQUENCE  IF NOT EXISTS rm_service_param_template_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_invoice_configuration_seq START WITH 2;

CREATE SEQUENCE  IF NOT EXISTS ar_credit_category_seq START WITH 6;

CREATE SEQUENCE  IF NOT EXISTS com_meveo_instance_seq;

CREATE SEQUENCE  IF NOT EXISTS meveo_job_instance_seq START WITH 12;

CREATE SEQUENCE  IF NOT EXISTS meveo_script_instance_seq;

CREATE SEQUENCE  IF NOT EXISTS meveo_filter_condition_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS meveo_filter_order_condition_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS meveo_primitive_filter_condition_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS meveo_native_filter_condition_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS meveo_filter_selector_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS meveo_filter_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cust_cet_seq;

CREATE SEQUENCE  IF NOT EXISTS cust_cei_seq;

CREATE SEQUENCE  IF NOT EXISTS meveo_module_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS meveo_module_item_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS ftp_transferred_file_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cat_offer_template_category_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_offer_serv_templt_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_revenue_recog_rule_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_revenue_schedule_seq;

CREATE SEQUENCE  IF NOT EXISTS crm_custom_action_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_invoice_type_seq START WITH 3;

CREATE SEQUENCE  IF NOT EXISTS ord_order_item_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_product_chrg_inst_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_product_instance_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_bundle_product_template_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_digital_resource_seq;

CREATE SEQUENCE  IF NOT EXISTS wf_action_seq;

CREATE SEQUENCE  IF NOT EXISTS wf_transition_seq;

CREATE SEQUENCE  IF NOT EXISTS wf_workflow_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_channel_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_offer_product_template_seq;

CREATE SEQUENCE  IF NOT EXISTS ord_order_seq;

CREATE SEQUENCE  IF NOT EXISTS hierarchy_entity_seq;

CREATE SEQUENCE  IF NOT EXISTS ord_quote_seq;

CREATE SEQUENCE  IF NOT EXISTS ord_quote_item_seq;

CREATE SEQUENCE  IF NOT EXISTS wf_decision_rule_seq START WITH 10;

CREATE SEQUENCE  IF NOT EXISTS wf_history_seq;

CREATE SEQUENCE  IF NOT EXISTS wf_history_action_seq;

CREATE SEQUENCE  IF NOT EXISTS ord_item_offerings_seq;

CREATE SEQUENCE  IF NOT EXISTS ord_quot_item_offerings_seq;

CREATE SEQUENCE  IF NOT EXISTS bill_seq_it_sell_seq;

CREATE SEQUENCE  IF NOT EXISTS audit_log_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_payment_token_seq;

CREATE SEQUENCE  IF NOT EXISTS dwh_chart_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_payment_gateway_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_payment_history_seq;

CREATE SEQUENCE  IF NOT EXISTS dwh_report_extract_seq;

CREATE SEQUENCE  IF NOT EXISTS cat_calendar_holiday_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_discount_plan_instance_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_payment_gateway_rum_sequence_seq;

CREATE SEQUENCE  IF NOT EXISTS audit_field_changes_history_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS billing_general_ledger_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_other_transaction_seq;

CREATE SEQUENCE  IF NOT EXISTS ar_payment_ventilation_seq;

CREATE SEQUENCE  IF NOT EXISTS wf_generic_workflow_seq;

CREATE SEQUENCE  IF NOT EXISTS wf_status_seq;

CREATE SEQUENCE  IF NOT EXISTS wf_instance_seq;

CREATE SEQUENCE  IF NOT EXISTS wf_instance_history_seq;

CREATE SEQUENCE  IF NOT EXISTS dunning_document_seq;

CREATE SEQUENCE  IF NOT EXISTS wf_generic_transition_seq;

CREATE SEQUENCE  IF NOT EXISTS adm_custom_generic_entity_code_seq START WITH 3;

CREATE SEQUENCE  IF NOT EXISTS cpq_price_plan_version_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_price_plan_matrix_item_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_quote_version_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_quote_product_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_quote_lot_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_contract_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_contract_item_seq;

CREATE SEQUENCE  IF NOT EXISTS adm_file_format_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS flat_file_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS ar_accounting_writing_seq;

CREATE SEQUENCE  IF NOT EXISTS adm_file_type_seq;

CREATE SEQUENCE  IF NOT EXISTS rating_cdr_seq INCREMENT BY 5000;

CREATE SEQUENCE  IF NOT EXISTS billing_tax_category_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS billing_tax_class_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS billing_tax_mapping_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cat_fixed_date_seq;

CREATE SEQUENCE  IF NOT EXISTS wo_aggregation_line_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS wo_aggregation_matrix_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS document_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS document_category_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS job_execution_error_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS bi_data_collector_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS wf_generic_action_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS meveo_metrics_config_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_product_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_product_line_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_product_version_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_tag_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_tag_filter_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_tag_type_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_media_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_offer_component_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_commercial_rule_header_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_commercial_rule_item_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_commercial_rule_line_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_grouped_service_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_product_mapping_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_quote_article_line_seq;

CREATE SEQUENCE  IF NOT EXISTS quote_offer_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_attribute_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_grouped_attributes_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_quote_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_quote_price_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cpq_quote_attribute_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_accounting_article_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS billing_article_family_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS billing_article_mapping_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS billing_article_mapping_line_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS billing_attribute_mapping_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cpq_commercial_order_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_order_type_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_order_item_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_order_product_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_order_lot_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_order_offer_seq;

CREATE SEQUENCE  IF NOT EXISTS order_article_line_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_order_invoice_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_invoice_line_seq INCREMENT BY 5000;

CREATE SEQUENCE  IF NOT EXISTS cpq_invoicing_plan_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_invoicing_plan_item_seq;

CREATE SEQUENCE  IF NOT EXISTS order_price_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cpq_price_plan_matrix_column_sq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cpq_price_plan_matrix_value_sq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cpq_price_plan_matrix_line_sq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cpq_product_charge_template_mapping_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cpq_attribute_instance_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_product_version_attribute_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS discount_plan_sequence_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS report_query_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS query_scheduler_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS query_result_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS query_execution_result_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS dunning_settings_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS dunning_pause_reasons_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS dunning_stop_reasons_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS dunning_collection_plan_statuses_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS dunning_agent_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS dunning_payment_retries_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS journal_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS ar_dunning_action_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS dunning_policy_level_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS dunning_policy_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS dunning_policy_rule_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS dunning_policy_rule_line_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS dunning_level_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS offer_template_attribute_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS collection_plan_status_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS sub_accounting_period_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS accounting_period_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS dunning_collection_plan_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS dunning_level_instance_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS dunning_action_instance_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS finance_settings_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS security_deposit_templat_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS security_deposit_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS security_deposit_transaction_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS exchange_rate_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS ar_accounting_scheme_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS open_order_setting_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cpq_order_amendement_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS open_order_threshold_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS open_order_template_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS accounting_journal_entry_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS accounting_accountingcode_mapping_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS global_settings_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS account_operation_number_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS ar_payment_plan_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS open_order_quote_seq;

CREATE SEQUENCE  IF NOT EXISTS invoice_sub_totals_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS open_order_article_seq;

CREATE SEQUENCE  IF NOT EXISTS open_order_product_seq;

CREATE SEQUENCE  IF NOT EXISTS open_order_seq;

CREATE SEQUENCE  IF NOT EXISTS cpq_billing_rule_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS meveo_script_parameter_seq;

CREATE SEQUENCE  IF NOT EXISTS crm_address_book_contact_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cpq_trading_price_plan_version_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cpq_trading_price_plan_matrix_line_sq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS ar_unmatching_code_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS ar_unmatching_amount_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cat_price_list_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cat_trading_discount_plan_item_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cat_price_list_line_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS cpq_trading_contract_item_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS bill_run_report_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS bill_account_amount_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS bill_offer_amount_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS audit_data_log_seq START WITH 1 INCREMENT BY 100;

CREATE SEQUENCE  IF NOT EXISTS audit_data_log_rec_seq START WITH 1 INCREMENT BY 1000;

CREATE SEQUENCE  IF NOT EXISTS audit_data_config_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS product_amount_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS subscription_amount_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS accounting_article_amount_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS electronic_invoice_settings_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS pdp_status_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS pdp_status_history_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS batch_entity_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS advanced_settings_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS edr_versioning_rule_seq;

CREATE SEQUENCE  IF NOT EXISTS mediation_setting_seq;

CREATE SEQUENCE  IF NOT EXISTS billing_invoice_validation_rule_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS iso_icd_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS untdid_2475_vat_payment_option_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS untdid_4451_invoice_subject_code_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS untdid_5305_taxation_category_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS untdid_vatex_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS untdid_4461_payment_means_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS untdid_5189_allowance_code_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS untdid_1001_invoice_code_type_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS ar_customer_balance_seq;

CREATE SEQUENCE  IF NOT EXISTS tech_wo_partition_log_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS tech_rt_partition_log_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS tech_edr_partition_log_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS account_registration_number_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS ar_payment_rejection_code_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS ar_payment_rejection_action_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS ar_payment_rejection_codes_group_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS ar_payment_rejection_action_report_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS payment_term_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS billing_purchase_order_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS adm_endpoint_seq START WITH 1;

CREATE SEQUENCE  IF NOT EXISTS ar_pre_authorization_seq START WITH 1;

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-seq-1', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 5, '9:158a17bc393344d0f2b004d569f63f63', 'createSequence sequenceName=meveo_script_instance_cat_seq; createSequence sequenceName=crm_customer_sequence_seq; createSequence sequenceName=ar_payment_schedule_tmpl_seq; createSequence sequenceName=ar_payment_schedule_inst_seq; createSequence se...', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-115::AndriusKarpavicius
CREATE TABLE adm_country (id BIGINT NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, version INTEGER, country_code VARCHAR(10), description VARCHAR(100), creator VARCHAR(100), updater VARCHAR(100), currency_id BIGINT, language_id BIGINT, description_i18n JSONB, CONSTRAINT adm_country_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-115', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 7, '9:bc4e53fb9f920bf8a73d7046d9c0f7c7', 'createTable tableName=adm_country', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-116::AndriusKarpavicius
CREATE TABLE adm_currency (id BIGINT NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, version INTEGER, currency_code VARCHAR(3) NOT NULL, symbol VARCHAR(255), description_en VARCHAR(255) NOT NULL, system_currency INTEGER, creator VARCHAR(100), updater VARCHAR(100), description_i18n JSONB, CONSTRAINT adm_currency_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-116', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 9, '9:5a2a8d6e3c6569fbec057ee134bfbdd4', 'createTable tableName=adm_currency', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-117::AndriusKarpavicius
CREATE TABLE adm_inbound_req_cookies (inboundrequest_id BIGINT NOT NULL, coockies VARCHAR(500), coockies_key VARCHAR(500) NOT NULL);

ALTER TABLE adm_inbound_req_cookies ADD CONSTRAINT adm_inbound_req_cookies_pkey PRIMARY KEY (inboundrequest_id, coockies_key);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-117', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 11, '9:4a37f7a98435dffed6d07e430eea59b9', 'createTable tableName=adm_inbound_req_cookies; addPrimaryKey constraintName=adm_inbound_req_cookies_pkey, tableName=adm_inbound_req_cookies', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-118::AndriusKarpavicius
CREATE TABLE adm_inbound_req_headers (inboundrequest_id BIGINT NOT NULL, headers TEXT, headers_key VARCHAR(255) NOT NULL);

ALTER TABLE adm_inbound_req_headers ADD CONSTRAINT adm_inbound_req_headers_pkey PRIMARY KEY (inboundrequest_id, headers_key);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-118', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 13, '9:871107611849876aa68a5917adfda000', 'createTable tableName=adm_inbound_req_headers; addPrimaryKey constraintName=adm_inbound_req_headers_pkey, tableName=adm_inbound_req_headers', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-119::AndriusKarpavicius
CREATE TABLE adm_inbound_req_params (inboundrequest_id BIGINT NOT NULL, parameters VARCHAR(1500), parameters_key VARCHAR(255) NOT NULL);

ALTER TABLE adm_inbound_req_params ADD CONSTRAINT adm_inbound_req_params_pkey PRIMARY KEY (inboundrequest_id, parameters_key);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-119', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 15, '9:da0b2576a6de5aa3f7b150caffc1b172', 'createTable tableName=adm_inbound_req_params; addPrimaryKey constraintName=adm_inbound_req_params_pkey, tableName=adm_inbound_req_params', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-120::AndriusKarpavicius
CREATE TABLE adm_inbound_request (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), auth_type VARCHAR(11), content_length INTEGER, content_type VARCHAR(255), method VARCHAR(10), path_info VARCHAR(255), protocol VARCHAR(20), remote_adrr VARCHAR(255), remote_port INTEGER, request_uri VARCHAR(255), resp_content_type VARCHAR(255), resp_encoding VARCHAR(50), scheme VARCHAR(20), creator VARCHAR(100), updater VARCHAR(100), body TEXT, resp_status INTEGER, CONSTRAINT adm_inbound_request_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-120', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 17, '9:f0c8c2df4834a362d3f0e198759cd9f9', 'createTable tableName=adm_inbound_request', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-121::AndriusKarpavicius
CREATE TABLE adm_inbound_resp_cookies (inboundrequest_id BIGINT NOT NULL, responsecoockies VARCHAR(255), responsecoockies_key VARCHAR(255) NOT NULL);

ALTER TABLE adm_inbound_resp_cookies ADD CONSTRAINT adm_inbound_resp_cookies_pkey PRIMARY KEY (inboundrequest_id, responsecoockies_key);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-121', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 19, '9:687b449fb6b9a201ddf89d97b34213cf', 'createTable tableName=adm_inbound_resp_cookies; addPrimaryKey constraintName=adm_inbound_resp_cookies_pkey, tableName=adm_inbound_resp_cookies', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-122::AndriusKarpavicius
CREATE TABLE adm_inbound_resp_headers (inboundrequest_id BIGINT NOT NULL, responseheaders VARCHAR(255), responseheaders_key VARCHAR(255) NOT NULL);

ALTER TABLE adm_inbound_resp_headers ADD CONSTRAINT adm_inbound_resp_headers_pkey PRIMARY KEY (inboundrequest_id, responseheaders_key);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-122', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 21, '9:2254d953646dabc6de09b0a26b9a62a7', 'createTable tableName=adm_inbound_resp_headers; addPrimaryKey constraintName=adm_inbound_resp_headers_pkey, tableName=adm_inbound_resp_headers', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-123::AndriusKarpavicius
CREATE TABLE adm_input_history (input_type VARCHAR(31) NOT NULL, id BIGINT NOT NULL, version INTEGER, end_date TIMESTAMP WITHOUT TIME ZONE, start_date TIMESTAMP WITHOUT TIME ZONE, ignored_tickets INTEGER, name VARCHAR(255), parsed_tickets INTEGER, rejected_tickets INTEGER, succeeded_tickets INTEGER, CONSTRAINT adm_input_history_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-123', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 23, '9:cb0aaa2f427906be5019d483fb91d22b', 'createTable tableName=adm_input_history', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-124::AndriusKarpavicius
CREATE TABLE adm_language (id BIGINT NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, version INTEGER, description_en VARCHAR(100) NOT NULL, language_code VARCHAR(3) NOT NULL, creator VARCHAR(100), updater VARCHAR(100), description_i18n JSONB, CONSTRAINT adm_language_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-124', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 25, '9:427883dcecea63336ce5e983c1642507', 'createTable tableName=adm_language', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-126::AndriusKarpavicius
CREATE TABLE adm_notif_email (email_from VARCHAR(1000), email_to_el VARCHAR(2000), id BIGINT NOT NULL, email_template_id BIGINT, CONSTRAINT adm_notif_email_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-126', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 27, '9:fca206d4141c320658ecb863cb848e45', 'createTable tableName=adm_notif_email', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-127::AndriusKarpavicius
CREATE TABLE adm_notif_email_attach (emailnotification_id BIGINT NOT NULL, attachmentexpressions VARCHAR(255));

ALTER TABLE adm_notif_email_attach ADD CONSTRAINT adm_notif_email_attach_pkey PRIMARY KEY (emailnotification_id, attachmentexpressions);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-127', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 29, '9:50d7f5355622e7216692e24fc4c42ff2', 'createTable tableName=adm_notif_email_attach; addPrimaryKey constraintName=adm_notif_email_attach_pkey, tableName=adm_notif_email_attach', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-128::AndriusKarpavicius
CREATE TABLE adm_notif_email_list (emailnotification_id BIGINT NOT NULL, emails VARCHAR(255));

ALTER TABLE adm_notif_email_list ADD CONSTRAINT adm_notif_email_list_pkey PRIMARY KEY (emailnotification_id, emails);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-128', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 31, '9:390a9e53445b249744b2b5b29c1b44fe', 'createTable tableName=adm_notif_email_list; addPrimaryKey constraintName=adm_notif_email_list_pkey, tableName=adm_notif_email_list', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-129::AndriusKarpavicius
CREATE TABLE adm_notif_email_user (emailnotification_id BIGINT NOT NULL, users_id BIGINT NOT NULL);

ALTER TABLE adm_notif_email_user ADD CONSTRAINT adm_notif_email_user_pkey PRIMARY KEY (emailnotification_id, users_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-129', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 33, '9:2df799a0dce42fa53399f3c780057d60', 'createTable tableName=adm_notif_email_user; addPrimaryKey constraintName=adm_notif_email_user_pkey, tableName=adm_notif_email_user', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-130::AndriusKarpavicius
CREATE TABLE adm_notif_history (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, entity_classname VARCHAR(255) NOT NULL, entity_code VARCHAR(35), nb_retry INTEGER, result VARCHAR(1000), serialized_entity TEXT, status VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), inbound_request_id BIGINT, notification_id BIGINT NOT NULL, CONSTRAINT adm_notif_history_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-130', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 35, '9:3bec12092e704a889e88e4415f2bbbee', 'createTable tableName=adm_notif_history', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-131::AndriusKarpavicius
CREATE TABLE adm_notif_im (id_expression VARCHAR(2000), im_provider_name VARCHAR(20) NOT NULL, message VARCHAR(2000) NOT NULL, id BIGINT NOT NULL, CONSTRAINT adm_notif_im_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-131', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 37, '9:90690be17f3f7a44c17b117ecdcdde6c', 'createTable tableName=adm_notif_im', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-132::AndriusKarpavicius
CREATE TABLE adm_notif_im_list (instantmessagingnotification_id BIGINT NOT NULL, ids VARCHAR(255));

ALTER TABLE adm_notif_im_list ADD CONSTRAINT adm_notif_im_list_pkey PRIMARY KEY (instantmessagingnotification_id, ids);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-132', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 39, '9:a6322984aebe9c1153845dde7ad30173', 'createTable tableName=adm_notif_im_list; addPrimaryKey constraintName=adm_notif_im_list_pkey, tableName=adm_notif_im_list', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-133::AndriusKarpavicius
CREATE TABLE adm_notif_im_user (instantmessagingnotification_id BIGINT NOT NULL, users_id BIGINT NOT NULL);

ALTER TABLE adm_notif_im_user ADD CONSTRAINT adm_notif_im_user_pkey PRIMARY KEY (instantmessagingnotification_id, users_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-133', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 41, '9:fb4ae49f6bc22691359327a5ac3be7e5', 'createTable tableName=adm_notif_im_user; addPrimaryKey constraintName=adm_notif_im_user_pkey, tableName=adm_notif_im_user', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-134::AndriusKarpavicius
CREATE TABLE adm_notif_webhook_header (webhook_id BIGINT NOT NULL, headers TEXT, headers_key VARCHAR(255) NOT NULL);

ALTER TABLE adm_notif_webhook_header ADD CONSTRAINT adm_notif_webhook_header_pkey PRIMARY KEY (webhook_id, headers_key);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-134', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 43, '9:441551428fa156b417ab675335ac0e72', 'createTable tableName=adm_notif_webhook_header; addPrimaryKey constraintName=adm_notif_webhook_header_pkey, tableName=adm_notif_webhook_header', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-135::AndriusKarpavicius
CREATE TABLE adm_notif_webhook_param (webhook_id BIGINT NOT NULL, webhookparams VARCHAR(255), webhookparams_key VARCHAR(255) NOT NULL);

ALTER TABLE adm_notif_webhook_param ADD CONSTRAINT adm_notif_webhookparam_pkey PRIMARY KEY (webhook_id, webhookparams_key);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-135', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 45, '9:c9f714dddb03d4001000f18cdab54afb', 'createTable tableName=adm_notif_webhook_param; addPrimaryKey constraintName=adm_notif_webhookparam_pkey, tableName=adm_notif_webhook_param', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-136::AndriusKarpavicius
CREATE TABLE adm_notif_webhooks (http_host VARCHAR(255) NOT NULL, http_method VARCHAR(255) NOT NULL, http_page VARCHAR(255) NOT NULL, http_protocol VARCHAR(10) NOT NULL, pswd VARCHAR(255), http_port INTEGER, username VARCHAR(255), id BIGINT NOT NULL, body_el VARCHAR(2000), CONSTRAINT adm_notif_webhooks_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-136', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 47, '9:8931bb21a58df9060dfa1b27982de3d4', 'createTable tableName=adm_notif_webhooks', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-137::AndriusKarpavicius
CREATE TABLE adm_notification (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), class_name_filter VARCHAR(255) NOT NULL, event_expression_filter VARCHAR(2000), event_type_filter VARCHAR(25) NOT NULL, creator VARCHAR(100), updater VARCHAR(100), counter_instance_id BIGINT, counter_template_id BIGINT, script_instance_id BIGINT, priority INTEGER DEFAULT 1, run_async INTEGER DEFAULT 0 NOT NULL, cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), save_successful_notif INTEGER DEFAULT 1, CONSTRAINT adm_notification_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-137', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 49, '9:7ff6fcbb89253515f4267bd144e48aa5', 'createTable tableName=adm_notification', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-138::AndriusKarpavicius
CREATE TABLE adm_permission (id BIGINT NOT NULL, name VARCHAR(255) NOT NULL, permission VARCHAR(255) NOT NULL, CONSTRAINT adm_permission_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-138', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 51, '9:f681776cbf424d0e79a9e889bbb71ec4', 'createTable tableName=adm_permission', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-139::AndriusKarpavicius
CREATE TABLE adm_role (id BIGINT NOT NULL, version INTEGER, role_name VARCHAR(255) NOT NULL, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, created TIMESTAMP WITHOUT TIME ZONE DEFAULT NOW() NOT NULL, creator VARCHAR(100), updated TIMESTAMP WITHOUT TIME ZONE, updater VARCHAR(100), role_description VARCHAR(255), CONSTRAINT adm_role_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-139', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 53, '9:f619707c141b6f98cd211cf843da19ad', 'createTable tableName=adm_role', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-140::AndriusKarpavicius
CREATE TABLE adm_role_permission (role_id BIGINT NOT NULL, permission_id BIGINT NOT NULL);

ALTER TABLE adm_role_permission ADD CONSTRAINT adm_role_permission_pkey PRIMARY KEY (role_id, permission_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-140', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 55, '9:675944b2181f93d56cf93df036977269', 'createTable tableName=adm_role_permission; addPrimaryKey constraintName=adm_role_permission_pkey, tableName=adm_role_permission', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-141::AndriusKarpavicius
CREATE TABLE adm_title (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), is_company INTEGER DEFAULT 0, creator VARCHAR(100), updater VARCHAR(100), description_i18n JSONB, CONSTRAINT adm_title_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-141', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 57, '9:09a92563d25a3ff31f11be2faf492ad6', 'createTable tableName=adm_title', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-142::AndriusKarpavicius
CREATE TABLE adm_user (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, username VARCHAR(50), creator VARCHAR(100), updater VARCHAR(100), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, email VARCHAR(100), firstname VARCHAR(100), lastname VARCHAR(100), CONSTRAINT adm_user_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-142', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 59, '9:9c87a094ec494a466894ce018002a0c9', 'createTable tableName=adm_user', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-144::AndriusKarpavicius
CREATE TABLE adm_user_role (user_id BIGINT NOT NULL, role_id BIGINT NOT NULL);

ALTER TABLE adm_user_role ADD CONSTRAINT adm_user_role_pkey PRIMARY KEY (user_id, role_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-144', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 61, '9:c63708b8319d9fcd524f39246e60c5f8', 'createTable tableName=adm_user_role; addPrimaryKey constraintName=adm_user_role_pkey, tableName=adm_user_role', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-145::AndriusKarpavicius
CREATE TABLE ar_account_operation (transaction_type VARCHAR(31) NOT NULL, id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, accounting_code_id BIGINT, account_code_client_side VARCHAR(255), amount numeric(23, 12), due_date date, matching_amount numeric(23, 12), matching_status VARCHAR(255), code VARCHAR(255), description VARCHAR(255), reference VARCHAR(255), transaction_category VARCHAR(255), transaction_date date, un_matching_amount numeric(23, 12), bank_lot TEXT, bank_reference VARCHAR(255), rejected_code VARCHAR(255), rejected_date TIMESTAMP WITHOUT TIME ZONE, rejected_description VARCHAR(255), rejected_type VARCHAR(255), payment_method VARCHAR(255), amount_without_tax numeric(23, 12), billing_account_name VARCHAR(255), invoice_date date, net_to_pay numeric(23, 12), payment_info VARCHAR(255), payment_info1 VARCHAR(255), payment_info2 VARCHAR(255), payment_info3 VARCHAR(255), payment_info4 VARCHAR(255), payment_info5 VARCHAR(255), payment_info6 VARCHAR(255), production_date TIMESTAMP WITHOUT TIME ZONE, tax_amount numeric(23, 12), operation_date TIMESTAMP WITHOUT TIME ZONE, bank_collection_date TIMESTAMP WITHOUT TIME ZONE, deposit_date TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), customer_account_id BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, order_num VARCHAR(500), payment_order VARCHAR(70), payment_fees numeric(23, 12), comment_text TEXT, cf_values JSONB, recorded_invoice_id BIGINT, cat_inv_agregate_id BIGINT, ddrequest_item_id BIGINT, sub_cat_inv_agregate_id BIGINT, pay_schdl_inst_item_id BIGINT, rejected_payment_id BIGINT, seller_id BIGINT, subscription_id BIGINT, dunning_document_id BIGINT, invoice_id BIGINT, collection_date TIMESTAMP WITHOUT TIME ZONE, journal_id BIGINT, status VARCHAR(20), reason VARCHAR(30), accounting_export_file VARCHAR(255), accounting_date TIMESTAMP WITHOUT TIME ZONE, operation_action VARCHAR(255), payment_action VARCHAR(255), payment_deferral_count INTEGER, operation_number BIGINT, transactional_net_to_pay numeric(23, 12), transactional_amount numeric(23, 12), transactional_amount_without_tax numeric(23, 12), transactional_tax_amount numeric(23, 12), transactional_matching_amount numeric(23, 12), transactional_un_matching_amount numeric(23, 12), transactional_currency BIGINT, applied_rate numeric(23, 12), applied_rate_date TIMESTAMP WITHOUT TIME ZONE, transactional_payment_fees numeric(23, 12), error_detail VARCHAR(2000), refunded_payment_id BIGINT, litigation_reason VARCHAR(2000), source_account_operation_id BIGINT, payment_gateway_id BIGINT, rejection_actions_status VARCHAR(30), payment_requests BIGINT DEFAULT 0, origin_call_for_payment_id BIGINT, origin_payment_id BIGINT, is_manual_payment INTEGER, exclude_from_default_balance INTEGER, CONSTRAINT ar_account_operation_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-145', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 63, '9:39afcfeee5592dba5ddc9541d6861d5c', 'createTable tableName=ar_account_operation', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-146::AndriusKarpavicius
CREATE TABLE ar_action_dunning (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, amount_due numeric(19, 2), creaton_date date, from_level VARCHAR(255), status VARCHAR(255), status_date date, to_level VARCHAR(255), action_type VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), action_plan_item_id BIGINT, customer_account_id BIGINT, dunning_lot_id BIGINT, recorded_invoice_id BIGINT, CONSTRAINT ar_action_dunning_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-146', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 65, '9:44e78f1a69ec8a5aa1cc3adec1ed999f', 'createTable tableName=ar_action_dunning', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-148::AndriusKarpavicius
CREATE TABLE ar_bank_operation (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code_op VARCHAR(255), credit numeric(19, 2), date_op TIMESTAMP WITHOUT TIME ZONE, date_val TIMESTAMP WITHOUT TIME ZONE, debit numeric(19, 2), error_cause VARCHAR(255), file_name VARCHAR(255), invoice_id VARCHAR(255), is_valid INTEGER DEFAULT 0 NOT NULL, label_1 VARCHAR(255), label_2 VARCHAR(255), label_3 VARCHAR(255), reference VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT ar_bank_operation_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-148', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 67, '9:42d1bcbb9a5efac62f16e9c9bd9d0cbb', 'createTable tableName=ar_bank_operation', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-149::AndriusKarpavicius
CREATE TABLE ar_customer_account (credit_category VARCHAR(255), date_dunning_level TIMESTAMP WITHOUT TIME ZONE, date_status TIMESTAMP WITHOUT TIME ZONE, dunning_level VARCHAR(255), pswd VARCHAR(10), status VARCHAR(10), id BIGINT NOT NULL, customer_id BIGINT, trading_currency_id BIGINT NOT NULL, trading_language_id BIGINT NOT NULL, credit_category_id BIGINT, due_date_delay_el VARCHAR(2000), excluded_from_payment INTEGER DEFAULT 0, crm_address_book_id BIGINT, minimum_target_account_id BIGINT, invoicing_threshold numeric(23, 12), check_threshold VARCHAR(25), threshold_per_entity INTEGER DEFAULT 0, minimum_article_id BIGINT, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), address_1 VARCHAR(255), address_2 VARCHAR(255), address_3 VARCHAR(255), address_4 VARCHAR(255), address_5 VARCHAR(255), address_city VARCHAR(100), address_country_id BIGINT, address_state VARCHAR(50), address_zipcode VARCHAR(20), default_level INTEGER DEFAULT 1, external_ref_1 VARCHAR(255), external_ref_2 VARCHAR(255), firstname VARCHAR(100), lastname VARCHAR(100), provider_contact VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), title_id BIGINT, primary_contact BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, bam_id BIGINT, cf_values JSONB, job_title VARCHAR(255), email VARCHAR(2000), fax VARCHAR(50), mobile VARCHAR(100), phone VARCHAR(100), vat_no VARCHAR(100), vat_status VARCHAR(25) DEFAULT 'UNKNOWN', minimum_amount_el VARCHAR(2000), minimum_label_el VARCHAR(2000), minimum_charge_template_id BIGINT, company INTEGER DEFAULT 0, legal_entity_type_id BIGINT, general_client_account_id BIGINT, CONSTRAINT ar_customer_account_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-149', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 69, '9:eb8ccb47aeb947a3e80051ae10ec8833', 'createTable tableName=ar_customer_account', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-150::AndriusKarpavicius
CREATE TABLE ar_ddrequest_item (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, amount numeric(23, 12), amount_invoices numeric(23, 12), billing_account_name VARCHAR(255), due_date date, payment_info VARCHAR(255), payment_info1 VARCHAR(255), payment_info2 VARCHAR(255), payment_info3 VARCHAR(255), payment_info4 VARCHAR(255), payment_info5 VARCHAR(255), payment_info6 VARCHAR(255), reference VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), payment_id BIGINT, ddrequest_lot_id BIGINT, error_msg VARCHAR(1000), refund_id BIGINT, rejected_file_name VARCHAR(1000), thread_name VARCHAR(255), CONSTRAINT ar_ddrequest_item_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-150', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 71, '9:c851df7b5844bea567bc01912d34d4c0', 'createTable tableName=ar_ddrequest_item', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-151::AndriusKarpavicius
CREATE TABLE ar_ddrequest_lot (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, file_name TEXT, invoice_amount numeric(23, 12), invoice_number INTEGER, is_payment_created INTEGER DEFAULT 0 NOT NULL, return_file_name VARCHAR(255), return_status_code VARCHAR(255), send_date TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), rejected_cause VARCHAR(255), rejected_invoices INTEGER, ddrequest_builder_id BIGINT, payment_or_refund VARCHAR(30), seller_id BIGINT, CONSTRAINT ar_ddrequest_lot_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-151', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 73, '9:cb9451a5f1648df7e8a27301b9da83b9', 'createTable tableName=ar_ddrequest_lot', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-152::AndriusKarpavicius
CREATE TABLE ar_ddrequest_lot_op (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, ddrequest_op VARCHAR(255), error_cause VARCHAR(255), from_due_date TIMESTAMP WITHOUT TIME ZONE, ddrequest_op_status VARCHAR(255), to_due_date TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), ddrequest_lot_id BIGINT, ddrequest_builder_id BIGINT, filter_id BIGINT, script_instance_id BIGINT, recurrent INTEGER DEFAULT 0, payment_or_refund VARCHAR(30), seller_id BIGINT, generate_payment_lines INTEGER DEFAULT 1, payment_status VARCHAR(25), create_matching INTEGER DEFAULT 1, CONSTRAINT ar_ddrequest_lot_op_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-152', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 75, '9:baf402b0dc367668f53185c8c637c2d2', 'createTable tableName=ar_ddrequest_lot_op', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-153::AndriusKarpavicius
CREATE TABLE ar_due_date (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, due_date date, invoice_amount numeric(23, 12), invoice_number INTEGER, payment_method VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT ar_due_date_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-153', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 77, '9:8bcdf1cb4b997c90650eed7bd3de5aa0', 'createTable tableName=ar_due_date', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-154::AndriusKarpavicius
CREATE TABLE ar_dunning_lot (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, action_type VARCHAR(255), file_name VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), dunning_history_id BIGINT, CONSTRAINT ar_dunning_lot_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-154', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 79, '9:67530eab6b2ec5ab4327273b0dc3ee2c', 'createTable tableName=ar_dunning_lot', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-157::AndriusKarpavicius
CREATE TABLE ar_matching_amount (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, matching_amount numeric(23, 12), transactional_matching_amount numeric(23, 12), creator VARCHAR(100), updater VARCHAR(100), account_operation_id BIGINT, matching_code_id BIGINT, CONSTRAINT ar_matching_amount_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-157', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 81, '9:37bda824803d0f96fb770f45ba222d30', 'createTable tableName=ar_matching_amount', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-158::AndriusKarpavicius
CREATE TABLE ar_matching_code (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255), matching_amount_credit numeric(23, 12), matching_amount_debit numeric(23, 12), transactional_matching_amount_credit numeric(23, 12), transactional_matching_amount_debit numeric(23, 12), matching_date date, matching_type VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT ar_matching_code_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-158', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 83, '9:2e783dded67402c41c922f5ce54f5baf', 'createTable tableName=ar_matching_code', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-4950-20220209-rebuild::MohammedSTITANE
CREATE TABLE ar_accounting_scheme (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), code VARCHAR(255) NOT NULL, description VARCHAR(255), long_description VARCHAR(2000), long_description_i18n JSONB, script_instance_id BIGINT, CONSTRAINT ar_accounting_scheme_pkey PRIMARY KEY (id), CONSTRAINT ar_accounting_scheme_pkey_unique UNIQUE (code));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-4950-20220209-rebuild', 'MohammedSTITANE', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 85, '9:70075655ba54fcb91b1b42f978a7f239', 'createTable tableName=ar_accounting_scheme', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-159::AndriusKarpavicius
CREATE TABLE ar_occ_template (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, accounting_code_id BIGINT, account_code_client_side VARCHAR(255), code VARCHAR(255), description VARCHAR(255), occ_category VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), journal_id BIGINT, accounting_scheme_id BIGINT, contra_accounting_code_id BIGINT, contra_accounting_code2_id BIGINT, manual_creation_enabled INTEGER DEFAULT 1, CONSTRAINT ar_occ_template_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-159', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 87, '9:52bb7df4d752b319a2fc2efa09916f8d', 'createTable tableName=ar_occ_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-160::AndriusKarpavicius
CREATE TABLE bi_job (id BIGINT NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, version INTEGER, active INTEGER DEFAULT 0 NOT NULL, job_frequency INTEGER, job_repository_id INTEGER, last_execution_date TIMESTAMP WITHOUT TIME ZONE, name VARCHAR(50), next_execution_date TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT bi_job_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-160', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 89, '9:a8e2c1e4269f65b713aac00fbbfcc643', 'createTable tableName=bi_job', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-161::AndriusKarpavicius
CREATE TABLE bi_job_history (history_type VARCHAR(31) NOT NULL, id BIGINT NOT NULL, version INTEGER, execution_date TIMESTAMP WITHOUT TIME ZONE, lines_inserted INTEGER, lines_read INTEGER, lines_rejected INTEGER, file_name VARCHAR(255), nb_subscriptions INTEGER, nb_subscriptions_created INTEGER, nb_subscriptions_error INTEGER, nb_subscriptions_ignored INTEGER, nb_subscriptions_terminated INTEGER, nb_billing_accounts INTEGER, nb_billing_accounts_created INTEGER, nb_billing_accounts_error INTEGER, nb_billing_accounts_ignored INTEGER, nb_billing_accounts_warning INTEGER, nb_user_accounts INTEGER, nb_user_accounts_created INTEGER, nb_user_accounts_error INTEGER, nb_user_acounts_ignored INTEGER, nb_user_acounts_warning INTEGER, nb_customer_accounts INTEGER, nb_customer_accounts_created INTEGER, nb_customer_accounts_error INTEGER, nb_customer_acounts_ignored INTEGER, nb_customer_acounts_warning INTEGER, nb_customers INTEGER, nb_customers_created INTEGER, nb_customers_error INTEGER, nb_customers_ignored INTEGER, nb_customers_warning INTEGER, nb_sellers INTEGER, nb_sellers_created INTEGER, nb_sellers_error INTEGER, nb_sellers_ignored INTEGER, nb_sellers_warning INTEGER, nb_invoices_ignored INTEGER, job_id BIGINT, CONSTRAINT bi_job_history_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-161', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 91, '9:97b9503b76f3902decf5758b363c0f3c', 'createTable tableName=bi_job_history', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-162::AndriusKarpavicius
CREATE TABLE bi_report (id BIGINT NOT NULL, version INTEGER, action_name VARCHAR(255), description VARCHAR(255), end_date TIMESTAMP WITHOUT TIME ZONE, execution_day_of_month INTEGER, execution_day_of_week INTEGER, execution_hour INTEGER, execution_interval_minutes INTEGER, execution_interval_seconds INTEGER, execution_minutes INTEGER, report_file_name VARCHAR(255), report_frequency VARCHAR(255) NOT NULL, name VARCHAR(50), output_format VARCHAR(255) NOT NULL, producer_class_name VARCHAR(255), ds_record_path VARCHAR(255), schedule TIMESTAMP WITHOUT TIME ZONE, start_date TIMESTAMP WITHOUT TIME ZONE, CONSTRAINT bi_report_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-162', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 93, '9:628a2d70e00b8883fc3b61f1175fc378', 'createTable tableName=bi_report', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-163::AndriusKarpavicius
CREATE TABLE bi_report_emails (report_id BIGINT NOT NULL, email_id BIGINT NOT NULL);

ALTER TABLE bi_report_emails ADD CONSTRAINT bi_report_emails_pkey PRIMARY KEY (report_id, email_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-163', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 95, '9:801dcd25e0be1266086506bedac22d2d', 'createTable tableName=bi_report_emails; addPrimaryKey constraintName=bi_report_emails_pkey, tableName=bi_report_emails', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-164::AndriusKarpavicius
CREATE TABLE billing_billing_account (br_amount_with_tax numeric(23, 12), br_amount_without_tax numeric(23, 12), discount_rate numeric(23, 12), electronic_billing INTEGER DEFAULT 0, invoice_prefix VARCHAR(255), next_invoice_date TIMESTAMP WITHOUT TIME ZONE, status VARCHAR(10), status_date TIMESTAMP WITHOUT TIME ZONE, subscription_date TIMESTAMP WITHOUT TIME ZONE, termination_date TIMESTAMP WITHOUT TIME ZONE, id BIGINT NOT NULL, billing_cycle BIGINT, billing_run BIGINT, customer_account_id BIGINT, termin_reason_id BIGINT, trading_country_id BIGINT NOT NULL, trading_language_id BIGINT NOT NULL, trading_currency_id BIGINT NOT NULL, invoicing_threshold numeric(23, 12), mailing_type VARCHAR(255), cced_emails VARCHAR(2000), email_template_id BIGINT, minimum_invoice_sub_category_id BIGINT, tax_category_id BIGINT, check_threshold VARCHAR(25), payment_method_id BIGINT, threshold_per_entity INTEGER DEFAULT 0, minimum_article_id BIGINT, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), address_1 VARCHAR(255), address_2 VARCHAR(255), address_3 VARCHAR(255), address_4 VARCHAR(255), address_5 VARCHAR(255), address_city VARCHAR(100), address_country_id BIGINT, address_state VARCHAR(50), address_zipcode VARCHAR(20), default_level INTEGER DEFAULT 1, external_ref_1 VARCHAR(255), external_ref_2 VARCHAR(255), firstname VARCHAR(100), lastname VARCHAR(100), provider_contact VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), title_id BIGINT, primary_contact BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, bam_id BIGINT, cf_values JSONB, job_title VARCHAR(255), email VARCHAR(2000), fax VARCHAR(50), mobile VARCHAR(100), phone VARCHAR(100), vat_no VARCHAR(100), vat_status VARCHAR(25) DEFAULT 'UNKNOWN', minimum_amount_el VARCHAR(2000), minimum_label_el VARCHAR(2000), minimum_charge_template_id BIGINT, company INTEGER DEFAULT 0, legal_entity_type_id BIGINT, exemption_reason VARCHAR(2000), price_list_id BIGINT, mrr numeric(23, 12), CONSTRAINT billing_billing_account_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-164', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 97, '9:48f1afe6a1bb67b4eb97e28ff2a686f5', 'createTable tableName=billing_billing_account', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-165::AndriusKarpavicius
CREATE TABLE billing_billing_run (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, nb_invoice INTEGER, nb_billable_billing_account INTEGER, nb_billing_account INTEGER, end_date TIMESTAMP WITHOUT TIME ZONE, pr_amount_tax numeric(23, 12), pr_amount_with_tax numeric(23, 12), pr_amount_without_tax numeric(23, 12), process_date TIMESTAMP WITHOUT TIME ZONE, process_type VARCHAR(255), producible_amount_tax numeric(23, 12), producible_amount_with_tax numeric(23, 12), producible_amount_without_tax numeric(23, 12), nb_producible_invoice INTEGER, rejection_reason VARCHAR(255), selected_billing_accounts TEXT, start_date TIMESTAMP WITHOUT TIME ZONE, status VARCHAR(255), status_date TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), billing_cycle_id BIGINT, pr_country_id BIGINT, pr_currency_id BIGINT, pr_language_id BIGINT, invoice_date TIMESTAMP WITHOUT TIME ZONE, last_transaction_date TIMESTAMP WITHOUT TIME ZONE, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, reference_date VARCHAR(255), collection_date TIMESTAMP WITHOUT TIME ZONE, compute_dates_validation INTEGER DEFAULT 0, skip_validation_script INTEGER DEFAULT 0, suspect_auto_action VARCHAR(255), reject_auto_action VARCHAR(255), next_billing_run_id BIGINT, origin_billing_run_id BIGINT, minimum_applied INTEGER DEFAULT 0, threshold_checked INTEGER DEFAULT 0, discount_applied INTEGER DEFAULT 0, filters JSONB, invoice_type_id BIGINT, run_type VARCHAR(255), xml_job_execution_result_id BIGINT, pdf_job_execution_result_id BIGINT, is_quarantine INTEGER DEFAULT 0, description_i18n JSONB, generate_ao INTEGER DEFAULT 0 NOT NULL, disable_aggregation INTEGER DEFAULT 0 NOT NULL, use_accounting_article_label INTEGER DEFAULT 0 NOT NULL, date_aggregation VARCHAR(255) DEFAULT 'MONTH_OF_USAGE_DATE' NOT NULL, aggregate_unit_amounts INTEGER DEFAULT 0 NOT NULL, ignore_subscriptions INTEGER DEFAULT 1 NOT NULL, ignore_orders INTEGER DEFAULT 1 NOT NULL, incremental_invoice_lines INTEGER DEFAULT 0 NOT NULL, discount_aggregation VARCHAR(17) DEFAULT 'FULL_AGGREGATION' NOT NULL, disabled INTEGER DEFAULT 0 NOT NULL, pre_report_auto_on_create INTEGER DEFAULT 0, pre_invoicing_report_id BIGINT, pre_report_auto_on_invoice_line_job INTEGER DEFAULT 0, application_el VARCHAR(2000), ignore_user_accounts INTEGER DEFAULT 1, ignore_service_instances INTEGER DEFAULT 1, CONSTRAINT billing_billing_run_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-165', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 99, '9:bc73e641c3c19f3d5f5d3ce7b85d7818', 'createTable tableName=billing_billing_run', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-166::AndriusKarpavicius
CREATE TABLE billing_billing_run_list (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, rated_amount2_without_tax numeric(23, 12), rated_amount_tax numeric(23, 12), rated_amount_with_tax numeric(23, 12), rated_amount_without_tax numeric(23, 12), invoice INTEGER, creator VARCHAR(100), updater VARCHAR(100), billing_account_id BIGINT, billing_run_id BIGINT, CONSTRAINT billing_billing_run_list_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-166', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 101, '9:52f77918aaef1fe6cf9e339c15e532bc', 'createTable tableName=billing_billing_run_list', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-167::AndriusKarpavicius
CREATE TABLE billing_charge_instance (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), amount_with_tax numeric(23, 12), amount_without_tax numeric(23, 12), charge_date TIMESTAMP WITHOUT TIME ZONE, criteria_1 VARCHAR(255), criteria_2 VARCHAR(255), criteria_3 VARCHAR(255), is_prepaid INTEGER DEFAULT 0, status VARCHAR(255), status_date TIMESTAMP WITHOUT TIME ZONE, termination_date TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), charge_template_id BIGINT, trading_country BIGINT NOT NULL, trading_currency BIGINT NOT NULL, seller_id BIGINT NOT NULL, subscription_id BIGINT, invoicing_calendar_id BIGINT, user_account_id BIGINT NOT NULL, order_number VARCHAR(100), charge_type VARCHAR(5), quantity numeric(23, 12), product_instance_id BIGINT, next_charge_date TIMESTAMP WITHOUT TIME ZONE, subscription_date TIMESTAMP WITHOUT TIME ZONE, service_instance_id BIGINT, counter_id BIGINT, rating_unit_description VARCHAR(20), priority INTEGER DEFAULT 1, cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), calendar_id BIGINT, apply_in_advance INTEGER, charged_to_date TIMESTAMP WITHOUT TIME ZONE, charge_to_date_on_termination TIMESTAMP WITHOUT TIME ZONE, reactivation_date TIMESTAMP WITHOUT TIME ZONE, apply_discounts_on_overriden_price INTEGER, overcharged_unit_amount_without_tax numeric(23, 12), anticipate_end_of_subscription INTEGER DEFAULT 0, CONSTRAINT billing_charge_instance_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-167', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 103, '9:5325a151f6c36e8de78c0bea9037d28a', 'createTable tableName=billing_charge_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-168::AndriusKarpavicius
CREATE TABLE billing_chrginst_wallet (chrg_instance_id BIGINT NOT NULL, wallet_instance_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE billing_chrginst_wallet ADD CONSTRAINT billing_chrginst_wallet_pkey PRIMARY KEY (chrg_instance_id, indx);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-168', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 105, '9:ed0c1065287b7fa54ba2c74e8369c1fb', 'createTable tableName=billing_chrginst_wallet; addPrimaryKey constraintName=billing_chrginst_wallet_pkey, tableName=billing_chrginst_wallet', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-169::AndriusKarpavicius
CREATE TABLE billing_counter (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), billing_account_id BIGINT, counter_template_id BIGINT, user_account_id BIGINT, subscription_id BIGINT, service_instance_id BIGINT, customer_id BIGINT, customer_account_id BIGINT, CONSTRAINT billing_counter_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-169', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 107, '9:bec0d4549518a6db84ebcfc8a9d13efb', 'createTable tableName=billing_counter', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-170::AndriusKarpavicius
CREATE TABLE billing_counter_period (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), counter_type VARCHAR(255), level_num numeric(35, 12), period_end_date TIMESTAMP WITHOUT TIME ZONE, period_start_date TIMESTAMP WITHOUT TIME ZONE, value numeric(35, 12), creator VARCHAR(100), updater VARCHAR(100), counter_instance_id BIGINT, notification_levels VARCHAR(100), is_accumulator INTEGER DEFAULT 0, accumulator_type VARCHAR(35), shared_counter INTEGER DEFAULT 0, CONSTRAINT billing_counter_period_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-170', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 109, '9:4ec28a9c41ac683cee4f78e730d37f04', 'createTable tableName=billing_counter_period', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-171::AndriusKarpavicius
CREATE TABLE billing_cycle (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), calendar BIGINT, invoicing_threshold numeric(23, 12), invoice_type_id BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, due_date_delay_el VARCHAR(2000), cf_values JSONB, billing_template_name_el VARCHAR(2000), invoice_type_el VARCHAR(2000), billing_cycle_type VARCHAR(256) NOT NULL, script_instance_id BIGINT, reference_date VARCHAR(255), check_threshold VARCHAR(25), transaction_date_delay_el VARCHAR(2000), invoice_date_production_delay_el VARCHAR(2000), invoice_date_delay_el VARCHAR(2000), transaction_date_el VARCHAR(2000), split_per_payment_method INTEGER DEFAULT 0, threshold_per_entity INTEGER DEFAULT 0, description_i18n JSONB, collection_date_delay_el VARCHAR(2000), compute_dates_validation INTEGER DEFAULT 0, billing_run_validation_script_id BIGINT, filters JSONB, priority INTEGER DEFAULT 0, disable_aggregation INTEGER DEFAULT 0 NOT NULL, use_accounting_article_label INTEGER DEFAULT 0 NOT NULL, date_aggregation VARCHAR(255) DEFAULT 'NO_DATE_AGGREGATION' NOT NULL, aggregate_unit_amounts INTEGER DEFAULT 0 NOT NULL, ignore_subscriptions INTEGER DEFAULT 1 NOT NULL, ignore_orders INTEGER DEFAULT 1 NOT NULL, incremental_invoice_lines INTEGER DEFAULT 0 NOT NULL, discount_aggregation VARCHAR(17) DEFAULT 'FULL_AGGREGATION' NOT NULL, application_el VARCHAR(2000), report_config_pre_report_auto_on_create INTEGER DEFAULT 0, report_config_pre_report_auto_on_invoice_lines_job INTEGER DEFAULT 0, report_config_display_billing_accounts INTEGER DEFAULT 1, report_config_display_subscriptions INTEGER DEFAULT 1, report_config_display_offers INTEGER DEFAULT 1, report_config_display_products INTEGER DEFAULT 1, report_config_display_articles INTEGER DEFAULT 1, report_config_block_size_billing_accounts INTEGER DEFAULT 10, report_config_block_size_subscriptions INTEGER DEFAULT 10, report_config_block_size_offers INTEGER DEFAULT 10, report_config_block_size_products INTEGER DEFAULT 10, report_config_block_size_articles INTEGER DEFAULT 10, ignore_user_accounts INTEGER DEFAULT 1, ignore_service_instances INTEGER DEFAULT 1, CONSTRAINT billing_cycle_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-171', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 111, '9:57b62f19960a6ae9cd3625c4ff259436', 'createTable tableName=billing_cycle', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-172::AndriusKarpavicius
CREATE TABLE billing_discount (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, discount_code VARCHAR(20), pourcent numeric(19, 2), pr_description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT billing_discount_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-172', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 113, '9:3ac4a839bc704a0955fcaec3847f9937', 'createTable tableName=billing_discount', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-173::AndriusKarpavicius
CREATE TABLE billing_discount_language (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), discount_id BIGINT, trading_language_id BIGINT, CONSTRAINT billing_discount_language_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-173', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 115, '9:3f87dba688a309790da703fe2301c250', 'createTable tableName=billing_discount_language', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-174::AndriusKarpavicius
CREATE TABLE billing_discplan_inst (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, charge_code VARCHAR(255), end_subscription_date TIMESTAMP WITHOUT TIME ZONE, nb_period INTEGER, pourcent numeric(19, 2), start_subscription_date TIMESTAMP WITHOUT TIME ZONE, usage_type INTEGER, creator VARCHAR(100), updater VARCHAR(100), billing_account_id BIGINT, CONSTRAINT billing_discplan_inst_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-174', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 117, '9:ee6497d2a0fdca5da183d48ff052376a', 'createTable tableName=billing_discplan_inst', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-176::AndriusKarpavicius
CREATE TABLE billing_invoice (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, alias VARCHAR(255), amount numeric(23, 12), amount_tax numeric(23, 12), amount_with_tax numeric(23, 12), amount_without_tax numeric(23, 12), comment_text VARCHAR(1200), discount numeric(23, 12), due_date TIMESTAMP WITHOUT TIME ZONE, iban VARCHAR(255), invoice_date TIMESTAMP WITHOUT TIME ZONE, invoice_number VARCHAR(50), net_to_pay numeric(23, 12), payment_method VARCHAR(255), product_date TIMESTAMP WITHOUT TIME ZONE, temporary_invoice_number VARCHAR(60), creator VARCHAR(100), updater VARCHAR(100), billing_account_id BIGINT, billing_run_id BIGINT, recorded_invoice_id BIGINT, trading_country_id BIGINT, trading_currency_id BIGINT, trading_language_id BIGINT, detailed_invoice INTEGER DEFAULT 1 NOT NULL, invoice_id BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, invoice_type_id BIGINT, quote_id BIGINT, cf_values JSONB, pdf_filename VARCHAR(255), xml_filename VARCHAR(255), payment_method_id BIGINT, due_balance numeric(23, 12), seller_id BIGINT NOT NULL, subscription_id BIGINT, order_id BIGINT, already_sent INTEGER DEFAULT 0 NOT NULL, dont_send INTEGER DEFAULT 0 NOT NULL, prepaid INTEGER DEFAULT 0 NOT NULL, status VARCHAR(50), external_ref VARCHAR(255), initial_collection_date TIMESTAMP WITHOUT TIME ZONE, reject_reason VARCHAR(255), status_date TIMESTAMP WITHOUT TIME ZONE, xml_date TIMESTAMP WITHOUT TIME ZONE, pdf_date TIMESTAMP WITHOUT TIME ZONE, discount_amount numeric(23, 12) NOT NULL, discount_rate numeric(3, 3), is_already_applied_minimum INTEGER, is_already_added_discount INTEGER, email_sent_date TIMESTAMP WITHOUT TIME ZONE, payment_status VARCHAR(255), payment_status_date TIMESTAMP WITHOUT TIME ZONE, start_date TIMESTAMP WITHOUT TIME ZONE, end_date TIMESTAMP WITHOUT TIME ZONE, raw_amount numeric(23, 12) NOT NULL, new_invoicing_process INTEGER DEFAULT 0 NOT NULL, has_taxes INTEGER DEFAULT 0, has_discounts INTEGER DEFAULT 0, has_minimum INTEGER DEFAULT 0, commercial_order_id BIGINT, discount_plan_id BIGINT, cpq_quote_id BIGINT, amount_without_tax_before_discount numeric(23, 12), is_reminder_level_triggered INTEGER DEFAULT 0, related_dunning_collection_plan_id BIGINT, dunning_collection_plan_triggered INTEGER DEFAULT 0, last_applied_rate numeric(23, 12), last_applied_rate_date TIMESTAMP WITHOUT TIME ZONE, transactional_amount_without_tax numeric(23, 12), transactional_amount_with_tax numeric(23, 12), transactional_amount_tax numeric(23, 12), transactional_net_to_pay numeric(23, 12), transactional_raw_amount numeric(23, 12), transactional_discount_amount numeric(23, 12), transactional_amount_without_tax_before_discount numeric(23, 12), payment_plan_id BIGINT, open_order_number VARCHAR(255), invoice_balance numeric(23, 12), use_current_rate INTEGER DEFAULT 0, invoice_validation_rule_id BIGINT, transactional_invoice_balance numeric(23, 12), use_specific_price_conversion INTEGER DEFAULT 0, conversion_from_billing_currency INTEGER DEFAULT 0, auto_matching INTEGER DEFAULT 0, external_purchase_order_number VARCHAR(100), ubl_reference INTEGER DEFAULT 0, sips_batch_archive_name VARCHAR(255), pdp_status_id BIGINT, certificate_uncollectibility_number VARCHAR(50), dunning_collection_plan_id BIGINT, CONSTRAINT billing_invoice_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-176', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 119, '9:161affcd166ae8f3ef1aca65a42496c9', 'createTable tableName=billing_invoice', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-177::AndriusKarpavicius
CREATE TABLE billing_invoice_agregate (type VARCHAR(31) NOT NULL, id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, accounting_code_id BIGINT, amount numeric(23, 12), amount_tax numeric(23, 12), amount_with_tax numeric(23, 12), amount_without_tax numeric(23, 12), description VARCHAR(255), description_discount VARCHAR(255), discount numeric(23, 12), discount_aggregate INTEGER DEFAULT 0 NOT NULL, item_number INTEGER, pr_description VARCHAR(255), quantity numeric(19, 2), tax_percent numeric(23, 12), creator VARCHAR(100), updater VARCHAR(100), billing_account_id BIGINT, billing_run_id BIGINT, invoice_id BIGINT, trading_country_id BIGINT, trading_currency_id BIGINT, trading_language_id BIGINT, user_account_id BIGINT, tax_id BIGINT, category_invoice_agregate BIGINT, invoicesubcategory BIGINT, sub_category_tax BIGINT, tax_invoice_agregate BIGINT, wallet_id BIGINT, invoicecategory BIGINT, discount_percent numeric(23, 12), sub_cat_invoice_agregate_id BIGINT, discount_plan_code VARCHAR(50), discount_plan_item_code VARCHAR(50), discount_plan_item_id BIGINT, transactional_amount_without_tax numeric(23, 12), transactional_amount_with_tax numeric(23, 12), transactional_amount_tax numeric(23, 12), use_specific_price_conversion INTEGER DEFAULT 0, conversion_from_billing_currency INTEGER DEFAULT 0, CONSTRAINT billing_invoice_agregate_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-177', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 121, '9:2c9aac8ae6c907e50ac061662f240797', 'createTable tableName=billing_invoice_agregate', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-178::AndriusKarpavicius
CREATE TABLE billing_invoice_cat (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), sort_index INTEGER, creator VARCHAR(100), updater VARCHAR(100), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, description_i18n JSONB, occ_template_id BIGINT, occ_templ_negative_id BIGINT, CONSTRAINT billing_invoice_cat_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-178', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 123, '9:edc63fbbd2a9eb3a648296819e592ba2', 'createTable tableName=billing_invoice_cat', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-180::AndriusKarpavicius
CREATE TABLE billing_invoice_cat_lang (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), invoice_category_id BIGINT, trading_language_id BIGINT, CONSTRAINT billing_invoice_cat_lang_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-180', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 125, '9:03d1c1e42a6abbd7890e6c251e8c69b3', 'createTable tableName=billing_invoice_cat_lang', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-181::AndriusKarpavicius
CREATE TABLE billing_invoice_sub_cat (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), accounting_code_id BIGINT, discount numeric(19, 2), creator VARCHAR(100), updater VARCHAR(100), invoice_category_id BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, description_i18n JSONB, tax_script_instance_id BIGINT, occ_template_id BIGINT, occ_templ_negative_id BIGINT, sort_index INTEGER, CONSTRAINT billing_invoice_sub_cat_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-181', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 127, '9:74de8a9aa4d16d01ef9b2e48f7a4a74f', 'createTable tableName=billing_invoice_sub_cat', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-182::AndriusKarpavicius
CREATE TABLE billing_invoice_template (id BIGINT NOT NULL, version INTEGER, code VARCHAR(255) NOT NULL, file_name VARCHAR(255) NOT NULL, template_version VARCHAR(255) NOT NULL, validity_end_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, validity_start_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, CONSTRAINT billing_invoice_template_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-182', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 129, '9:c457e6de924f178104f135531fe43d01', 'createTable tableName=billing_invoice_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-184::AndriusKarpavicius
CREATE TABLE billing_priceplan_inst (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, amount_without_tax numeric(19, 2), charge_code VARCHAR(255), end_event_date TIMESTAMP WITHOUT TIME ZONE, end_subscription_date TIMESTAMP WITHOUT TIME ZONE, pr_amount_without_tax numeric(19, 2), start_event_date TIMESTAMP WITHOUT TIME ZONE, start_subscription_date TIMESTAMP WITHOUT TIME ZONE, stringcriteria1 VARCHAR(255), stringcriteria2 VARCHAR(255), stringcriteria3 VARCHAR(255), subscription_age_max_in_month TIMESTAMP WITHOUT TIME ZONE, subscription_age_min_in_month TIMESTAMP WITHOUT TIME ZONE, usage_type INTEGER, creator VARCHAR(100), updater VARCHAR(100), billing_account_id BIGINT, trading_currency_id BIGINT, CONSTRAINT billing_priceplan_inst_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-184', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 131, '9:21d07491d48b763b9d2a67389c2a03fc', 'createTable tableName=billing_priceplan_inst', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-185::AndriusKarpavicius
CREATE TABLE billing_rated_transaction (id BIGINT NOT NULL, version INTEGER, amount_tax numeric(23, 12), amount_with_tax numeric(23, 12), amount_without_tax numeric(23, 12), code VARCHAR(255), description VARCHAR(4000), do_not_trigger_invoicing INTEGER DEFAULT 0 NOT NULL, parameter_1 VARCHAR(255), parameter_2 VARCHAR(255), parameter_3 VARCHAR(255), quantity numeric(23, 12), status VARCHAR(255), unit_amount_tax numeric(23, 12), unit_amount_with_tax numeric(23, 12), unit_amount_without_tax numeric(23, 12), unity_description VARCHAR(20), usage_date TIMESTAMP WITHOUT TIME ZONE, billing_account__id BIGINT, billing_run_id BIGINT, invoice_id BIGINT, aggregate_id_f BIGINT, aggregate_id_r BIGINT, aggregate_id_t BIGINT, invoice_sub_category_id BIGINT, priceplan_id BIGINT, wallet_id BIGINT, edr_id BIGINT, adjusted_rated_tx BIGINT, order_number VARCHAR(100), rating_unit_description VARCHAR(20), parameter_extra VARCHAR(4000), start_date TIMESTAMP WITHOUT TIME ZONE, end_date TIMESTAMP WITHOUT TIME ZONE, subscription_id BIGINT, seller_id BIGINT NOT NULL, charge_instance_id BIGINT, tax_id BIGINT NOT NULL, tax_percent numeric(23, 12) NOT NULL, user_account_id BIGINT, offer_id BIGINT, service_instance_id BIGINT, creator VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE, updater VARCHAR(100), updated TIMESTAMP WITHOUT TIME ZONE, tax_class_id BIGINT, input_quantity numeric(23, 12), raw_amount_without_tax numeric(23, 12), raw_amount_with_tax numeric(23, 12), input_unitofmeasure BIGINT, rating_unitofmeasure BIGINT, accounting_code_id BIGINT, sort_index INTEGER, cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), type VARCHAR(25), accounting_article_id BIGINT, order_id BIGINT, order_lot_id BIGINT, product_version_id BIGINT, order_product_id BIGINT, invoice_line_id BIGINT, discount_plan_id BIGINT, discounted_ratedtransaction_id BIGINT, discount_value numeric(23, 12), discount_plan_type VARCHAR(50), discount_plan_item_id BIGINT, invoicing_date TIMESTAMP WITHOUT TIME ZONE, sequence INTEGER, reject_reason VARCHAR(4000), origin_billing_account BIGINT, rules_contract_id BIGINT, origin_ratedtransaction_id BIGINT, use_specific_price_conversion INTEGER DEFAULT 0 NOT NULL, transactional_amount_without_tax numeric(23, 12), transactional_amount_with_tax numeric(23, 12), transactional_amount_tax numeric(23, 12), transactional_unit_amount_without_tax numeric(23, 12), transactional_unit_amount_with_tax numeric(23, 12), transactional_unit_amount_tax numeric(23, 12), trading_currency_id BIGINT, discounted_amount numeric(23, 12), business_key VARCHAR(255), contract_id BIGINT, contract_line_id BIGINT) PARTITION BY LIST(status);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-185', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 133, '9:b1159ea68b2cc96d1e4158600d7b5db3', 'createTable tableName=billing_rated_transaction', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-185-pk::AndriusKarpavicius
ALTER TABLE billing_rated_transaction ADD CONSTRAINT billing_rated_transaction_pkey PRIMARY KEY (id, status);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-185-pk', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 135, '9:34c3de86f73b5bd26d6ea76173a1f61a', 'addPrimaryKey constraintName=billing_rated_transaction_pkey, tableName=billing_rated_transaction', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-187::AndriusKarpavicius
CREATE TABLE billing_rejected_billing_accounts (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, reject_cause VARCHAR(3000), creator VARCHAR(100), updater VARCHAR(100), billing_account BIGINT, billing_run BIGINT, CONSTRAINT billing_rejected_billing_accounts_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-187', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 137, '9:8387e3e480495e9252e26521be62f983', 'createTable tableName=billing_rejected_billing_accounts', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-188::AndriusKarpavicius
CREATE TABLE billing_reservation (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, amount_with_tax numeric(23, 12), amount_without_tax numeric(23, 12), expiry_date date, input_message VARCHAR(255), origin_edr_id BIGINT, quantity numeric(23, 12), reservation_date date, status VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), subscription_id BIGINT, user_account_id BIGINT, wallet_id BIGINT, CONSTRAINT billing_reservation_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-188', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 139, '9:9b27bde405ef8cc538522e0752fa1c2f', 'createTable tableName=billing_reservation', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-189::AndriusKarpavicius
CREATE TABLE billing_resrv_countid (reservation_id BIGINT NOT NULL, counterperiodvalues numeric(19, 2), counterperiodvalues_key BIGINT NOT NULL);

ALTER TABLE billing_resrv_countid ADD CONSTRAINT billing_resrv_countid_pkey PRIMARY KEY (reservation_id, counterperiodvalues_key);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-189', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 141, '9:cee014a4e9ed7cb68997c919407eb5f8', 'createTable tableName=billing_resrv_countid; addPrimaryKey constraintName=billing_resrv_countid_pkey, tableName=billing_resrv_countid', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-191::AndriusKarpavicius
CREATE TABLE billing_service_instance (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), end_agrement_date TIMESTAMP WITHOUT TIME ZONE, quantity numeric(23, 12), status VARCHAR(255), status_date TIMESTAMP WITHOUT TIME ZONE, subscription_date TIMESTAMP WITHOUT TIME ZONE, termination_date TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), service_template_id BIGINT, subscription_id BIGINT, sub_termin_reason_id BIGINT, invoicing_calendar_id BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, order_number VARCHAR(100), cf_values JSONB, rate_until_date TIMESTAMP WITHOUT TIME ZONE, minimum_amount_el VARCHAR(2000), minimum_label_el VARCHAR(2000), auto_renew INTEGER DEFAULT 0 NOT NULL, days_notify_renew INTEGER, end_of_term_action VARCHAR(10), auto_termin_reason_id BIGINT, init_active_unit VARCHAR(5), init_active INTEGER, match_end_aggr_date INTEGER DEFAULT 0 NOT NULL, renew_for_unit VARCHAR(5), renew_for INTEGER, subscribed_till_date TIMESTAMP WITHOUT TIME ZONE, renewed INTEGER DEFAULT 0 NOT NULL, notify_of_renewal_date TIMESTAMP WITHOUT TIME ZONE, renewal_notified_date TIMESTAMP WITHOUT TIME ZONE, initial_term_type VARCHAR(20), auto_end_of_engagement INTEGER, amount_ps numeric(23, 12), calendar_ps_id BIGINT, payment_day_in_month_ps INTEGER, auto_renew_date TIMESTAMP WITHOUT TIME ZONE, initial_renewal TEXT, calendar_init_active_id BIGINT, calendar_renew_for_id BIGINT, renewal_term_type VARCHAR(20), minimum_invoice_sub_category_id BIGINT, minimum_charge_template_id BIGINT, product_version_id BIGINT, quote_product_id BIGINT, minimum_article_id BIGINT, reactivation_date TIMESTAMP WITHOUT TIME ZONE, delivery_date TIMESTAMP WITHOUT TIME ZONE, price_version_date_setting VARCHAR(255), price_version_date TIMESTAMP WITHOUT TIME ZONE, order_product_id BIGINT, mrr numeric(23, 12), requested_activation_date TIMESTAMP WITHOUT TIME ZONE, CONSTRAINT billing_service_instance_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-191', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 143, '9:d1907a21f20e3f5cdeefcbdd1d5e89d8', 'createTable tableName=billing_service_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-192::AndriusKarpavicius
CREATE TABLE billing_subscrip_termin_reason (id BIGINT NOT NULL, version INTEGER, apply_agreement INTEGER DEFAULT 0 NOT NULL, apply_reimbursment INTEGER DEFAULT 0 NOT NULL, apply_termination_charges INTEGER DEFAULT 0 NOT NULL, code VARCHAR(255), description VARCHAR(255), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), override_prorata VARCHAR(255), reimburse_oneshots INTEGER DEFAULT 0 NOT NULL, description_i18n JSONB, invoice_agreement_immediately INTEGER DEFAULT 0 NOT NULL, CONSTRAINT billing_subscrip_termin_reason_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-192', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 145, '9:1c94649bae4a1fca14e5c1012a8a5320', 'createTable tableName=billing_subscrip_termin_reason', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-193::AndriusKarpavicius
CREATE TABLE billing_subscription (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), default_level INTEGER DEFAULT 1, end_agrement_date TIMESTAMP WITHOUT TIME ZONE, status VARCHAR(255), status_date TIMESTAMP WITHOUT TIME ZONE, subscription_date TIMESTAMP WITHOUT TIME ZONE, termination_date TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), offer_id BIGINT, sub_termin_reason_id BIGINT, user_account_id BIGINT NOT NULL, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, subscribed_till_date TIMESTAMP WITHOUT TIME ZONE, auto_renew INTEGER DEFAULT 0 NOT NULL, days_notify_renew INTEGER, end_of_term_action VARCHAR(10), auto_termin_reason_id BIGINT, init_active_unit VARCHAR(5), init_active INTEGER, match_end_aggr_date INTEGER DEFAULT 0 NOT NULL, renew_for_unit VARCHAR(5), renew_for INTEGER, renewed INTEGER DEFAULT 0 NOT NULL, notify_of_renewal_date TIMESTAMP WITHOUT TIME ZONE, renewal_notified_date TIMESTAMP WITHOUT TIME ZONE, cf_values JSONB, minimum_amount_el VARCHAR(2000), minimum_label_el VARCHAR(2000), initial_term_type VARCHAR(20), billing_cycle BIGINT, billing_run BIGINT, auto_end_of_engagement INTEGER, seller_id BIGINT NOT NULL, rating_group VARCHAR(50), auto_renew_date TIMESTAMP WITHOUT TIME ZONE, mailing_type VARCHAR(255), cced_emails VARCHAR(2000), email VARCHAR(255), electronic_billing INTEGER DEFAULT 0 NOT NULL, email_template_id BIGINT, initial_renewal TEXT, calendar_init_active_id BIGINT, calendar_renew_for_id BIGINT, renewal_term_type VARCHAR(20), minimum_invoice_sub_category_id BIGINT, minimum_charge_template_id BIGINT, payment_method_id BIGINT, valid_from TIMESTAMP WITHOUT TIME ZONE, valid_to TIMESTAMP WITHOUT TIME ZONE, commercial_order_id BIGINT, prestation VARCHAR(255), minimum_article_id BIGINT, order_offer_id BIGINT, version_number INTEGER DEFAULT 1, next_version BIGINT, previous_version BIGINT, sales_person_name VARCHAR(52), contract_id BIGINT, price_list_id BIGINT, mrr numeric(23, 12), CONSTRAINT billing_subscription_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-193', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 147, '9:caa9906c669d00f93812566ffcbda880', 'createTable tableName=billing_subscription', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-194::AndriusKarpavicius
CREATE TABLE billing_tax (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), accounting_code_id BIGINT, tax_percentage numeric(23, 12) NOT NULL, creator VARCHAR(100), updater VARCHAR(100), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, description_i18n JSONB, composite INTEGER DEFAULT 0, taxation_category_id BIGINT NOT NULL, vatex_id BIGINT, CONSTRAINT billing_tax_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-194', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 149, '9:21a6da1ce717cd3a03167774f73a0b39', 'createTable tableName=billing_tax', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-195::AndriusKarpavicius
CREATE TABLE billing_tax_language (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), tax_id BIGINT, trading_language_id BIGINT, CONSTRAINT billing_tax_language_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-195', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 151, '9:645d4e316ab5714a6a36380cdb13914c', 'createTable tableName=billing_tax_language', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-196::AndriusKarpavicius
CREATE TABLE billing_trading_country (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255), description VARCHAR(255), cf_values JSONB, uuid VARCHAR(60) DEFAULT 'Trading_Country_US' NOT NULL, creator VARCHAR(100), updater VARCHAR(100), country_id BIGINT, CONSTRAINT billing_trading_country_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-196', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 153, '9:3ff36b4e61c279b61d59b2123d5605a6', 'createTable tableName=billing_trading_country', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-197::AndriusKarpavicius
CREATE TABLE billing_trading_currency (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, pr_currency_to_this numeric(23, 12), pr_description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), currency_id BIGINT, symbol VARCHAR(255), decimal_places INTEGER DEFAULT 2, current_rate numeric(23, 12), current_rate_from_date TIMESTAMP WITHOUT TIME ZONE, current_rate_updater VARCHAR(255), CONSTRAINT billing_trading_currency_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-197', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 155, '9:efd3950f46d051cf452e857a6615b4a4', 'createTable tableName=billing_trading_currency', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-INTRD-5636-20220318::hhanine
CREATE TABLE exchange_rate (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), trading_currency_id BIGINT, exchange_rate numeric(23, 6), from_date TIMESTAMP WITHOUT TIME ZONE, current_rate INTEGER DEFAULT 0 NOT NULL, CONSTRAINT exchange_rate_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-INTRD-5636-20220318', 'hhanine', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 157, '9:7a41ff2332b706a2c147eb28d1d7df1f', 'createTable tableName=exchange_rate', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-198::AndriusKarpavicius
CREATE TABLE billing_trading_language (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, pr_description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), language_id BIGINT, CONSTRAINT billing_trading_language_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-198', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 159, '9:ef8078e06853fc3b9151ee7f2a3a0204', 'createTable tableName=billing_trading_language', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-200::AndriusKarpavicius
CREATE TABLE billing_user_account (status VARCHAR(10), status_date TIMESTAMP WITHOUT TIME ZONE, subscription_date TIMESTAMP WITHOUT TIME ZONE, termination_date TIMESTAMP WITHOUT TIME ZONE, id BIGINT NOT NULL, billing_account_id BIGINT, termin_reason_id BIGINT, wallet_id BIGINT, minimum_article_id BIGINT, parent_useraccount_id BIGINT, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), address_1 VARCHAR(255), address_2 VARCHAR(255), address_3 VARCHAR(255), address_4 VARCHAR(255), address_5 VARCHAR(255), address_city VARCHAR(100), address_country_id BIGINT, address_state VARCHAR(50), address_zipcode VARCHAR(20), default_level INTEGER DEFAULT 1, external_ref_1 VARCHAR(255), external_ref_2 VARCHAR(255), firstname VARCHAR(100), lastname VARCHAR(100), provider_contact VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), title_id BIGINT, primary_contact BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, bam_id BIGINT, cf_values JSONB, job_title VARCHAR(255), email VARCHAR(2000), fax VARCHAR(50), mobile VARCHAR(100), phone VARCHAR(100), vat_no VARCHAR(100), vat_status VARCHAR(25) DEFAULT 'UNKNOWN', minimum_amount_el VARCHAR(2000), minimum_label_el VARCHAR(2000), minimum_charge_template_id BIGINT, company INTEGER DEFAULT 0, legal_entity_type_id BIGINT, is_consumer INTEGER DEFAULT 1, CONSTRAINT billing_user_account_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-200', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 161, '9:95663370ae6842502c6bae638d44bffc', 'createTable tableName=billing_user_account', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-201::AndriusKarpavicius
CREATE TABLE billing_wallet (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), expiry_date TIMESTAMP WITHOUT TIME ZONE, next_matching_date TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), user_account_id BIGINT, cat_wallet_template_id BIGINT, low_balance_level numeric(23, 12), reject_level numeric(23, 12), CONSTRAINT billing_wallet_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-201', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 163, '9:9655230b8b5d43ab589848c625dd6255', 'createTable tableName=billing_wallet', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-202::AndriusKarpavicius
CREATE TABLE billing_wallet_operation (operation_type VARCHAR(31) NOT NULL, id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), amount_tax numeric(23, 12), amount_with_tax numeric(23, 12), amount_without_tax numeric(23, 12), end_date TIMESTAMP WITHOUT TIME ZONE, offer_code VARCHAR(255), operation_date TIMESTAMP WITHOUT TIME ZONE, parameter_1 VARCHAR(255), parameter_2 VARCHAR(255), parameter_3 VARCHAR(255), quantity numeric(23, 12) NOT NULL, start_date TIMESTAMP WITHOUT TIME ZONE, status VARCHAR(255), subscription_date TIMESTAMP WITHOUT TIME ZONE, tax_percent numeric(23, 12) NOT NULL, credit_debit_flag VARCHAR(255), unit_amount_tax numeric(23, 12), unit_amount_with_tax numeric(23, 12), unit_amount_without_tax numeric(23, 12), creator VARCHAR(100), updater VARCHAR(100), aggregate_serv_id BIGINT, charge_instance_id BIGINT, counter_id BIGINT, currency_id BIGINT, priceplan_id BIGINT, reratedwalletoperation_id BIGINT, seller_id BIGINT NOT NULL, wallet_id BIGINT, reservation_id BIGINT, invoicing_date TIMESTAMP WITHOUT TIME ZONE, input_quantity numeric(23, 12), input_unit_description VARCHAR(20), rating_unit_description VARCHAR(20), edr_id BIGINT, order_number VARCHAR(100), parameter_extra VARCHAR(4000), raw_amount_without_tax numeric(23, 12), raw_amount_with_tax numeric(23, 12), invoice_sub_category_id BIGINT, subscription_id BIGINT, tax_id BIGINT, rated_transaction_id BIGINT, service_instance_id BIGINT, offer_id BIGINT, input_unitofmeasure BIGINT, rating_unitofmeasure BIGINT, tax_class_id BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), cf_values JSONB, accounting_code_id BIGINT, sort_index INTEGER, reject_reason TEXT, order_id BIGINT, accounting_article_id BIGINT, order_lot_id BIGINT, product_version_id BIGINT, order_product_id BIGINT, refunds_wo_id BIGINT, discounted_wallet_operation_id BIGINT, discount_plan_id BIGINT, discount_value numeric(23, 12), discount_plan_type VARCHAR(50), discount_plan_item_id BIGINT, user_account_id BIGINT, billing_account_id BIGINT, old_wallet_id BIGINT, discounted_amount numeric(23, 12), sequence INTEGER, rules_contract_id BIGINT, price_plan_matrix_version_id BIGINT, price_plan_matrix_line_id BIGINT, contract_id BIGINT, use_specific_price_conversion INTEGER DEFAULT 0 NOT NULL, transactional_amount_without_tax numeric(23, 12), transactional_amount_with_tax numeric(23, 12), transactional_amount_tax numeric(23, 12), transactional_unit_amount_without_tax numeric(23, 12), transactional_unit_amount_with_tax numeric(23, 12), transactional_unit_amount_tax numeric(23, 12), trading_currency_id BIGINT, contract_line_id BIGINT, price_list_line_id BIGINT, business_key VARCHAR(255), batch_entity_id BIGINT, overrode_price INTEGER DEFAULT 0, rerate_from_invoice INTEGER) PARTITION BY LIST(status);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-202', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 165, '9:9b804ec4671f014061b141934fa50f2d', 'createTable tableName=billing_wallet_operation', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-202-pk::AndriusKarpavicius
ALTER TABLE billing_wallet_operation ADD CONSTRAINT billing_wallet_operation_pkey PRIMARY KEY (id, status);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-202-pk', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 167, '9:9f275eacca6d7adedcded70d4e74f3b9', 'addPrimaryKey constraintName=billing_wallet_operation_pkey, tableName=billing_wallet_operation', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-203::AndriusKarpavicius
CREATE TABLE cat_calendar (cal_type VARCHAR(31) NOT NULL, id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), nb_periods INTEGER, period_length INTEGER, period_unit INTEGER, calendar TIMESTAMP WITHOUT TIME ZONE, join_type VARCHAR(255), interval_type VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), join_cal_1_id BIGINT, join_cal_2_id BIGINT, start_date date, end_date date, weekend_begin INTEGER, weekend_end INTEGER, init_date_el VARCHAR(2000), description_i18n JSONB, CONSTRAINT cat_calendar_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-203', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 169, '9:5503f9b3ac195ce96c1c03001a6d352c', 'createTable tableName=cat_calendar', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-204::AndriusKarpavicius
CREATE TABLE cat_calendar_days (calendar_id BIGINT NOT NULL, day_id BIGINT NOT NULL);

ALTER TABLE cat_calendar_days ADD CONSTRAINT cat_calendar_days_pkey PRIMARY KEY (calendar_id, day_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-204', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 171, '9:be5919d5d2c82a23179a0434bd41f7a5', 'createTable tableName=cat_calendar_days; addPrimaryKey constraintName=cat_calendar_days_pkey, tableName=cat_calendar_days', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-205::AndriusKarpavicius
CREATE TABLE cat_calendar_hours (calendar_id BIGINT NOT NULL, hour_id BIGINT NOT NULL);

ALTER TABLE cat_calendar_hours ADD CONSTRAINT cat_calendar_hours_pkey PRIMARY KEY (calendar_id, hour_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-205', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 173, '9:bbed1c41b187921a04a1945d3a572b00', 'createTable tableName=cat_calendar_hours; addPrimaryKey constraintName=cat_calendar_hours_pkey, tableName=cat_calendar_hours', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-206::AndriusKarpavicius
CREATE TABLE cat_calendar_interval (id BIGINT NOT NULL, version INTEGER, interval_begin INTEGER NOT NULL, interval_end INTEGER NOT NULL, calendar_id BIGINT NOT NULL, CONSTRAINT cat_calendar_interval_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-206', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 175, '9:f17c591c3109c698df6de619dea50012', 'createTable tableName=cat_calendar_interval', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-207::AndriusKarpavicius
CREATE TABLE cat_charge_template (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), amount_editable INTEGER, credit_debit_flag INTEGER, status VARCHAR(255) NOT NULL, creator VARCHAR(100), updater VARCHAR(100), invoice_sub_category BIGINT, input_unit_description VARCHAR(20), rating_unit_description VARCHAR(255), unit_multiplicator numeric(23, 12), unit_nb_decimal INTEGER, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, rounding_mode VARCHAR(255) DEFAULT 'NEAREST', revenue_recog_rule_id BIGINT, cf_values JSONB, description_i18n JSONB, charge_type VARCHAR(5), filter_expression VARCHAR(2000), filter_param_1 VARCHAR(255), filter_param_2 VARCHAR(255), filter_param_3 VARCHAR(255), filter_param_4 VARCHAR(255), priority INTEGER DEFAULT 1, trigger_next_charge INTEGER DEFAULT 0, trigger_next_charge_el VARCHAR(2000), apply_in_advance INTEGER, duration_term_in_month INTEGER, recurrence_type VARCHAR(255), share_level VARCHAR(20), subscription_prorata INTEGER, termination_prorata INTEGER, calendar_id BIGINT, subscription_prorata_el VARCHAR(2000), termination_prorata_el VARCHAR(2000), apply_in_advance_el VARCHAR(2000), duration_term_in_month_el VARCHAR(2000), calendar_code_el VARCHAR(2000), immediate_invoicing INTEGER DEFAULT 0, type VARCHAR(255), prorata_on_price_change INTEGER DEFAULT 0, input_unitofmeasure BIGINT, rating_unitofmeasure BIGINT, input_unit_el VARCHAR(2000), output_unit_el VARCHAR(2000), tax_class_id BIGINT, tax_class_el VARCHAR(2000), drop_zero_wo INTEGER DEFAULT 0, rating_script_id BIGINT, sort_index_el VARCHAR(2000), apply_terminated_charge_to_date_el VARCHAR(2000), offer_template_id BIGINT, product_id BIGINT, service_template_id BIGINT, price_plan_matrix_id BIGINT, recurrence_duration_enum VARCHAR(20), duration_service BIGINT, recurrence_calendar BIGINT, calendar_service BIGINT, usage_service_template_id BIGINT, surcharge INTEGER, price_matrix INTEGER, param1 VARCHAR(50), param1_service_id BIGINT, param2 VARCHAR(50), param2_service_id BIGINT, param3 VARCHAR(50), param3_service_id BIGINT, param4 VARCHAR(50), param4_service_id BIGINT, dim1_matrix VARCHAR(50), dim1_matrix_bystep INTEGER DEFAULT 0, dim1_matrix_service BIGINT, dim2_matrix VARCHAR(50), dim2_matrix_bystep INTEGER DEFAULT 0, dim2_matrix_service BIGINT, dim3_matrix VARCHAR(50), dim3_matrix_bystep INTEGER DEFAULT 0, dim3_matrix_service BIGINT, quantity_attribute_id BIGINT, attribute_duration_id BIGINT, attribute_calendar_id BIGINT, internal_note TEXT, anticipate_end_of_subscription INTEGER DEFAULT 0, parameter1_description VARCHAR(255) DEFAULT 'Parameter 1', parameter2_description VARCHAR(255) DEFAULT 'Parameter 2', parameter3_description VARCHAR(255) DEFAULT 'Parameter 3', parameter_extra_description VARCHAR(255) DEFAULT 'Parameter Extra', parameter1_format VARCHAR(50) DEFAULT 'TEXT', parameter2_format VARCHAR(50) DEFAULT 'TEXT', parameter3_format VARCHAR(50) DEFAULT 'TEXT', parameter_extra_format VARCHAR(50) DEFAULT 'TEXT', parameter1_is_mandatory INTEGER DEFAULT 0, parameter1_is_hidden INTEGER DEFAULT 0, parameter2_is_mandatory INTEGER DEFAULT 0, parameter2_is_hidden INTEGER DEFAULT 0, parameter3_is_mandatory INTEGER DEFAULT 0, parameter3_is_hidden INTEGER DEFAULT 0, parameter_extra_is_mandatory INTEGER DEFAULT 0, parameter_extra_is_hidden INTEGER DEFAULT 0, parameter1_translated_description JSONB, parameter2_translated_description JSONB, parameter3_translated_description JSONB, parameter_extra_translated_description JSONB, parameter1_translated_long_descriptions JSONB, parameter2_translated_long_descriptions JSONB, parameter3_translated_long_descriptions JSONB, parameter_extra_translated_long_descriptions JSONB, business_key_el VARCHAR(2000), business_key_description VARCHAR(255) DEFAULT 'Business key', business_key_translated_descriptions JSONB DEFAULT '{"FRA":"Clé métier", "ENG":"Business key"}' NOT NULL, business_key_translated_long_descriptions JSONB DEFAULT '{"FRA":"La clé métier est calculé à la valorisation en utilisant une formule personnalisé enregistrée sur la charge", "ENG":"Business key is computed at rating using a custom expression set on the charge"}' NOT NULL, business_key_format VARCHAR(50) DEFAULT 'TEXT' NOT NULL, business_key_is_mandatory INTEGER DEFAULT 0, business_key_is_hidden INTEGER DEFAULT 0, rating_script_uses_price_versions INTEGER DEFAULT 0, CONSTRAINT cat_charge_template_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-207', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 177, '9:5647b4320ce570abf36211e8250edd81', 'createTable tableName=cat_charge_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-208::AndriusKarpavicius
CREATE TABLE cat_chrg_edr (charge_tmpl_id BIGINT NOT NULL, trigg_edr_id BIGINT NOT NULL);

ALTER TABLE cat_chrg_edr ADD CONSTRAINT cat_chrg_edr_pkey PRIMARY KEY (charge_tmpl_id, trigg_edr_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-208', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 179, '9:324e3f9d0b4b85b003e02a318409e97d', 'createTable tableName=cat_chrg_edr; addPrimaryKey constraintName=cat_chrg_edr_pkey, tableName=cat_chrg_edr', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-209::AndriusKarpavicius
CREATE TABLE cat_counter_template (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), counter_level VARCHAR(255) DEFAULT 'UA' NOT NULL, counter_type VARCHAR(255) DEFAULT 'USAGE' NOT NULL, level_num numeric(35, 12), unity_description VARCHAR(20), creator VARCHAR(100), updater VARCHAR(100), calendar_id BIGINT, ceiling_expression_el VARCHAR(2000), notification_levels VARCHAR(70), is_accumulator INTEGER DEFAULT 0, calendar_code_el VARCHAR(2000), accumulator_type VARCHAR(35), filter_el VARCHAR(2000), key_el VARCHAR(2000), value_el VARCHAR(2000), managed_byapp INTEGER DEFAULT 1 NOT NULL, shared_counter INTEGER DEFAULT 0, CONSTRAINT cat_counter_template_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-209', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 181, '9:e345c3ee87becf9dfc9c762e62254329', 'createTable tableName=cat_counter_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-210::AndriusKarpavicius
CREATE TABLE cat_day_in_year (id BIGINT NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, version INTEGER, day INTEGER, month VARCHAR(20), creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT cat_day_in_year_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-210', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 183, '9:c04b21515fb6e23857d84f2fe9e4f1bc', 'createTable tableName=cat_day_in_year', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-211::AndriusKarpavicius
CREATE TABLE cat_discount_plan (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), max_duration INTEGER, min_duration INTEGER, creator VARCHAR(100), updater VARCHAR(100), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, start_date date, end_date date, default_duration INTEGER, duration_unit VARCHAR(50), discount_plan_type VARCHAR(50), status VARCHAR(50), status_date TIMESTAMP WITHOUT TIME ZONE, initial_quantity BIGINT DEFAULT 0 NOT NULL, used_quantity BIGINT DEFAULT 0 NOT NULL, application_limit BIGINT DEFAULT 0 NOT NULL, application_filter_el VARCHAR(2000), discount_plan_id BIGINT, expression_el VARCHAR(2000), applicable_on_overridden_price INTEGER DEFAULT 1, applicable_on_discounted_price INTEGER DEFAULT 1, sequence INTEGER, automatic_application INTEGER DEFAULT 0, allowance_code_id BIGINT NOT NULL, applicable_on_contract_price INTEGER DEFAULT 1, CONSTRAINT cat_discount_plan_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-211', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 185, '9:0a797d4dbb7ed810ebebe038bd4f7e86', 'createTable tableName=cat_discount_plan', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-212::AndriusKarpavicius
CREATE TABLE cat_discount_plan_item (id BIGINT NOT NULL, description VARCHAR(255), version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, accounting_code VARCHAR(255), code VARCHAR(255) NOT NULL, discount_value numeric(23, 12), creator VARCHAR(100), updater VARCHAR(100), discount_plan_id BIGINT NOT NULL, invoice_category_id BIGINT, invoice_sub_category_id BIGINT, expression_el VARCHAR(2000), discount_value_el VARCHAR(2000), discount_plan_item_type VARCHAR(25), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, allow_to_negate INTEGER, status VARCHAR(50), status_date TIMESTAMP WITHOUT TIME ZONE, application_count BIGINT DEFAULT 0 NOT NULL, accounting_article_id BIGINT, priorty BIGINT, price_plan_matrix_id BIGINT, apply_by_article INTEGER DEFAULT 0, sequence INTEGER, last_discount INTEGER, CONSTRAINT cat_discount_plan_item_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-212', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 187, '9:8c127853fd71f9ea5e629911111ff454', 'createTable tableName=cat_discount_plan_item', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-213::AndriusKarpavicius
CREATE TABLE cat_hour_in_day (id BIGINT NOT NULL, version INTEGER, hour INTEGER, min INTEGER, CONSTRAINT cat_hour_in_day_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-213', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 189, '9:3670cb881ef847bc8b2b228db39bca55', 'createTable tableName=cat_hour_in_day', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-214::AndriusKarpavicius
CREATE TABLE cat_offer_serv_templates (offer_template_id BIGINT NOT NULL, service_template_id BIGINT NOT NULL, id BIGINT NOT NULL, mandatory INTEGER DEFAULT 0 NOT NULL, valid_from TIMESTAMP WITHOUT TIME ZONE, valid_to TIMESTAMP WITHOUT TIME ZONE, CONSTRAINT pk_cat_offer_serv_templates PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-214', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 191, '9:9a2bc7f69bc5c01191497b65620b3824', 'createTable tableName=cat_offer_serv_templates', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-215::AndriusKarpavicius
CREATE TABLE cat_offer_template (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, bom_code VARCHAR(60), termination_script_instance_id BIGINT, subscription_script_instance_id BIGINT, name VARCHAR(100), entity_version INTEGER, status VARCHAR(50), business_offer_model_id BIGINT, valid_from TIMESTAMP WITHOUT TIME ZONE, valid_to TIMESTAMP WITHOUT TIME ZONE, long_description TEXT, life_cycle_status VARCHAR(60), type VARCHAR(20) DEFAULT 'OFFER' NOT NULL, product_charge_tmpl_id BIGINT, business_product_model_id BIGINT, invoicing_calendar_id BIGINT, image_path VARCHAR(100), cf_values JSONB, auto_renew INTEGER DEFAULT 0 NOT NULL, days_notify_renew INTEGER, end_of_term_action VARCHAR(10), auto_termin_reason_id BIGINT, init_active_unit VARCHAR(5), init_active INTEGER, match_end_aggr_date INTEGER DEFAULT 0 NOT NULL, renew_for_unit VARCHAR(5), renew_for INTEGER, description_i18n JSONB, long_description_i18n JSONB, script_instance_id BIGINT, minimum_amount_el VARCHAR(2000), minimum_label_el VARCHAR(2000), initial_term_type VARCHAR(20), auto_end_of_engagement INTEGER, auto_renew_date TIMESTAMP WITHOUT TIME ZONE, calendar_init_active_id BIGINT, calendar_renew_for_id BIGINT, renewal_term_type VARCHAR(20), minimum_invoice_sub_category_id BIGINT, minimum_charge_template_id BIGINT, is_offer_change_restricted INTEGER DEFAULT 0, product_status VARCHAR(50), status_date TIMESTAMP WITHOUT TIME ZONE, minimum_article_id BIGINT, offer_template_id BIGINT, is_model INTEGER DEFAULT 0, offer_model_id BIGINT, generate_quote_edr_per_product INTEGER DEFAULT 0, sequence INTEGER DEFAULT 0, display INTEGER DEFAULT 0, document_id BIGINT, arr numeric(23, 12), CONSTRAINT cat_offer_template_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-215', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 193, '9:228b0a5121139b84587d44bdf6732978', 'createTable tableName=cat_offer_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-217::AndriusKarpavicius
CREATE TABLE cat_price_plan_matrix (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), amount_with_tax numeric(35, 12), amount_without_tax numeric(35, 12), criteria_1 VARCHAR(255), criteria_2 VARCHAR(255), criteria_3 VARCHAR(255), criteria_el VARCHAR(2000), end_rating_date TIMESTAMP WITHOUT TIME ZONE, end_subscription_date TIMESTAMP WITHOUT TIME ZONE, max_quantity numeric(35, 12), max_subscr_age BIGINT, min_quantity numeric(35, 12), min_subscr_age BIGINT, priority INTEGER DEFAULT 1, start_rating_date TIMESTAMP WITHOUT TIME ZONE, start_subscription_date TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), offer_id BIGINT, seller_id BIGINT, trading_country_id BIGINT, trading_currency_id BIGINT, valid_cal_id BIGINT, amount_without_tax_el TEXT, amount_with_tax_el TEXT, sequence BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, script_instance_id BIGINT, cf_values JSONB, description_i18n JSONB, wo_description_el TEXT, invoice_subcategory_el TEXT, total_amount_el TEXT, minimum_amount_el TEXT, validity_from TIMESTAMP WITHOUT TIME ZONE, validity_date TIMESTAMP WITHOUT TIME ZONE, parameter1_el VARCHAR(2000), parameter2_el VARCHAR(2000), parameter3_el VARCHAR(2000), charge_template_id BIGINT, CONSTRAINT cat_price_plan_matrix_pkey PRIMARY KEY (id));

ALTER TABLE cat_price_plan_matrix ADD CONSTRAINT fk_cat_price_plan_matrix_cat_charge_template FOREIGN KEY (charge_template_id) REFERENCES cat_charge_template (id) ON UPDATE NO ACTION ON DELETE NO ACTION;

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-217', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 195, '9:c537743bab413973c99befe4b8f971e9', 'createTable tableName=cat_price_plan_matrix; addForeignKeyConstraint baseTableName=cat_price_plan_matrix, constraintName=fk_cat_price_plan_matrix_cat_charge_template, referencedTableName=cat_charge_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-219::AndriusKarpavicius
CREATE TABLE cat_serv_rec_charge_template (id BIGINT NOT NULL, version INTEGER, charge_template_id BIGINT, service_template_id BIGINT, counter_template_id BIGINT, CONSTRAINT cat_serv_rec_charge_template_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-219', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 197, '9:c0845584031d598fd7daa176397da674', 'createTable tableName=cat_serv_rec_charge_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-220::AndriusKarpavicius
CREATE TABLE cat_serv_rec_wallet_template (service_rec_templt_id BIGINT NOT NULL, wallet_template_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE cat_serv_rec_wallet_template ADD CONSTRAINT cat_serv_rec_wallet_template_pkey PRIMARY KEY (service_rec_templt_id, indx);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-220', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 199, '9:25c592eb5f6be90d2ca17642b38897a5', 'createTable tableName=cat_serv_rec_wallet_template; addPrimaryKey constraintName=cat_serv_rec_wallet_template_pkey, tableName=cat_serv_rec_wallet_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-221::AndriusKarpavicius
CREATE TABLE cat_serv_sub_charge_template (id BIGINT NOT NULL, version INTEGER, charge_template_id BIGINT, service_template_id BIGINT, counter_template_id BIGINT, CONSTRAINT cat_serv_sub_charge_template_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-221', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 201, '9:62580db38cef9fa83d8a53526e35b298', 'createTable tableName=cat_serv_sub_charge_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-222::AndriusKarpavicius
CREATE TABLE cat_serv_sub_wallet_template (service_sub_templt_id BIGINT NOT NULL, wallet_template_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE cat_serv_sub_wallet_template ADD CONSTRAINT cat_serv_sub_wallet_template_pkey PRIMARY KEY (service_sub_templt_id, indx);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-222', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 203, '9:633b272161fc3befa9f7cf81489560c5', 'createTable tableName=cat_serv_sub_wallet_template; addPrimaryKey constraintName=cat_serv_sub_wallet_template_pkey, tableName=cat_serv_sub_wallet_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-223::AndriusKarpavicius
CREATE TABLE cat_serv_trm_charge_template (id BIGINT NOT NULL, version INTEGER, charge_template_id BIGINT, service_template_id BIGINT, counter_template_id BIGINT, CONSTRAINT cat_serv_trm_charge_template_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-223', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 205, '9:aaa19a9bf1e911c60d10d4b38abb02e8', 'createTable tableName=cat_serv_trm_charge_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-224::AndriusKarpavicius
CREATE TABLE cat_serv_trm_wallet_template (service_trm_templt_id BIGINT NOT NULL, wallet_template_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE cat_serv_trm_wallet_template ADD CONSTRAINT cat_serv_trm_wallet_template_pkey PRIMARY KEY (service_trm_templt_id, indx);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-224', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 207, '9:0294e7287aeafd157d0a572f4fefd2da', 'createTable tableName=cat_serv_trm_wallet_template; addPrimaryKey constraintName=cat_serv_trm_wallet_template_pkey, tableName=cat_serv_trm_wallet_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-225::AndriusKarpavicius
CREATE TABLE cat_serv_usage_charge_template (id BIGINT NOT NULL, version INTEGER, charge_template_id BIGINT, service_template_id BIGINT, counter_template_id BIGINT, CONSTRAINT cat_serv_usage_charge_template_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-225', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 209, '9:2b30c525ffb1662bc5eace73861d509f', 'createTable tableName=cat_serv_usage_charge_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-226::AndriusKarpavicius
CREATE TABLE cat_serv_usage_wallet_template (service_usage_templt_id BIGINT NOT NULL, wallet_template_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE cat_serv_usage_wallet_template ADD CONSTRAINT cat_serv_usage_wallet_template_pkey PRIMARY KEY (service_usage_templt_id, indx);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-226', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 211, '9:7d04ac99031e1ae2becb335bb79bb9f9', 'createTable tableName=cat_serv_usage_wallet_template; addPrimaryKey constraintName=cat_serv_usage_wallet_template_pkey, tableName=cat_serv_usage_wallet_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-227::AndriusKarpavicius
CREATE TABLE cat_service_template (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), invoicing_calendar_id BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, termination_script_instance_id BIGINT, activation_script_instance_id BIGINT, business_service_model_id BIGINT, long_description TEXT, image_path VARCHAR(100), cf_values JSONB, minimum_amount_el VARCHAR(2000), minimum_label_el VARCHAR(2000), auto_renew INTEGER DEFAULT 0 NOT NULL, days_notify_renew INTEGER, end_of_term_action VARCHAR(10), auto_termin_reason_id BIGINT, init_active_unit VARCHAR(5), init_active INTEGER, match_end_aggr_date INTEGER DEFAULT 0 NOT NULL, renew_for_unit VARCHAR(5), renew_for INTEGER, initial_term_type VARCHAR(20), auto_end_of_engagement INTEGER, auto_renew_date TIMESTAMP WITHOUT TIME ZONE, calendar_init_active_id BIGINT, calendar_renew_for_id BIGINT, renewal_term_type VARCHAR(20), minimum_invoice_sub_category_id BIGINT, minimum_charge_template_id BIGINT, description_i18n JSONB, offer_template_id BIGINT, product_id BIGINT, grouped_service_id BIGINT, service_type_id BIGINT, mandatory INTEGER, priority INTEGER DEFAULT 0, param TEXT, material INTEGER, sequence INTEGER, display INTEGER, CONSTRAINT cat_service_template_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-227', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 213, '9:0486203aa8b1a5581a31d5380780baf2', 'createTable tableName=cat_service_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-228::AndriusKarpavicius
CREATE TABLE cat_triggered_edr (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), condition_el VARCHAR(2000), param_1_el TEXT, param_2_el TEXT, param_3_el TEXT, param_4_el TEXT, quantity_el TEXT, subscription_el TEXT, creator VARCHAR(100), updater VARCHAR(100), meveo_instance_id BIGINT, triggered_edr_script_instance_id BIGINT, opencell_instance_el TEXT, CONSTRAINT cat_triggered_edr_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-228', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 215, '9:af3618496b3b261296d34b8622720430', 'createTable tableName=cat_triggered_edr', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-230::AndriusKarpavicius
CREATE TABLE cat_wallet_template (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), consumption_alert_set INTEGER DEFAULT 0 NOT NULL, fast_rating_level INTEGER, wallet_type VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), low_balance_level numeric(23, 12), reject_level numeric(23, 12), low_balance_level_el VARCHAR(2000), reject_level_el VARCHAR(2000), CONSTRAINT cat_wallet_template_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-230', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 217, '9:3cccb3b38a1f3d17e7d9c63f0a8758ee', 'createTable tableName=cat_wallet_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-231::AndriusKarpavicius
CREATE TABLE com_campaign (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), end_date TIMESTAMP WITHOUT TIME ZONE, media VARCHAR(255), priority INTEGER, thread_id INTEGER, schedule_date TIMESTAMP WITHOUT TIME ZONE, start_date TIMESTAMP WITHOUT TIME ZONE, status VARCHAR(255), sub_media VARCHAR(255), use_any_media INTEGER, creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT com_campaign_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-231', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 219, '9:8f15ef21b2be73423bbba9cdfd19bf1e', 'createTable tableName=com_campaign', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-232::AndriusKarpavicius
CREATE TABLE com_contact (id BIGINT NOT NULL, version INTEGER, nb_max_day BIGINT, nb_max_month BIGINT, nb_max_week BIGINT, delay_min BIGINT, email VARCHAR(255) NOT NULL, assistant_name VARCHAR(50), assistant_phone VARCHAR(15), position VARCHAR(200), company_name VARCHAR(200), phone VARCHAR(50), mobile VARCHAR(50), imported_from VARCHAR(50), imported_by VARCHAR(50), social_identifier VARCHAR(2000), is_vip INTEGER DEFAULT 0, is_prospect INTEGER DEFAULT 1, website_url VARCHAR(255), agreed_ua INTEGER DEFAULT 0, address_book_id BIGINT, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), address_1 VARCHAR(255), address_2 VARCHAR(255), address_3 VARCHAR(255), address_4 VARCHAR(255), address_5 VARCHAR(255), address_city VARCHAR(100), address_country_id BIGINT, address_state VARCHAR(50), address_zipcode VARCHAR(20), default_level INTEGER DEFAULT 1, external_ref_1 VARCHAR(255), external_ref_2 VARCHAR(255), firstname VARCHAR(100), lastname VARCHAR(100), provider_contact VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), title_id BIGINT, primary_contact BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, bam_id BIGINT, cf_values JSONB, job_title VARCHAR(255), fax VARCHAR(50), vat_no VARCHAR(100), registration_no VARCHAR(100), company INTEGER DEFAULT 0, legal_entity_type_id BIGINT, reference VARCHAR(80), comment VARCHAR(2000), entreprise INTEGER DEFAULT 0, CONSTRAINT com_contact_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-232', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 221, '9:0c764714780e75cbe3f1129077aebce8', 'createTable tableName=com_contact', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-233::AndriusKarpavicius
CREATE TABLE com_contact_com_message (com_contact_id BIGINT NOT NULL, messages_id BIGINT NOT NULL);

ALTER TABLE com_contact_com_message ADD CONSTRAINT com_contact_com_message_pkey PRIMARY KEY (com_contact_id, messages_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-233', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 223, '9:6c6a564e4ad583d28938336ef8ca854c', 'createTable tableName=com_contact_com_message; addPrimaryKey constraintName=com_contact_com_message_pkey, tableName=com_contact_com_message', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-234::AndriusKarpavicius
CREATE TABLE com_contact_coords (media VARCHAR(31) NOT NULL, id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), email VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT com_contact_coords_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-234', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 225, '9:b27131db106605eff60ed3f717e3ddaa', 'createTable tableName=com_contact_coords', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-235::AndriusKarpavicius
CREATE TABLE com_message (id BIGINT NOT NULL, version INTEGER, media VARCHAR(255), priority VARCHAR(255), rejection_reason VARCHAR(255), status VARCHAR(255), sub_media VARCHAR(255), templatecode VARCHAR(255), campaign_id BIGINT, contact_id BIGINT, CONSTRAINT com_message_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-235', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 227, '9:1a3968a85a4d4d2dc0fbe3d7d34d89e5', 'createTable tableName=com_message', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-236::AndriusKarpavicius
CREATE TABLE com_message_template (media VARCHAR(31) NOT NULL, id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), end_date TIMESTAMP WITHOUT TIME ZONE, start_date TIMESTAMP WITHOUT TIME ZONE, tag_end VARCHAR(255), tag_start VARCHAR(255), type VARCHAR(255), htmlcontent TEXT, subject VARCHAR(255), textcontent TEXT, jasper_filename VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), channel VARCHAR(255), trading_language_id BIGINT, is_active INTEGER DEFAULT 1, type_dunning_mode VARCHAR(255), textcontent_i18n JSONB, subject_i18n JSONB, htmlcontent_i18n JSONB, CONSTRAINT com_message_template_pkey PRIMARY KEY (id));

ALTER TABLE com_message_template ADD CONSTRAINT fk_language_message_template FOREIGN KEY (trading_language_id) REFERENCES billing_trading_language (id) ON UPDATE NO ACTION ON DELETE NO ACTION;

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-236', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 229, '9:fd98470488931473b1b6486a69879eec', 'createTable tableName=com_message_template; addForeignKeyConstraint baseTableName=com_message_template, constraintName=fk_language_message_template, referencedTableName=billing_trading_language', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-237::AndriusKarpavicius
CREATE TABLE com_msg_tmpl_variable (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), mandatory INTEGER DEFAULT 0 NOT NULL, creator VARCHAR(100), updater VARCHAR(100), template_id BIGINT, CONSTRAINT com_msg_tmpl_variable_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-237', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 231, '9:285840dc043f941f461bd4bb29aafad0', 'createTable tableName=com_msg_tmpl_variable', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-238::AndriusKarpavicius
CREATE TABLE com_msg_var_value (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), value VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), message BIGINT, CONSTRAINT com_msg_var_value_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-238', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 233, '9:ba39ff48d482ca9ef951e88d44352337', 'createTable tableName=com_msg_var_value', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-239::AndriusKarpavicius
CREATE TABLE com_provider_policy (id BIGINT NOT NULL, version INTEGER, nb_max_day BIGINT, nb_max_month BIGINT, nb_max_week BIGINT, delay_min BIGINT, CONSTRAINT com_provider_policy_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-239', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 235, '9:602db0a5af548393513df8ed6a5336cd', 'createTable tableName=com_provider_policy', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-240::AndriusKarpavicius
CREATE TABLE com_sender_config (media VARCHAR(31) NOT NULL, id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), non_distrib_email VARCHAR(255), ack_email VARCHAR(255), priority VARCHAR(255), manage_non_distrib INTEGER, nb_max_day BIGINT, nb_max_month BIGINT, nb_max_week BIGINT, delay_min BIGINT, use_ack INTEGER, stamptype VARCHAR(255), addaddressfrontpage INTEGER DEFAULT 0 NOT NULL, envelopformat VARCHAR(255), printrectoverso INTEGER DEFAULT 0 NOT NULL, address_1 VARCHAR(255), address_2 VARCHAR(255), address_3 VARCHAR(255), address_4 VARCHAR(255), address_5 VARCHAR(255), address_city VARCHAR(100), address_country_id BIGINT, address_state VARCHAR(50), address_zipcode VARCHAR(20), usecolor INTEGER DEFAULT 0 NOT NULL, windowtype VARCHAR(255), smtp_host VARCHAR(255), smtp_port INTEGER, default_from_email VARCHAR(255), default_reply_email VARCHAR(255), login VARCHAR(50), pswd VARCHAR(50), use_ssl INTEGER, creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT com_sender_config_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-240', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 237, '9:6f9ce84d49eb267d0a55ce447c5170b6', 'createTable tableName=com_sender_config', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-242::AndriusKarpavicius
CREATE TABLE crm_custom_field_tmpl (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), field_type VARCHAR(255) NOT NULL, value_required INTEGER DEFAULT 0 NOT NULL, creator VARCHAR(100), updater VARCHAR(100), versionable INTEGER DEFAULT 0 NOT NULL, calendar_id BIGINT, default_value VARCHAR(250), entity_clazz VARCHAR(255), storage_type VARCHAR(255) NOT NULL, trigger_end_period_event INTEGER DEFAULT 0 NOT NULL, applies_to VARCHAR(100) NOT NULL, gui_position VARCHAR(2000), allow_edit INTEGER DEFAULT 1 NOT NULL, hide_on_new INTEGER DEFAULT 0 NOT NULL, max_value BIGINT, min_value BIGINT, reg_exp VARCHAR(80), mapkey_type VARCHAR(20), applicable_on_el VARCHAR(2000), che_fields VARCHAR(500), index_type VARCHAR(17), inh_as_def_value INTEGER DEFAULT 0 NOT NULL, tags VARCHAR(2000), description_i18n JSONB, cf_protectable INTEGER DEFAULT 0, display_format VARCHAR(80), nb_decimal INTEGER, rounding_mode VARCHAR(50), unique_constraint INTEGER DEFAULT 0, custom_table_code_el VARCHAR(2000), data_filter_el VARCHAR(2000), fields_el VARCHAR(2000), anonymize_gdpr INTEGER DEFAULT 0 NOT NULL, CONSTRAINT crm_custom_field_tmpl_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-242', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 239, '9:4a5700d6b18d270d09b7d2da0b604cbb', 'createTable tableName=crm_custom_field_tmpl', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-243::AndriusKarpavicius
CREATE TABLE crm_custom_field_tmpl_val (customfieldtemplate_id BIGINT NOT NULL, listvalues VARCHAR(255), listvalues_key VARCHAR(255) NOT NULL);

ALTER TABLE crm_custom_field_tmpl_val ADD CONSTRAINT crm_custom_field_tmpl_val_pkey PRIMARY KEY (customfieldtemplate_id, listvalues_key);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-243', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 241, '9:ca41770bf99a726954423cfd9f9e13cd', 'createTable tableName=crm_custom_field_tmpl_val; addPrimaryKey constraintName=crm_custom_field_tmpl_val_pkey, tableName=crm_custom_field_tmpl_val', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-244::AndriusKarpavicius
CREATE TABLE crm_customer (id BIGINT NOT NULL, customer_brand_id BIGINT, customer_category_id BIGINT, seller_id BIGINT, additional_details_id BIGINT, address_book_id BIGINT, minimum_target_account_id BIGINT, invoicing_threshold numeric(23, 12), check_threshold VARCHAR(25), threshold_per_entity INTEGER DEFAULT 0, minimum_article_id BIGINT, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), address_1 VARCHAR(255), address_2 VARCHAR(255), address_3 VARCHAR(255), address_4 VARCHAR(255), address_5 VARCHAR(255), address_city VARCHAR(100), address_country_id BIGINT, address_state VARCHAR(50), address_zipcode VARCHAR(20), default_level INTEGER DEFAULT 1, external_ref_1 VARCHAR(255), external_ref_2 VARCHAR(255), firstname VARCHAR(100), lastname VARCHAR(100), provider_contact VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), title_id BIGINT, primary_contact BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, bam_id BIGINT, cf_values JSONB, job_title VARCHAR(255), email VARCHAR(2000), fax VARCHAR(50), mobile VARCHAR(100), phone VARCHAR(100), vat_no VARCHAR(100), vat_status VARCHAR(25) DEFAULT 'UNKNOWN', minimum_amount_el VARCHAR(2000), minimum_label_el VARCHAR(2000), minimum_charge_template_id BIGINT, company INTEGER DEFAULT 0, legal_entity_type_id BIGINT, anonymization_date TIMESTAMP WITHOUT TIME ZONE, parent_customer_id BIGINT, CONSTRAINT crm_customer_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-244', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 243, '9:5ae559e47a980ac6ef73ca76d7e6be3b', 'createTable tableName=crm_customer', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-245::AndriusKarpavicius
CREATE TABLE crm_customer_brand (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT crm_customer_brand_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-245', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 245, '9:d0c8c22d6310dd1180f365a24d19d988', 'createTable tableName=crm_customer_brand', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-246::AndriusKarpavicius
CREATE TABLE crm_customer_category (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), exonerated_from_taxes INTEGER DEFAULT 0 NOT NULL, creator VARCHAR(100), updater VARCHAR(100), exoneration_tax_el VARCHAR(2000), exoneration_reason VARCHAR(255), cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, accounting_code_id BIGINT, tax_category_id BIGINT NOT NULL, tax_category_el VARCHAR(2000), description_i18n JSONB, default_seller_id BIGINT, CONSTRAINT crm_customer_category_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-246', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 247, '9:61f2a56ac3d840b23463383006325631', 'createTable tableName=crm_customer_category', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-247::AndriusKarpavicius
CREATE TABLE crm_email (id BIGINT NOT NULL, version INTEGER, email VARCHAR(255), CONSTRAINT crm_email_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-247', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 249, '9:dc3f4579227bdcdeef19371156d2e4c1', 'createTable tableName=crm_email', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-248::AndriusKarpavicius
CREATE TABLE crm_provider (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), amount_validation INTEGER DEFAULT 0 NOT NULL, automatic_invoicing INTEGER DEFAULT 0 NOT NULL, account_number VARCHAR(11), account_owner VARCHAR(50), bank_code VARCHAR(5), bank_id VARCHAR(50), bank_name VARCHAR(50), bic VARCHAR(100), branch_code VARCHAR(5), iban VARCHAR(100), ics VARCHAR(35), issuer_name VARCHAR(50), issuer_number VARCHAR(50), hash_key VARCHAR(2), discount_accounting_code VARCHAR(255), display_free_tx_in_invoice INTEGER DEFAULT 0 NOT NULL, email VARCHAR(100) NOT NULL, entreprise INTEGER DEFAULT 0 NOT NULL, address_1 VARCHAR(255), address_2 VARCHAR(255), address_3 VARCHAR(255), address_4 VARCHAR(255), address_5 VARCHAR(255), address_city VARCHAR(100), address_country_id BIGINT, address_state VARCHAR(50), address_zipcode VARCHAR(20), center_code VARCHAR(255), creditor_code VARCHAR(255), financial_institution_code VARCHAR(255), nne VARCHAR(255), level_duplication INTEGER DEFAULT 0 NOT NULL, multicountry_flag INTEGER DEFAULT 0 NOT NULL, multicurrency_flag INTEGER DEFAULT 0 NOT NULL, multilanguage_flag INTEGER DEFAULT 0 NOT NULL, prepaid_resrv_delay_ms BIGINT, creator VARCHAR(100), updater VARCHAR(100), billing_account_id BIGINT, country_id BIGINT, currency_id BIGINT, customer_id BIGINT, customer_account_id BIGINT, language_id BIGINT, user_account_id BIGINT, credit_note_prefix VARCHAR(255), current_credit_note_nb BIGINT, credit_note_sequence_size INTEGER, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, recognize_revenue INTEGER DEFAULT 0 NOT NULL, cf_values JSONB, rating_rounding INTEGER DEFAULT 2 NOT NULL, rounding_mode VARCHAR(50) DEFAULT 'NEAREST' NOT NULL, invoice_rounding INTEGER DEFAULT 2 NOT NULL, invoice_rounding_mode VARCHAR(50) DEFAULT 'NEAREST' NOT NULL, rum_prefix VARCHAR(255), rum_sequence_size BIGINT, rum_current_sequence_nb BIGINT, cust_no_prefix VARCHAR(255), cust_no_sequence_size BIGINT, cust_no_current_sequence_nb BIGINT, invoice_config_id BIGINT, gdpr_config_id BIGINT, cdr_deduplicationkey_el VARCHAR(500), payment_deferral INTEGER DEFAULT 0, payment_plan INTEGER DEFAULT 0, maximum_delay INTEGER, maximum_deferral_per_invoice INTEGER, min_allowed_receivable_amount numeric(23, 12), max_allowed_receivable_amount numeric(23, 12), min_installment_amount numeric(23, 12), theres_hold_for_approval numeric(23, 12), max_payment_plan_duration INTEGER, default_installment_count INTEGER, default_fee_per_installment_plan INTEGER DEFAULT 0, installment_amount_rounding INTEGER DEFAULT 2, split_evenly INTEGER DEFAULT 1 NOT NULL, allow_custom_installment_plan INTEGER DEFAULT 0 NOT NULL, add_interest_rate INTEGER DEFAULT 0 NOT NULL, add_installment_fee INTEGER DEFAULT 0 NOT NULL, default_block_payments INTEGER DEFAULT 0 NOT NULL, require_internal_approval INTEGER DEFAULT 0 NOT NULL, default_interest_rate INTEGER DEFAULT 0 NOT NULL, default_recurrence_unit VARCHAR(255), action_on_remaining_amount VARCHAR(255), clearing_priority VARCHAR(255), dunning_default_pause_reason_id BIGINT, functional_currency_flag INTEGER DEFAULT 0 NOT NULL, default_starting_date_of_plan VARCHAR(255), activate_cascading_discounts INTEGER DEFAULT 1, portal_message VARCHAR(500), current_matching_code VARCHAR(255), icd_id BIGINT, CONSTRAINT crm_provider_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-248', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 251, '9:8387268603eb3bdf25768ab2f9330c83', 'createTable tableName=crm_provider', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-250::AndriusKarpavicius
CREATE TABLE crm_provider_contact (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), address_1 VARCHAR(255), address_2 VARCHAR(255), address_3 VARCHAR(255), address_4 VARCHAR(255), address_5 VARCHAR(255), address_city VARCHAR(100), address_country_id BIGINT, address_state VARCHAR(50), address_zipcode VARCHAR(20), email VARCHAR(100), fax VARCHAR(50), firstname VARCHAR(50), generic_mail VARCHAR(100), lastname VARCHAR(50), mobile VARCHAR(50), phone VARCHAR(50), creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT crm_provider_contact_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-250', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 253, '9:87fc077cd056a146b0ba482c79944737', 'createTable tableName=crm_provider_contact', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-251::AndriusKarpavicius
CREATE TABLE crm_seller (id BIGINT NOT NULL, parent_seller_id BIGINT, trading_country_id BIGINT, trading_currency_id BIGINT, trading_language_id BIGINT, credit_note_prefix VARCHAR(255), current_credit_note_nb BIGINT, credit_note_sequence_size INTEGER, legal_text TEXT, legal_type VARCHAR(255), general_ledger_id BIGINT, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), address_1 VARCHAR(255), address_2 VARCHAR(255), address_3 VARCHAR(255), address_4 VARCHAR(255), address_5 VARCHAR(255), address_city VARCHAR(100), address_country_id BIGINT, address_state VARCHAR(50), address_zipcode VARCHAR(20), default_level INTEGER DEFAULT 1, external_ref_1 VARCHAR(255), external_ref_2 VARCHAR(255), firstname VARCHAR(100), lastname VARCHAR(100), provider_contact VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), title_id BIGINT, primary_contact BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, bam_id BIGINT, cf_values JSONB, job_title VARCHAR(255), email VARCHAR(2000), fax VARCHAR(50), mobile VARCHAR(100), phone VARCHAR(100), vat_no VARCHAR(100), vat_status VARCHAR(25) DEFAULT 'UNKNOWN', minimum_amount_el VARCHAR(2000), minimum_label_el VARCHAR(2000), minimum_charge_template_id BIGINT, company INTEGER DEFAULT 0, legal_entity_type_id BIGINT, minimum_article_id BIGINT, CONSTRAINT crm_seller_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-251', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 255, '9:6203481d324619f4a9de08fc73330da3', 'createTable tableName=crm_seller', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-252::AndriusKarpavicius
CREATE TABLE dwh_account_operation (id BIGINT NOT NULL, account_code VARCHAR(50), account_description VARCHAR(255), accounting_code_id BIGINT, accounting_code_client_side VARCHAR(255), amount numeric(19, 2), category INTEGER DEFAULT 0, due_date date, due_month INTEGER, occ_code VARCHAR(10), occ_description VARCHAR(255), provider_code VARCHAR(20), reference VARCHAR(50), status INTEGER DEFAULT 0, transaction_date date, type INTEGER DEFAULT 0, version INTEGER, CONSTRAINT dwh_account_operation_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-252', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 257, '9:3e67b0c8071d0465df2f7c243f234c99', 'createTable tableName=dwh_account_operation', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-253::AndriusKarpavicius
CREATE TABLE dwh_chart (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), extender VARCHAR(255), css_style VARCHAR(1000), css_style_class VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), msr_qty_id BIGINT, role VARCHAR(50), width VARCHAR(10), height VARCHAR(10), visible INTEGER DEFAULT 0, CONSTRAINT dwh_chart_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-253', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 259, '9:28410537700be6290bb2e3cd6af50768', 'createTable tableName=dwh_chart', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-254::AndriusKarpavicius
CREATE TABLE dwh_chart_bar (animate INTEGER DEFAULT 0 NOT NULL, barmargin INTEGER NOT NULL, barpadding INTEGER NOT NULL, break_on_null INTEGER DEFAULT 0 NOT NULL, data_tip_format VARCHAR(255), legend_cols INTEGER, legend_position VARCHAR(255), legend_rows INTEGER, max FLOAT8, min FLOAT8, orientation INTEGER, show_data_tip INTEGER DEFAULT 0 NOT NULL, stacked INTEGER DEFAULT 0 NOT NULL, x_axis_angle INTEGER, x_axis_label VARCHAR(255), y_axis_angle INTEGER, y_axis_label VARCHAR(255), zoom INTEGER DEFAULT 0 NOT NULL, id BIGINT NOT NULL, CONSTRAINT dwh_chart_bar_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-254', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 261, '9:2e87f5dce3896146159ebe9d8e09dc37', 'createTable tableName=dwh_chart_bar', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-255::AndriusKarpavicius
CREATE TABLE dwh_chart_line (animate INTEGER DEFAULT 0 NOT NULL, break_on_null INTEGER DEFAULT 0 NOT NULL, data_tip_format VARCHAR(255), filled INTEGER DEFAULT 0 NOT NULL, legend_cols INTEGER, legend_position VARCHAR(255), legend_rows INTEGER, max_x INTEGER, max_y INTEGER, min_x INTEGER, min_y INTEGER, series_colors VARCHAR(1000), shadow INTEGER DEFAULT 1 NOT NULL, show_data_tip INTEGER DEFAULT 0 NOT NULL, stacked INTEGER DEFAULT 0 NOT NULL, x_axis_angle INTEGER, x_axis_label VARCHAR(255), y_axis_angle INTEGER, y_axis_label VARCHAR(255), zoom INTEGER DEFAULT 0 NOT NULL, id BIGINT NOT NULL, CONSTRAINT dwh_chart_line_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-255', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 263, '9:8647f6bcbdae9709cf5e2d013e80dfbf', 'createTable tableName=dwh_chart_line', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-256::AndriusKarpavicius
CREATE TABLE dwh_chart_pie (diameter INTEGER, filled INTEGER DEFAULT 0 NOT NULL, legend_cols INTEGER, legend_position VARCHAR(255), legend_rows INTEGER, series_colors VARCHAR(1000), shadow INTEGER DEFAULT 1 NOT NULL, show_data_labels INTEGER DEFAULT 0 NOT NULL, slice_margin INTEGER, id BIGINT NOT NULL, CONSTRAINT dwh_chart_pie_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-256', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 265, '9:efb98413d99743f76252c049aa203b5c', 'createTable tableName=dwh_chart_pie', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-257::AndriusKarpavicius
CREATE TABLE dwh_journal_entries (id BIGINT NOT NULL, accounting_code_id BIGINT, amount_tax numeric(23, 12), amount_with_tax numeric(23, 12), amount_without_tax numeric(23, 12), customer_account_code VARCHAR(20), invoice_date date, invoice_number VARCHAR(20), origin_id BIGINT, provider_code VARCHAR(20), sub_cat_desc VARCHAR(50), tax_code VARCHAR(10), tax_description VARCHAR(20), tax_percent numeric(19, 2), type VARCHAR(255), version INTEGER, CONSTRAINT dwh_journal_entries_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-257', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 267, '9:32625afc93519bcac1ad14945a131e38', 'createTable tableName=dwh_journal_entries', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-258::AndriusKarpavicius
CREATE TABLE dwh_measurable_quant (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), dimension_1 VARCHAR(255), dimension_2 VARCHAR(255), dimension_3 VARCHAR(255), dimension_4 VARCHAR(255), editable INTEGER DEFAULT 0 NOT NULL, last_measure_date TIMESTAMP WITHOUT TIME ZONE, measurement_period VARCHAR(255), sql_query TEXT, theme VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), additive INTEGER DEFAULT 0 NOT NULL, description_i18n JSONB, CONSTRAINT dwh_measurable_quant_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-258', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 269, '9:4f9212e0264aec7e52c69fb526ce03b0', 'createTable tableName=dwh_measurable_quant', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-259::AndriusKarpavicius
CREATE TABLE dwh_measured_value (id BIGINT NOT NULL, version INTEGER, date TIMESTAMP WITHOUT TIME ZONE, measurement_period VARCHAR(255), value numeric(23, 12), measurable_quantity BIGINT, dimension_1 VARCHAR(255), dimension_2 VARCHAR(255), dimension_3 VARCHAR(255), dimension_4 VARCHAR(255), code VARCHAR(255) NOT NULL, CONSTRAINT dwh_measured_value_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-259', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 271, '9:ad8ed1b490e9fc4bb1daf9f12d64569a', 'createTable tableName=dwh_measured_value', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-260::AndriusKarpavicius
CREATE TABLE job_execution (id BIGINT NOT NULL, version INTEGER, job_done INTEGER DEFAULT 1 NOT NULL, end_date TIMESTAMP WITHOUT TIME ZONE, nb_success BIGINT, nb_error BIGINT, nb_warning BIGINT, nb_to_process BIGINT, report TEXT, start_date TIMESTAMP WITHOUT TIME ZONE, job_launcher VARCHAR(255), job_instance_id BIGINT NOT NULL, job_status VARCHAR(14), parent_job_result_id BIGINT, node VARCHAR(25), cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, CONSTRAINT job_execution_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-260', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 273, '9:cf048c8f3ec07c59cfdbd498bec8fb69', 'createTable tableName=job_execution', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-262::AndriusKarpavicius
CREATE TABLE medina_access (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, acces_user_id VARCHAR(255), end_date TIMESTAMP WITHOUT TIME ZONE, start_date TIMESTAMP WITHOUT TIME ZONE, subscription_id BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, cf_values JSONB, CONSTRAINT medina_access_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-262', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 275, '9:b74353231abb1a778e96062604a8373d', 'createTable tableName=medina_access', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-269::AndriusKarpavicius
CREATE TABLE meveo_timer (id BIGINT NOT NULL, version INTEGER, sc_d_o_month VARCHAR(255) NOT NULL, sc_d_o_week VARCHAR(255) NOT NULL, sc_end TIMESTAMP WITHOUT TIME ZONE, sc_hour VARCHAR(255) NOT NULL, sc_min VARCHAR(255) NOT NULL, sc_month VARCHAR(255) NOT NULL, sc_sec VARCHAR(255) NOT NULL, sc_start TIMESTAMP WITHOUT TIME ZONE, sc_year VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, creator VARCHAR(100), updated TIMESTAMP WITHOUT TIME ZONE, updater VARCHAR(100), disabled INTEGER DEFAULT 0 NOT NULL, CONSTRAINT meveo_timer_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-269', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 277, '9:2c1afd7e9302c0b71b678226ad882f5a', 'createTable tableName=meveo_timer', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-271::AndriusKarpavicius
CREATE TABLE rating_edr (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE, event_date TIMESTAMP WITHOUT TIME ZONE, last_updated TIMESTAMP WITHOUT TIME ZONE, origin_batch VARCHAR(255), origin_record VARCHAR(255), parameter_1 VARCHAR(255), parameter_2 VARCHAR(255), parameter_3 VARCHAR(255), parameter_4 VARCHAR(255), quantity numeric(23, 12), reject_reason TEXT, status VARCHAR(255), subscription_id BIGINT NOT NULL, parameter_5 VARCHAR(255), parameter_6 VARCHAR(255), parameter_7 VARCHAR(255), parameter_8 VARCHAR(255), parameter_9 VARCHAR(255), date_parameter_1 TIMESTAMP WITHOUT TIME ZONE, date_parameter_2 TIMESTAMP WITHOUT TIME ZONE, date_parameter_3 TIMESTAMP WITHOUT TIME ZONE, date_parameter_4 TIMESTAMP WITHOUT TIME ZONE, date_parameter_5 TIMESTAMP WITHOUT TIME ZONE, decimal_parameter_1 numeric(23, 12), decimal_parameter_2 numeric(23, 12), decimal_parameter_3 numeric(23, 12), decimal_parameter_4 numeric(23, 12), decimal_parameter_5 numeric(23, 12), access_code VARCHAR(255), header_edr_id BIGINT, extra_parameter TEXT, times_tried INTEGER, event_key VARCHAR(100), event_version INTEGER, wallet_operation_id BIGINT, business_key VARCHAR(255), zero_wo_dropped INTEGER DEFAULT 0) PARTITION BY LIST(status);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-271', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 279, '9:c70e50227570f89cc74b4c656a0ef3eb', 'createTable tableName=rating_edr', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-271-pk::AndriusKarpavicius
ALTER TABLE rating_edr ADD CONSTRAINT rating_edr_pkey PRIMARY KEY (id, status);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-271-pk', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 281, '9:2debeaeb336260a7b9f3aaeadf0d07a4', 'addPrimaryKey constraintName=rating_edr_pkey, tableName=rating_edr', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-272::AndriusKarpavicius
CREATE TABLE report_emails (email_id BIGINT NOT NULL, report_id BIGINT NOT NULL);

ALTER TABLE report_emails ADD CONSTRAINT report_emails_pkey PRIMARY KEY (email_id, report_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-272', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 283, '9:977b0519bdf16a3e27a8525fb8cec34b', 'createTable tableName=report_emails; addPrimaryKey constraintName=report_emails_pkey, tableName=report_emails', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-273::AndriusKarpavicius
CREATE TABLE rm_service_param_template (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), cumulative_periods INTEGER, default_value VARCHAR(255), name VARCHAR(255), value VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT rm_service_param_template_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-273', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 285, '9:2c43892eeddda9920cd97cf70768383d', 'createTable tableName=rm_service_param_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-275::AndriusKarpavicius
CREATE TABLE billing_invoice_configuration (id BIGINT NOT NULL, version INTEGER, display_subscriptions INTEGER DEFAULT 0, display_services INTEGER DEFAULT 0, display_offers INTEGER DEFAULT 0, display_edrs INTEGER DEFAULT 0, display_provider INTEGER DEFAULT 0, display_detail INTEGER DEFAULT 1, display_priceplans INTEGER DEFAULT 0, display_cf_as_xml INTEGER DEFAULT 0, display_billing_cycle INTEGER DEFAULT 0, display_orders INTEGER DEFAULT 0, current_invoice_nb BIGINT, display_wallet_operations INTEGER DEFAULT 0, display_user_account_hierarchy INTEGER DEFAULT 0, default_invoice_subcategory_id BIGINT, default_generic_article_id BIGINT, default_discount_article_id BIGINT, default_advanced_payment_article_id BIGINT, default_invoice_minimum_article_id BIGINT, discount_plan_id BIGINT, display_tax_details INTEGER DEFAULT 0, display_rated_items INTEGER DEFAULT 0, CONSTRAINT billing_invoice_configuration_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-275', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 287, '9:b1c19f12a597a37e60a6031a752b8222', 'createTable tableName=billing_invoice_configuration', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-276::AndriusKarpavicius
CREATE TABLE ar_credit_category (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), description_i18n JSONB, provider_id BIGINT, CONSTRAINT ar_credit_category_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-276', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 289, '9:9b97c256d6ef4f7561fe06424e2cb3c1', 'createTable tableName=ar_credit_category', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-277::AndriusKarpavicius
CREATE TABLE meveo_job_instance (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 1 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), job_category VARCHAR(255), job_template VARCHAR(255) NOT NULL, parametres VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), timerentity_id BIGINT, following_job_id BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, run_on_nodes VARCHAR(500), cf_values JSONB, exclude_inv_without_amount INTEGER DEFAULT 0, verbose_report INTEGER DEFAULT 1, stop_on_error INTEGER DEFAULT 0, job_speed VARCHAR(10) DEFAULT 'NORMAL', query_scheduler_id BIGINT, cluster_behavior VARCHAR(25) DEFAULT 'LIMIT_TO_SINGLE_NODE', status_report_freq INTEGER DEFAULT 60, limit_to_nr_of_nodes INTEGER, description_i18n JSONB, process_next_job_on_error INTEGER DEFAULT 0, CONSTRAINT meveo_job_instance_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-277', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 291, '9:1262c47f96919d525bb49b38bca6654c', 'createTable tableName=meveo_job_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-278::AndriusKarpavicius
CREATE TABLE com_meveo_instance (id BIGINT NOT NULL, version INTEGER DEFAULT 0, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), as_vendor VARCHAR(255), as_version VARCHAR(255), creation_date TIMESTAMP WITHOUT TIME ZONE, hd_size VARCHAR(255), installation_mode VARCHAR(255), java_vendor VARCHAR(255), java_version VARCHAR(255), java_vm_name VARCHAR(255), java_vm_version VARCHAR(255), key_entreprise VARCHAR(255), mac_address VARCHAR(255), machine_vendor VARCHAR(255), md5 VARCHAR(255), memory VARCHAR(255), nb_cores VARCHAR(255), os_arch VARCHAR(255), os_name VARCHAR(255), ps_version VARCHAR(255), owner VARCHAR(255), product_name VARCHAR(255), product_version VARCHAR(255), status VARCHAR(255), update_date TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), user_id BIGINT, customer_id BIGINT, url VARCHAR(255) DEFAULT 'http://' NOT NULL, auth_username VARCHAR(60), auth_password VARCHAR(60), client_id VARCHAR(60), client_secret VARCHAR(60), authentication_type VARCHAR(60), CONSTRAINT com_meveo_instance_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-278', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 293, '9:2c2412d6bfd7d2f6d7098662d9656b48', 'createTable tableName=com_meveo_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-280::AndriusKarpavicius
CREATE TABLE meveo_script_instance (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), script TEXT, script_instance_cat_id BIGINT, creator VARCHAR(100), updater VARCHAR(100), src_type VARCHAR(100), is_error INTEGER DEFAULT 0 NOT NULL, reuse INTEGER DEFAULT 0 NOT NULL, description_i18n JSONB, use_pool INTEGER DEFAULT 0 NOT NULL, min_pool INTEGER, max_pool INTEGER, max_idle_time_pool INTEGER, CONSTRAINT meveo_script_instance_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-280', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 295, '9:c5fac711323d3175ebe5cea046983373', 'createTable tableName=meveo_script_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-281::AndriusKarpavicius
CREATE TABLE adm_notif_job (job_instance_id BIGINT, id BIGINT NOT NULL, CONSTRAINT adm_notif_job_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-281', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 297, '9:f5afcea5244c8f1e23bec1a605f0d3c6', 'createTable tableName=adm_notif_job', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-282::AndriusKarpavicius
CREATE TABLE meveo_filter_condition (id BIGINT NOT NULL, version INTEGER, composite_and_filter_condition_id BIGINT, composite_or_filter_condition_id BIGINT, filter_condition_type VARCHAR(50) NOT NULL, CONSTRAINT meveo_filter_condition_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-282', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 299, '9:a14d242aea370dcfb74bdfc888224b82', 'createTable tableName=meveo_filter_condition', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-283::AndriusKarpavicius
CREATE TABLE meveo_filter_oc_field_names (field_name VARCHAR(100), order_condition_id BIGINT);

ALTER TABLE meveo_filter_oc_field_names ADD CONSTRAINT meveo_filter_oc_field_names_pkey PRIMARY KEY (field_name, order_condition_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-283', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 301, '9:a00aca990e63770d337d6deb97e3e77b', 'createTable tableName=meveo_filter_oc_field_names; addPrimaryKey constraintName=meveo_filter_oc_field_names_pkey, tableName=meveo_filter_oc_field_names', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-284::AndriusKarpavicius
CREATE TABLE meveo_filter_order_condition (id BIGINT NOT NULL, version INTEGER, ascending INTEGER DEFAULT 0 NOT NULL, CONSTRAINT meveo_filter_order_condition_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-284', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 303, '9:712ae2ce28eb0e2f2df7d02fb02b07b6', 'createTable tableName=meveo_filter_order_condition', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-285::AndriusKarpavicius
CREATE TABLE meveo_primitive_filter_condition (id BIGINT NOT NULL, version INTEGER, field_name VARCHAR(60), operator VARCHAR(60), operand VARCHAR(255), CONSTRAINT meveo_primitive_filter_condition_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-285', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 305, '9:5824f39a3a00f4a052c749227bf18827', 'createTable tableName=meveo_primitive_filter_condition', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-286::AndriusKarpavicius
CREATE TABLE meveo_native_filter_condition (id BIGINT NOT NULL, version INTEGER, el VARCHAR(2000), jpql VARCHAR(2000), CONSTRAINT meveo_native_filter_condition_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-286', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 307, '9:906a274befd87da03b368af236ae35e8', 'createTable tableName=meveo_native_filter_condition', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-287::AndriusKarpavicius
CREATE TABLE meveo_filter (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), filter_condition_id BIGINT, order_condition_id BIGINT, primary_selector_id BIGINT, input_xml TEXT, shared INTEGER DEFAULT 0, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, polling_query TEXT, entity_class VARCHAR(255), CONSTRAINT meveo_filter_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-287', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 309, '9:954c3571f87af5de8b8f5a3ad47a1656', 'createTable tableName=meveo_filter', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-288::AndriusKarpavicius
CREATE TABLE meveo_filter_selector (id BIGINT NOT NULL, version INTEGER, target_entity VARCHAR(100) NOT NULL, alias VARCHAR(50), filter_id BIGINT, CONSTRAINT meveo_filter_selector_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-288', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 311, '9:a5c9f2843263bbd2636be788d5857384', 'createTable tableName=meveo_filter_selector', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-289::AndriusKarpavicius
CREATE TABLE meveo_or_composite_filter_condition (id BIGINT NOT NULL, version INTEGER, CONSTRAINT meveo_or_composite_filter_condition_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-289', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 313, '9:84dc4c9ef0c546e2ae67609a254a9454', 'createTable tableName=meveo_or_composite_filter_condition', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-290::AndriusKarpavicius
CREATE TABLE meveo_and_composite_filter_condition (id BIGINT NOT NULL, version INTEGER, CONSTRAINT meveo_and_composite_filter_condition_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-290', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 315, '9:38c1d4004f021df6918b3e5404f54338', 'createTable tableName=meveo_and_composite_filter_condition', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-291::AndriusKarpavicius
CREATE TABLE meveo_filter_selector_display_fields (filter_selector_id BIGINT NOT NULL, display_field VARCHAR(100));

ALTER TABLE meveo_filter_selector_display_fields ADD CONSTRAINT meveo_filter_selector_display_fields_pkey PRIMARY KEY (filter_selector_id, display_field);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-291', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 317, '9:4f102f771de762c4b3464628c9947ef5', 'createTable tableName=meveo_filter_selector_display_fields; addPrimaryKey constraintName=meveo_filter_selector_display_fields_pkey, tableName=meveo_filter_selector_display_fields', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-292::AndriusKarpavicius
CREATE TABLE meveo_filter_selector_export_fields (filter_selector_id BIGINT NOT NULL, export_field VARCHAR(100));

ALTER TABLE meveo_filter_selector_export_fields ADD CONSTRAINT meveo_filter_selector_export_fields_pkey PRIMARY KEY (filter_selector_id, export_field);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-292', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 319, '9:53f8b47ad923f10adab48518de51b38a', 'createTable tableName=meveo_filter_selector_export_fields; addPrimaryKey constraintName=meveo_filter_selector_export_fields_pkey, tableName=meveo_filter_selector_export_fields', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-293::AndriusKarpavicius
CREATE TABLE meveo_filter_selector_ignore_fields (filter_selector_id BIGINT NOT NULL, ignored_field VARCHAR(100));

ALTER TABLE meveo_filter_selector_ignore_fields ADD CONSTRAINT meveo_filter_selector_ignore_fields_pkey PRIMARY KEY (filter_selector_id, ignored_field);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-293', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 321, '9:402f9a45057980e2f80c042ca63e8216', 'createTable tableName=meveo_filter_selector_ignore_fields; addPrimaryKey constraintName=meveo_filter_selector_ignore_fields_pkey, tableName=meveo_filter_selector_ignore_fields', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-294::AndriusKarpavicius
CREATE TABLE adm_notification_params (notification_id BIGINT NOT NULL, params VARCHAR(255), params_key VARCHAR(255) NOT NULL);

ALTER TABLE adm_notification_params ADD CONSTRAINT pk_adm_notification_params PRIMARY KEY (notification_id, params_key);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-294', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 323, '9:165c69ca28e9f79580c7ca463d23d26c', 'createTable tableName=adm_notification_params; addPrimaryKey constraintName=pk_adm_notification_params, tableName=adm_notification_params', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-295::AndriusKarpavicius
CREATE TABLE adm_notif_job_params (jobtrigger_id BIGINT NOT NULL, jobparams VARCHAR(255), jobparams_key VARCHAR(255) NOT NULL);

ALTER TABLE adm_notif_job_params ADD CONSTRAINT pk_adm_notif_job_params PRIMARY KEY (jobtrigger_id, jobparams_key);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-295', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 325, '9:410b41b365f6d9a8922f1798592505d2', 'createTable tableName=adm_notif_job_params; addPrimaryKey constraintName=pk_adm_notif_job_params, tableName=adm_notif_job_params', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-298::AndriusKarpavicius
CREATE TABLE cust_cet (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, description VARCHAR(255), code VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), name VARCHAR(100) NOT NULL, store_as_table INTEGER DEFAULT 0, unique_constraint_name VARCHAR(120) DEFAULT '0', store_in_es INTEGER DEFAULT 1 NOT NULL, disableable INTEGER DEFAULT 0, versioned INTEGER DEFAULT 0, CONSTRAINT cust_cet_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-298', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 327, '9:9bfdb40e8ebbec5bd03202144a6824cc', 'createTable tableName=cust_cet', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-299::AndriusKarpavicius
CREATE TABLE adm_script_notification (id BIGINT NOT NULL, CONSTRAINT adm_script_notification_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-299', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 329, '9:2865e9436b1b63dfc9fc512d1760972d', 'createTable tableName=adm_script_notification', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-300::AndriusKarpavicius
CREATE TABLE cust_cei (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, description VARCHAR(255), code VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), cet_code VARCHAR(255) NOT NULL, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, parent_uuid VARCHAR(60), cf_values JSONB, CONSTRAINT crm_cust_cei_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-300', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 331, '9:aeb24828742353c717201ee1b80f5e52', 'createTable tableName=cust_cei', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-301::AndriusKarpavicius
CREATE TABLE meveo_module (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), code VARCHAR(255) NOT NULL, description VARCHAR(255), module_license VARCHAR(20) NOT NULL, logo_picture VARCHAR(255), script_instance_id BIGINT, installed INTEGER DEFAULT 0 NOT NULL, module_source TEXT, CONSTRAINT meveo_module_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-301', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 333, '9:20f3a3d515f0b1a300ea4c2c414a1112', 'createTable tableName=meveo_module', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-302::AndriusKarpavicius
CREATE TABLE meveo_module_item (id BIGINT NOT NULL, version INTEGER, module_id BIGINT, applies_to VARCHAR(100), item_type VARCHAR(100) NOT NULL, item_code VARCHAR(255) NOT NULL, valid_from TIMESTAMP WITHOUT TIME ZONE, valid_to TIMESTAMP WITHOUT TIME ZONE, CONSTRAINT meveo_module_item_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-302', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 335, '9:ec4f7b04dfca23ef743424d03958df6e', 'createTable tableName=meveo_module_item', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-303::AndriusKarpavicius
CREATE TABLE ftp_transferred_file (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), code VARCHAR(255) NOT NULL, description VARCHAR(255), uri VARCHAR(2000) NOT NULL, size BIGINT, transfer_date TIMESTAMP WITHOUT TIME ZONE, last_modification TIMESTAMP WITHOUT TIME ZONE, operation VARCHAR(100) DEFAULT 'IMPORT', CONSTRAINT ftp_transferred_file_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-303', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 337, '9:199384f3050b45512b9f3c5e498384a3', 'createTable tableName=ftp_transferred_file', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-304::AndriusKarpavicius
CREATE TABLE adm_role_role (role_id BIGINT NOT NULL, child_role_id BIGINT NOT NULL);

ALTER TABLE adm_role_role ADD CONSTRAINT adm_role_role_pkey PRIMARY KEY (role_id, child_role_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-304', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 339, '9:73e80c880ee26fece34f495f0bac6a58', 'createTable tableName=adm_role_role; addPrimaryKey constraintName=adm_role_role_pkey, tableName=adm_role_role', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-306::AndriusKarpavicius
CREATE TABLE adm_script_exec_role (script_instance_id BIGINT NOT NULL, role VARCHAR(50));

ALTER TABLE adm_script_exec_role ADD CONSTRAINT adm_script_exec_role_pkey PRIMARY KEY (script_instance_id, role);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-306', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 341, '9:1ddadb82f42dd2aabe2f6bf2fce0a769', 'createTable tableName=adm_script_exec_role; addPrimaryKey constraintName=adm_script_exec_role_pkey, tableName=adm_script_exec_role', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-307::AndriusKarpavicius
CREATE TABLE adm_script_sourc_role (script_instance_id BIGINT NOT NULL, role VARCHAR(50));

ALTER TABLE adm_script_sourc_role ADD CONSTRAINT adm_script_sourc_role_pkey PRIMARY KEY (script_instance_id, role);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-307', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 343, '9:5006478dc1c826373cc3f1fed17f5003', 'createTable tableName=adm_script_sourc_role; addPrimaryKey constraintName=adm_script_sourc_role_pkey, tableName=adm_script_sourc_role', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-308::AndriusKarpavicius
CREATE TABLE cat_offer_template_category (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), code VARCHAR(255) NOT NULL, description VARCHAR(255), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, name VARCHAR(100) NOT NULL, offer_template_category_id BIGINT, order_level INTEGER, image_path VARCHAR(100), cf_values JSONB, description_i18n JSONB, CONSTRAINT pk_cat_offer_template_category PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-308', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 345, '9:c8af0ac2dd8ce35d6ccbce7a7b9c9e03', 'createTable tableName=cat_offer_template_category', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-309::AndriusKarpavicius
CREATE TABLE cat_business_offer_model (id BIGINT NOT NULL, offer_template_id BIGINT, description_i18n JSONB, CONSTRAINT pk_cat_bom PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-309', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 347, '9:97f438b2b6b79c2f49f3d3181cb1f4a2', 'createTable tableName=cat_business_offer_model', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-310::AndriusKarpavicius
CREATE TABLE cat_business_serv_model (id BIGINT NOT NULL, service_template_id BIGINT, duplicate_service INTEGER DEFAULT 0 NOT NULL, duplicate_price_plan INTEGER DEFAULT 0 NOT NULL, description_i18n JSONB, CONSTRAINT pk_cat_bsm PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-310', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 349, '9:0723b187419448cad1b47cdaed5ea241', 'createTable tableName=cat_business_serv_model', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-311::AndriusKarpavicius
CREATE TABLE cat_offer_serv_incomp (offer_service_template_id BIGINT NOT NULL, service_template_id BIGINT NOT NULL);

ALTER TABLE cat_offer_serv_incomp ADD CONSTRAINT pk_cat_offer_serv_incomp PRIMARY KEY (offer_service_template_id, service_template_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-311', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 351, '9:8cc74f05420b8096c5cd6a606db37e92', 'createTable tableName=cat_offer_serv_incomp; addPrimaryKey constraintName=pk_cat_offer_serv_incomp, tableName=cat_offer_serv_incomp', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-312::AndriusKarpavicius
CREATE TABLE crm_custom_field_tmpl_mcols (cft_id BIGINT NOT NULL, position INTEGER NOT NULL, code VARCHAR(20) NOT NULL, label VARCHAR(50) NOT NULL, key_type INTEGER NOT NULL, column_use INTEGER DEFAULT 0 NOT NULL);

ALTER TABLE crm_custom_field_tmpl_mcols ADD CONSTRAINT crm_custom_field_tmpl_mcols_pkey PRIMARY KEY (cft_id, code);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-312', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 353, '9:4770dec27085f92a3d08971a9579b461', 'createTable tableName=crm_custom_field_tmpl_mcols; addPrimaryKey constraintName=crm_custom_field_tmpl_mcols_pkey, tableName=crm_custom_field_tmpl_mcols', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-313::AndriusKarpavicius
CREATE TABLE crm_business_account_model (id BIGINT NOT NULL, hierarchy_type VARCHAR(20) NOT NULL, CONSTRAINT crm_bam_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-313', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 355, '9:b1c63b6129ca9a234d7713b1839b6a20', 'createTable tableName=crm_business_account_model', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-314::AndriusKarpavicius
CREATE TABLE ar_revenue_recog_rule (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), code VARCHAR(255), description VARCHAR(255), script_instance_id BIGINT NOT NULL, start_delay INTEGER, start_unit VARCHAR(20), start_event VARCHAR(20), stop_delay INTEGER, stop_unit VARCHAR(20), stop_event VARCHAR(20), CONSTRAINT ar_revenue_recog_rule_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-314', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 357, '9:b43ac36aee55d9590d279723e4628bf0', 'createTable tableName=ar_revenue_recog_rule', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-315::AndriusKarpavicius
CREATE TABLE ar_revenue_schedule (id BIGINT NOT NULL, version INTEGER, charge_instance_id BIGINT NOT NULL, revenue_date TIMESTAMP WITHOUT TIME ZONE, recognized_revenue numeric(23, 12), invoiced_revenue numeric(23, 12), accrued_revenue numeric(23, 12), deffered_revenue numeric(23, 12), CONSTRAINT ar_revenue_schedule_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-315', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 359, '9:0112091dc3b19885f9f2da7fbc5eee80', 'createTable tableName=ar_revenue_schedule', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-316::AndriusKarpavicius
CREATE TABLE crm_custom_action (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), code VARCHAR(255) NOT NULL, description VARCHAR(255), applies_to VARCHAR(100) NOT NULL, applicable_on_el VARCHAR(2000), label VARCHAR(50), script_instance_id BIGINT NOT NULL, gui_position VARCHAR(2000), label_i18n JSONB, CONSTRAINT crm_custom_action_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-316', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 361, '9:c4bfcec702346208715fcfb1ad620dc7', 'createTable tableName=crm_custom_action', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-317::AndriusKarpavicius
CREATE TABLE billing_invoice_type (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), code VARCHAR(255) NOT NULL, description VARCHAR(255), prefix_el VARCHAR(2000), matching_auto INTEGER DEFAULT 0, occ_template_id BIGINT, occ_templ_negative_id BIGINT, pdf_filename_el VARCHAR(2000), xml_filename_el VARCHAR(2000), billing_template_name_el VARCHAR(2000), use_self_sequence INTEGER DEFAULT 0, occ_template_code_el VARCHAR(2000), occ_template_negative_code_el VARCHAR(2000), script_instance_id BIGINT, invoice_sequence_id BIGINT, tax_script_instance_id BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, mailing_type VARCHAR(255), email_template_id BIGINT, invoice_accountable INTEGER DEFAULT 1 NOT NULL, invoice_validation_script_id BIGINT, exclude_from_aged_trial_balance INTEGER DEFAULT 0 NOT NULL, invoice_code_type_id BIGINT, vat_payment_option_id BIGINT NOT NULL, invoice_subject_code BIGINT, description_i18n JSONB, custom_ubl_script_id BIGINT, CONSTRAINT billing_invoice_type_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-317', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 363, '9:0fc135dcb40bbc66d78f4f29096a30b6', 'createTable tableName=billing_invoice_type', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-318::AndriusKarpavicius
CREATE TABLE billing_invoice_type_applies_to (invoice_type_id BIGINT NOT NULL, applies_to_id BIGINT NOT NULL);

ALTER TABLE billing_invoice_type_applies_to ADD CONSTRAINT billing_invoice_type_applies_to_pkey PRIMARY KEY (invoice_type_id, applies_to_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-318', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 365, '9:bd746b96a815cd0a905bf0a91b8100e6', 'createTable tableName=billing_invoice_type_applies_to; addPrimaryKey constraintName=billing_invoice_type_applies_to_pkey, tableName=billing_invoice_type_applies_to', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-320::AndriusKarpavicius
CREATE TABLE billing_seq_invtyp_sell (id BIGINT NOT NULL, invoicetype_id BIGINT NOT NULL, seller_id BIGINT NOT NULL, prefix_el VARCHAR(2000), invoice_sequence_id BIGINT, CONSTRAINT bill_seq_it_sell_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-320', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 367, '9:dcf080b044b7d9ae5bf9827f01a86671', 'createTable tableName=billing_seq_invtyp_sell', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-321::AndriusKarpavicius
CREATE TABLE adm_secured_entity (id BIGINT NOT NULL, entity_code VARCHAR(255) NOT NULL, entity_class VARCHAR(255) NOT NULL, disabled INTEGER DEFAULT 0 NOT NULL, user_name VARCHAR(255), role_name VARCHAR(255), entity_id BIGINT, permission VARCHAR(6), CONSTRAINT adm_secured_entity_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-321', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 369, '9:b133ce11c519ba62fea0f31d1e41fbf8', 'createTable tableName=adm_secured_entity', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-322::AndriusKarpavicius
CREATE TABLE wf_action (id BIGINT NOT NULL, version INTEGER, action_el VARCHAR(2000), condition_el VARCHAR(2000), priority INTEGER, wf_transition_id BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, CONSTRAINT wf_action_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-322', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 371, '9:9e94c8e9003057b84f528bea703bbc1d', 'createTable tableName=wf_action', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-323::AndriusKarpavicius
CREATE TABLE wf_transition (id BIGINT NOT NULL, version INTEGER, condition_el VARCHAR(2000), from_status VARCHAR(255), to_status VARCHAR(255), workflow_id BIGINT, priority INTEGER, description VARCHAR(255), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, CONSTRAINT wf_transition_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-323', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 373, '9:646b3fec3bb7a7c36ce3126de40ff413', 'createTable tableName=wf_transition', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-324::AndriusKarpavicius
CREATE TABLE wf_workflow (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), enable_history INTEGER DEFAULT 0 NOT NULL, wf_type VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT wf_workflow_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-324', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 375, '9:6d76e2e9f9bdf6f33b68fe0169ee6c0e', 'createTable tableName=wf_workflow', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-325::AndriusKarpavicius
CREATE TABLE cat_channel (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), description_i18n JSONB, CONSTRAINT cat_channel_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-325', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 377, '9:d7181691195df3dcddb6bf42eaa2762f', 'createTable tableName=cat_channel', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-326::AndriusKarpavicius
CREATE TABLE cat_business_product_model (id BIGINT NOT NULL, product_template_id BIGINT, description_i18n JSONB, CONSTRAINT pk_cat_business_product_model PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-326', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 379, '9:bb6490432672758eece5fe2a5dfc626c', 'createTable tableName=cat_business_product_model', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-327::AndriusKarpavicius
CREATE TABLE cat_product_offer_tmpl_cat (product_id BIGINT NOT NULL, offer_template_cat_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE cat_product_offer_tmpl_cat ADD CONSTRAINT cat_product_offer_tmpl_cat_pkey PRIMARY KEY (product_id, offer_template_cat_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-327', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 381, '9:3830d9e1205a237fc1f1fbc4526d5c79', 'createTable tableName=cat_product_offer_tmpl_cat; addPrimaryKey constraintName=cat_product_offer_tmpl_cat_pkey, tableName=cat_product_offer_tmpl_cat', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-328::AndriusKarpavicius
CREATE TABLE cat_product_offer_bam (product_id BIGINT NOT NULL, bam_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE cat_product_offer_bam ADD CONSTRAINT cat_product_offer_bam_pkey PRIMARY KEY (product_id, bam_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-328', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 383, '9:0608e714911df7027ad46015ccb11c47', 'createTable tableName=cat_product_offer_bam; addPrimaryKey constraintName=cat_product_offer_bam_pkey, tableName=cat_product_offer_bam', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-329::AndriusKarpavicius
CREATE TABLE cat_product_offer_channels (product_id BIGINT NOT NULL, channel_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE cat_product_offer_channels ADD CONSTRAINT cat_prod_off_channels_pkey PRIMARY KEY (product_id, channel_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-329', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 385, '9:7f8e6a9b07e168cf24c559084dfdc9cb', 'createTable tableName=cat_product_offer_channels; addPrimaryKey constraintName=cat_prod_off_channels_pkey, tableName=cat_product_offer_channels', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-330::AndriusKarpavicius
CREATE TABLE cat_digital_resource (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), uri VARCHAR(255), mime_type VARCHAR(50), CONSTRAINT cat_digital_resource_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-330', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 387, '9:ba88a3493733ca6a9c3f77faf68d05bc', 'createTable tableName=cat_digital_resource', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-331::AndriusKarpavicius
CREATE TABLE cat_product_offer_digital_res (product_id BIGINT NOT NULL, digital_resource_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE cat_product_offer_digital_res ADD CONSTRAINT cat_product_offer_digital_res_pkey PRIMARY KEY (product_id, digital_resource_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-331', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 389, '9:9d4e4c4501147f7721febb4f7db204d0', 'createTable tableName=cat_product_offer_digital_res; addPrimaryKey constraintName=cat_product_offer_digital_res_pkey, tableName=cat_product_offer_digital_res', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-333::AndriusKarpavicius
CREATE TABLE cat_product_wallet_template (product_template_id BIGINT NOT NULL, wallet_template_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE cat_product_wallet_template ADD CONSTRAINT cat_product_wallet_template_pkey PRIMARY KEY (product_template_id, wallet_template_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-333', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 391, '9:b74de1e89f0f0922aa60d56cbeca4aba', 'createTable tableName=cat_product_wallet_template; addPrimaryKey constraintName=cat_product_wallet_template_pkey, tableName=cat_product_wallet_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-334::AndriusKarpavicius
CREATE TABLE cat_offer_product_template (id BIGINT NOT NULL, offer_template_id BIGINT, product_template_id BIGINT, mandatory INTEGER DEFAULT 0 NOT NULL, CONSTRAINT cat_offer_product_template_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-334', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 393, '9:99ad3a079a746aaadaf7a2bbdc5c9767', 'createTable tableName=cat_offer_product_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-335::AndriusKarpavicius
CREATE TABLE cat_bundle_product_template (id BIGINT NOT NULL, product_template_id BIGINT, bundle_template_id BIGINT, quantity INTEGER, CONSTRAINT cat_bundle_prod_tpl_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-335', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 395, '9:63cd9cbb4e90c20bf15795a94950a41a', 'createTable tableName=cat_bundle_product_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-336::AndriusKarpavicius
CREATE TABLE billing_product_instance (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), product_template_id BIGINT, quantity numeric(23, 12), user_account_id BIGINT, application_date TIMESTAMP WITHOUT TIME ZONE, subscription_id BIGINT, order_number VARCHAR(100), cf_values JSONB, seller_id BIGINT NOT NULL, CONSTRAINT billing_product_instance_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-336', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 397, '9:1057d96b53341f158a53fc2f6a5f0501', 'createTable tableName=billing_product_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-338::AndriusKarpavicius
CREATE TABLE ord_order (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), code VARCHAR(255) NOT NULL, description VARCHAR(255), external_id VARCHAR(100), delivery_instructions TEXT, order_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, req_start_date TIMESTAMP WITHOUT TIME ZONE, req_completion_date TIMESTAMP WITHOUT TIME ZONE, exp_completion_date TIMESTAMP WITHOUT TIME ZONE, completion_date TIMESTAMP WITHOUT TIME ZONE, priority INTEGER DEFAULT 2, category VARCHAR(200), status VARCHAR(20) NOT NULL, status_message VARCHAR(2000), routed_to_user_group VARCHAR(50), received_from VARCHAR(50), start_date TIMESTAMP WITHOUT TIME ZONE, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, due_date_delay_el VARCHAR(2000), payment_method_id BIGINT, cf_values JSONB, quote_id BIGINT, billing_cycle BIGINT, billing_run BIGINT, order_number VARCHAR(255), mailing_type VARCHAR(255), cced_emails VARCHAR(2000), email VARCHAR(255), electronic_billing INTEGER DEFAULT 0 NOT NULL, email_template_id BIGINT, CONSTRAINT ord_order_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-338', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 399, '9:04f3feb575cf590cc983d9ea90e58d7b', 'createTable tableName=ord_order', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-339::AndriusKarpavicius
CREATE TABLE ord_order_item (id BIGINT NOT NULL, version INTEGER, order_id BIGINT NOT NULL, item_id VARCHAR(10) NOT NULL, action VARCHAR(10) NOT NULL, user_account_id BIGINT, source TEXT NOT NULL, status VARCHAR(20) NOT NULL, subscription_id BIGINT, description VARCHAR(255), address_1 VARCHAR(255), address_2 VARCHAR(255), address_3 VARCHAR(255), address_4 VARCHAR(255), address_5 VARCHAR(255), address_city VARCHAR(100), address_country_id BIGINT, address_state VARCHAR(50), address_zipcode VARCHAR(10), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, code VARCHAR(255) NOT NULL, created TIMESTAMP WITHOUT TIME ZONE, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT ord_order_item_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-339', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 401, '9:af05a66e8daa376f42718977e5499cef', 'createTable tableName=ord_order_item', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-340::AndriusKarpavicius
CREATE TABLE hierarchy_entity (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), hierarchy_type VARCHAR(10), parent_id BIGINT, order_level BIGINT, creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT hierarchy_entity_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-340', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 403, '9:64caea65d9384fe7badc2e5c3e17cc30', 'createTable tableName=hierarchy_entity', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-341::AndriusKarpavicius
CREATE TABLE ord_item_offerings (order_item_id BIGINT NOT NULL, prd_offering_id BIGINT NOT NULL, id BIGINT NOT NULL, item_order INTEGER NOT NULL, CONSTRAINT ord_item_offer_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-341', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 405, '9:c18b264208712d9832b02697cef27413', 'createTable tableName=ord_item_offerings', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-342::AndriusKarpavicius
CREATE TABLE ord_item_prd_instance (order_item_id BIGINT NOT NULL, prd_instance_id BIGINT NOT NULL);

ALTER TABLE ord_item_prd_instance ADD CONSTRAINT ord_item_prd_instance_pkey PRIMARY KEY (order_item_id, prd_instance_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-342', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 407, '9:cfa7003c74e86a64129b36ed92bdcfd1', 'createTable tableName=ord_item_prd_instance; addPrimaryKey constraintName=ord_item_prd_instance_pkey, tableName=ord_item_prd_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-343::AndriusKarpavicius
CREATE TABLE wf_decision_rule (id BIGINT NOT NULL, version INTEGER, condition_el VARCHAR(2000), name VARCHAR(255), value VARCHAR(255), type VARCHAR(255), model INTEGER DEFAULT 0 NOT NULL, CONSTRAINT wf_wf_decision_rule_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-343', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 409, '9:676022986aa4766407a448580266d310', 'createTable tableName=wf_decision_rule', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-344::AndriusKarpavicius
