CREATE TABLE wf_transition_decision_rule (transition_id BIGINT NOT NULL, decision_rule_id BIGINT NOT NULL);

ALTER TABLE wf_transition_decision_rule ADD CONSTRAINT wf_transition_decision_rule_pkey PRIMARY KEY (transition_id, decision_rule_id);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-345::AndriusKarpavicius
CREATE TABLE ord_quote (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), quote_version VARCHAR(10), contact VARCHAR(100), quote_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, valid_from TIMESTAMP WITHOUT TIME ZONE, valid_to TIMESTAMP WITHOUT TIME ZONE, req_completion_date TIMESTAMP WITHOUT TIME ZONE, order_start_date TIMESTAMP WITHOUT TIME ZONE, completion_date TIMESTAMP WITHOUT TIME ZONE, category VARCHAR(200), status VARCHAR(20) NOT NULL, status_message VARCHAR(2000), routed_to_user_group VARCHAR(50), received_from VARCHAR(50), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, user_account_id BIGINT, cf_values JSONB, CONSTRAINT ord_quote_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-345', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 413, '9:8c294316dda5b174dddfc4f59c84617d', 'createTable tableName=ord_quote', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-346::AndriusKarpavicius
CREATE TABLE ord_quote_item (id BIGINT NOT NULL, version INTEGER, quote_id BIGINT NOT NULL, item_id VARCHAR(10) NOT NULL, source TEXT NOT NULL, status VARCHAR(20) NOT NULL, user_account_id BIGINT NOT NULL, CONSTRAINT ord_quote_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-346', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 415, '9:332ad1a7c3d069a445a13edf3e7400fe', 'createTable tableName=ord_quote_item', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-347::AndriusKarpavicius
CREATE TABLE ord_quot_item_offerings (quote_item_id BIGINT NOT NULL, prd_offering_id BIGINT NOT NULL, id BIGINT NOT NULL, item_order INTEGER NOT NULL, CONSTRAINT ord_quot_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-347', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 417, '9:57b47be7d2e89a58c2816018ef728c35', 'createTable tableName=ord_quot_item_offerings', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-348::AndriusKarpavicius
CREATE TABLE billing_invoices_orders (invoice_id BIGINT, order_id BIGINT);

ALTER TABLE billing_invoices_orders ADD CONSTRAINT billing_invoices_orders_pkey PRIMARY KEY (invoice_id, order_id);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-349::AndriusKarpavicius
CREATE TABLE cat_product_templ_charge_templ (product_charge_template_id BIGINT, product_template_id BIGINT);

ALTER TABLE cat_product_templ_charge_templ ADD CONSTRAINT cat_product_templ_charge_templ_pkey PRIMARY KEY (product_charge_template_id, product_template_id);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-350::AndriusKarpavicius
CREATE TABLE wf_history (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), entity_instance_code VARCHAR(255) NOT NULL, from_status VARCHAR(255) NOT NULL, to_status VARCHAR(255) NOT NULL, transition_name VARCHAR(255), action_date TIMESTAMP WITHOUT TIME ZONE, workflow_id BIGINT, CONSTRAINT wf_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-350', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 423, '9:418a8bb9027f30db97ac524a83aa67f5', 'createTable tableName=wf_history', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-351::AndriusKarpavicius
CREATE TABLE wf_history_action (id BIGINT NOT NULL, version INTEGER, action VARCHAR(2000), result VARCHAR(2000), wf_history_id BIGINT, CONSTRAINT wf_history_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-351', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 425, '9:e31334889ed9bf776eb67108aa6e8c5f', 'createTable tableName=wf_history_action', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-352::AndriusKarpavicius
CREATE TABLE audit_log (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, actor VARCHAR(200) NOT NULL, entity VARCHAR(200), origin VARCHAR(200), action VARCHAR(200) NOT NULL, parameters TEXT, source VARCHAR(200), CONSTRAINT audit_log_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-352', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 427, '9:96ce39e41ab9df207e60bd5fa38fed04', 'createTable tableName=audit_log', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-353::AndriusKarpavicius
CREATE TABLE ar_payment_token (token_type VARCHAR(20), id BIGINT NOT NULL, version INTEGER, card_type VARCHAR(60), owner VARCHAR(256), month_expiration INTEGER, year_expiration INTEGER, token_id VARCHAR(60), token_3ds_id VARCHAR(250), alias VARCHAR(256), is_default INTEGER DEFAULT 0, card_number VARCHAR(16), customer_account_id BIGINT, user_id VARCHAR(256), info_1 TEXT, info_2 TEXT, info_3 TEXT, info_4 TEXT, info_5 TEXT, bank_code VARCHAR(5), branch_code VARCHAR(5), account_number VARCHAR(11), hash_key VARCHAR(2), iban VARCHAR(100), bic VARCHAR(100), account_owner VARCHAR(50), bank_id VARCHAR(50), bank_name VARCHAR(50), issuer_name VARCHAR(50), issuer_number VARCHAR(50), ics VARCHAR(35), mandate_date date, mandate_identification VARCHAR(255), creator VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE DEFAULT '2015-09-18 00:04:00.631' NOT NULL, updater VARCHAR(100), updated TIMESTAMP WITHOUT TIME ZONE, disabled INTEGER DEFAULT 0 NOT NULL, document_id BIGINT, cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), payment_means BIGINT, mandate_change_action VARCHAR(20) DEFAULT 'NONE' NOT NULL, CONSTRAINT ar_payment_token_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-353', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 429, '9:3226a34fdc580148850b723feb9f2b89', 'createTable tableName=ar_payment_token', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-354::AndriusKarpavicius
CREATE TABLE ar_payment_gateway (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), type VARCHAR(255) NOT NULL, payment_method VARCHAR(255), card_type VARCHAR(255), implementation_class_name VARCHAR(255), script_instance_id BIGINT, trading_currency_id BIGINT, application_el VARCHAR(2000), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, creator VARCHAR(100), updater VARCHAR(100), cf_values JSONB, country_id BIGINT, nb_tries INTEGER, replay_cause VARCHAR(100), errors_to_replay VARCHAR(400), marchand_id VARCHAR(256), secret_key VARCHAR(256), api_key VARCHAR(256), profile VARCHAR(256), webhooks_secret_key VARCHAR(255), webhooks_key_id VARCHAR(255), 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), seller_id BIGINT, CONSTRAINT ar_payment_gateway_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-354', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 431, '9:bbd2d00760edd3350b240ad8fb8ba8a0', 'createTable tableName=ar_payment_gateway', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-355::AndriusKarpavicius
CREATE TABLE crm_provider_pay_methods (provider_id BIGINT, payment_method VARCHAR(255));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-356::AndriusKarpavicius
CREATE TABLE cat_product_offer_seller (product_id BIGINT NOT NULL, seller_id BIGINT NOT NULL);

ALTER TABLE cat_product_offer_seller ADD CONSTRAINT cat_product_offer_seller_pkey PRIMARY KEY (product_id, seller_id);

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

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

ALTER TABLE cat_product_offer_customer_category ADD CONSTRAINT cat_product_offer_customer_category_pkey PRIMARY KEY (product_id, customer_category_id);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-358::AndriusKarpavicius
CREATE TABLE ar_payment_history (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, customer_account_code VARCHAR(255) NOT NULL, customer_account_name VARCHAR(255), seller_code VARCHAR(255), operation_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, last_update_date TIMESTAMP WITHOUT TIME ZONE, amount_cts BIGINT NOT NULL, sync_status VARCHAR(255) NOT NULL, async_status VARCHAR(255), status VARCHAR(50), external_payment_id VARCHAR(255), error_code VARCHAR(255), error_message VARCHAR(2000), error_type VARCHAR(255), operation_category VARCHAR(255) NOT NULL, payment_gateway_code VARCHAR(255), payment_method_type VARCHAR(255), payment_method_name VARCHAR(255), payment_id BIGINT, refund_id BIGINT, creator VARCHAR(100), updater VARCHAR(100), customer_code VARCHAR(256), CONSTRAINT ar_payment_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-358', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 439, '9:fa59cc60c1554922b49e7ed93a2f309e', 'createTable tableName=ar_payment_history', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-359::AndriusKarpavicius
CREATE TABLE dwh_report_extract (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), category VARCHAR(50), script_type VARCHAR(10) NOT NULL, filename_format VARCHAR(100) NOT NULL, sql_query TEXT, script_instance_id BIGINT, result_type VARCHAR(10), style TEXT, image_path VARCHAR(100), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, output_dir VARCHAR(255), file_separator VARCHAR(1) DEFAULT ',', custom_table_code VARCHAR(255), accumulate INTEGER DEFAULT 1, decimal_separator VARCHAR(1) DEFAULT '.', generate_empty_report INTEGER DEFAULT 0, maximum_line BIGINT DEFAULT 0, include_headers INTEGER DEFAULT 1, CONSTRAINT dwh_report_extract_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-359', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 441, '9:553834508449d412220bf74a2367a522', 'createTable tableName=dwh_report_extract', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

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

ALTER TABLE dwh_report_extract_params ADD CONSTRAINT pk_report_extract_params PRIMARY KEY (reportextract_id, params_key);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-361::AndriusKarpavicius
CREATE TABLE billing_accounting_code (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), parent_accounting_code_id BIGINT, chart_of_account_type VARCHAR(25), reporting_account VARCHAR(50), chart_of_account_view_type VARCHAR(25), notes VARCHAR(2000), migrated INTEGER DEFAULT 0 NOT NULL, CONSTRAINT billing_accounting_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-361', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 445, '9:18a49dd372d5ec1e2b4900f548cb82dd', 'createTable tableName=billing_accounting_code', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-362::AndriusKarpavicius
CREATE TABLE ord_order_history (id BIGINT NOT NULL, version INTEGER, order_item_id BIGINT, service_instance_id BIGINT, action VARCHAR(25) NOT NULL, event_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, order_number VARCHAR(100), CONSTRAINT ord_order_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-362', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 447, '9:21a669af7387fdf128f0a5c9f73e97ca', 'createTable tableName=ord_order_history', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-363::AndriusKarpavicius
CREATE TABLE crm_additional_details (id BIGINT NOT NULL, version INTEGER, company_name VARCHAR(200), position VARCHAR(200), instant_messengers VARCHAR(2000), CONSTRAINT crm_additional_details_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-363', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 449, '9:5c0be58051a818894af687d0789e9978', 'createTable tableName=crm_additional_details', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-364::AndriusKarpavicius
CREATE TABLE crm_address_book (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), customer_id BIGINT, CONSTRAINT crm_address_book_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-364', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 451, '9:6d6688320b8cf3d112460d654ec643c2', 'createTable tableName=crm_address_book', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-365::AndriusKarpavicius
CREATE TABLE com_communication_entity (id BIGINT NOT NULL, version INTEGER, name VARCHAR(50), description VARCHAR(255), type VARCHAR(50), CONSTRAINT com_communication_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-365', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 453, '9:ba954edeff76aad6a45b86e0e235c500', 'createTable tableName=com_communication_entity', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-366::AndriusKarpavicius
CREATE TABLE com_campaign_crm_contact_tag (campaign_id BIGINT NOT NULL, tag VARCHAR(100) NOT NULL);

ALTER TABLE com_campaign_crm_contact_tag ADD CONSTRAINT com_campaign_crm_contact_tag_pkey PRIMARY KEY (campaign_id, tag);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-367::AndriusKarpavicius
CREATE TABLE com_contact_tag (contact_id BIGINT, tag VARCHAR(100));

ALTER TABLE com_contact_tag ADD CONSTRAINT com_contact_tag_pkey PRIMARY KEY (contact_id, tag);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-368::AndriusKarpavicius
CREATE TABLE billing_finance_segment (id BIGINT NOT NULL, code VARCHAR(255) 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, creator VARCHAR(100), updater VARCHAR(100), object_class VARCHAR(100) NOT NULL, field VARCHAR(100) NOT NULL, CONSTRAINT pk_billing_finance_segment PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-369::AndriusKarpavicius
CREATE TABLE dwh_report_extract_execution (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), report_extract_id BIGINT NOT NULL, start_date TIMESTAMP WITHOUT TIME ZONE, end_date TIMESTAMP WITHOUT TIME ZONE, file_path VARCHAR(256), line_count INTEGER, origin VARCHAR(20), error_message TEXT, status INTEGER, CONSTRAINT dwh_report_extract_execution_pk PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-370::AndriusKarpavicius
CREATE TABLE meveo_script_instance_cat (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 meveo_script_instance_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-370', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 463, '9:1d4441c06b1b53dbdde7f9a46ae9907f', 'createTable tableName=meveo_script_instance_cat', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-371::AndriusKarpavicius
CREATE TABLE billing_seq_invoice (id BIGINT NOT NULL, sequence_size INTEGER, current_number BIGINT, version INTEGER DEFAULT 0, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), sequence_type VARCHAR(255), sequence_pattern VARCHAR(255), CONSTRAINT pk_billing_seq_invoice PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-372::AndriusKarpavicius
CREATE TABLE adm_gdpr_configuration (id BIGINT NOT NULL, version INTEGER, inactive_subscription_life INTEGER DEFAULT 5, inactive_order_life INTEGER DEFAULT 10, invoice_life INTEGER DEFAULT 10, accounting_life INTEGER DEFAULT 10, customer_profile_life INTEGER DEFAULT 3, mailing_life INTEGER DEFAULT 3, ao_check_unpaid_life INTEGER DEFAULT 3, delete_sub INTEGER DEFAULT 0 NOT NULL, delete_order INTEGER DEFAULT 0 NOT NULL, delete_invoice INTEGER DEFAULT 0 NOT NULL, delete_accounting INTEGER DEFAULT 0 NOT NULL, delete_cust_prospect INTEGER DEFAULT 0 NOT NULL, delete_mailing_life INTEGER DEFAULT 0 NOT NULL, delete_ao_check_unpaid INTEGER DEFAULT 0 NOT NULL, CONSTRAINT pk_adm_gdpr_configuration PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-373::AndriusKarpavicius
CREATE TABLE ar_ddrequest_builder (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), type VARCHAR(255) NOT NULL, implementation_class_name VARCHAR(255), script_instance_id BIGINT, nb_ops_file BIGINT, max_size_file BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, creator VARCHAR(100), updater VARCHAR(100), cf_values JSONB, payment_level VARCHAR(100), CONSTRAINT ar_ddrequest_builder_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-373', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 469, '9:4695ef479728fb1ddde3390a737d457c', 'createTable tableName=ar_ddrequest_builder', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-374::AndriusKarpavicius
CREATE TABLE ar_payment_schedule_tmpl (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), calendar_id BIGINT NOT NULL, service_template_id BIGINT NOT NULL, adv_pay_inv_type_id BIGINT NOT NULL, adv_pay_sub_cat_id BIGINT NOT NULL, is_generate_adv_pay_inv INTEGER DEFAULT 1 NOT NULL, is_do_payment INTEGER DEFAULT 1 NOT NULL, amount numeric(23, 12), payment_day_in_month INTEGER NOT NULL, apply_agreement INTEGER DEFAULT 0 NOT NULL, payment_label VARCHAR(2000) NOT NULL, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, script_instance_id BIGINT, amount_el VARCHAR(2000), filter_el VARCHAR(2000), tax_class_id BIGINT, payment_day_in_month_el VARCHAR(2000), use_banking_calender INTEGER DEFAULT 1, CONSTRAINT ar_payment_schedule_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-374', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 471, '9:19149976ffa250ac20d2fa361e002967', 'createTable tableName=ar_payment_schedule_tmpl', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-375::AndriusKarpavicius
CREATE TABLE ar_payment_schedule_inst_item (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, payment_schedule_inst_id BIGINT NOT NULL, due_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, request_pay_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, ao_ps_id BIGINT, invoice_id BIGINT, is_last INTEGER, amount numeric(23, 12), CONSTRAINT ar_pay_schdl_inst_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-375', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 473, '9:f20a2dfae47970c4aeba7e766cf1af01', 'createTable tableName=ar_payment_schedule_inst_item', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-377::AndriusKarpavicius
CREATE TABLE crm_customer_sequence (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), prefix VARCHAR(255), sequence_size BIGINT, current_sequence_nb BIGINT, seller_id BIGINT, CONSTRAINT pk_crm_customer_sequence PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-378::AndriusKarpavicius
CREATE TABLE ar_payment_schedule_inst (id BIGINT NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0 NOT NULL, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), start_date TIMESTAMP WITHOUT TIME ZONE, end_date TIMESTAMP WITHOUT TIME ZONE, status VARCHAR(50) NOT NULL, status_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, amount numeric(23, 12), calendar_id BIGINT NOT NULL, payment_schedule_tmpl_id BIGINT NOT NULL, service_instance_id BIGINT NOT NULL, payment_day_in_month INTEGER NOT NULL, cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, CONSTRAINT ar_payment_schedule_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-378', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 477, '9:28f8dcafd14635881bd660f212b7076a', 'createTable tableName=ar_payment_schedule_inst', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-379::AndriusKarpavicius
CREATE TABLE cat_calendar_holiday (id BIGINT NOT NULL, version INTEGER, holiday_begin INTEGER NOT NULL, holiday_end INTEGER NOT NULL, calendar_id BIGINT NOT NULL, CONSTRAINT cat_calendar_holiday_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-379', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 479, '9:c5c0a5629f2334d46170e18477be1ff3', 'createTable tableName=cat_calendar_holiday', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-380::AndriusKarpavicius
CREATE TABLE billing_discount_plan_instance (id BIGINT NOT NULL, version INTEGER, discount_plan_id BIGINT NOT NULL, billing_account_id BIGINT, start_date date, end_date date, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, subscription_id BIGINT, application_count BIGINT DEFAULT 0 NOT NULL, status VARCHAR(50), status_date TIMESTAMP WITHOUT TIME ZONE, service_instance_id BIGINT, CONSTRAINT billing_discount_plan_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-380', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 481, '9:c99f4312e87b3c4b23ff4a746990917b', 'createTable tableName=billing_discount_plan_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-381::AndriusKarpavicius
CREATE TABLE ar_payment_gateway_rum_sequence (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), prefix VARCHAR(255), sequence_size BIGINT, current_sequence_nb BIGINT, payment_gateway_id BIGINT, CONSTRAINT pk_ar_payment_gateway_rum_sequence PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-382::AndriusKarpavicius
CREATE INDEX idx_subscription_rating_group ON billing_subscription(rating_group);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-383::AndriusKarpavicius
CREATE TABLE audit_field_changes_history (id BIGINT NOT NULL, version INTEGER, entity_class VARCHAR(255) NOT NULL, entity_id BIGINT NOT NULL, field_name VARCHAR(255), change_type VARCHAR(255), change_origin VARCHAR(255), origin_name VARCHAR(255), previous_state VARCHAR(700), current_state VARCHAR(700), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, actor VARCHAR(255) NOT NULL, CONSTRAINT audit_field_changes_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-383', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 487, '9:02d508358be6df228d4aca25b0fb740c', 'createTable tableName=audit_field_changes_history', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-384::AndriusKarpavicius
CREATE TABLE billing_general_ledger (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT billing_general_ledger_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-384', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 489, '9:ff9f50ef37cdf0f6dc0fbab9054e18e1', 'createTable tableName=billing_general_ledger', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-385::AndriusKarpavicius
CREATE TABLE ar_other_transaction (transaction_type VARCHAR(31) NOT NULL, id BIGINT NOT NULL, version INTEGER, description VARCHAR(255), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, amount numeric(23, 12), due_date date, matching_amount numeric(23, 12), matching_status VARCHAR(255), occ_code VARCHAR(255), occ_description VARCHAR(255), reference VARCHAR(255), transaction_category VARCHAR(255), transaction_date date, un_matching_amount numeric(23, 12), bank_lot VARCHAR(255), bank_reference VARCHAR(255), payment_method VARCHAR(255), amount_without_tax numeric(23, 12), billing_account_name VARCHAR(255), invoice_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), payment_info7 VARCHAR(255), 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), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, order_num VARCHAR(500), cf_values JSONB, general_ledger_id BIGINT, accounting_code_id BIGINT, CONSTRAINT ar_other_transaction_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-385', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 491, '9:4418fe6952d753db9731d597a53d3637', 'createTable tableName=ar_other_transaction', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-386::AndriusKarpavicius
CREATE TABLE ar_payment_ventilation (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255), ventilation_amount numeric(23, 12), ventilation_date date, creator VARCHAR(100), updater VARCHAR(100), customer_account_id BIGINT, original_ot_id BIGINT, new_ot_id BIGINT, account_operation_id BIGINT, ventilation_action_status VARCHAR(255), CONSTRAINT ar_payment_ventilation_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-386', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 493, '9:75a36760fb17f0649cc2d66819c185e3', 'createTable tableName=ar_payment_ventilation', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-387::AndriusKarpavicius
CREATE TABLE wf_generic_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, creator VARCHAR(100), updater VARCHAR(100), code VARCHAR(255) NOT NULL, description VARCHAR(255), target_entity_class VARCHAR(255) NOT NULL, enable_history INTEGER DEFAULT 0 NOT NULL, init_status VARCHAR(255), target_cet_code VARCHAR(255), filter_id BIGINT, cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), CONSTRAINT wf_generic_workflow_pk PRIMARY KEY (id), CONSTRAINT uk_wf_generic_workflow_code UNIQUE (code));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-388::AndriusKarpavicius
CREATE TABLE wf_status (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), description VARCHAR(255), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, generic_wf_id BIGINT, CONSTRAINT wf_status_pk PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-389::AndriusKarpavicius
CREATE TABLE wf_instance_history (id BIGINT NOT NULL, version INTEGER, action_date TIMESTAMP WITHOUT TIME ZONE, from_status VARCHAR(255), to_status VARCHAR(255), transition_name VARCHAR(255), wf_instance_id BIGINT, CONSTRAINT wf_instance_history_pk PRIMARY KEY (id));

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

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

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-391::AndriusKarpavicius
CREATE TABLE wf_generic_transition (id BIGINT NOT NULL, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, version INTEGER, from_status VARCHAR(255), to_status VARCHAR(255), priority INTEGER, description VARCHAR(255), generic_wf_id BIGINT, action_script_id BIGINT, condition_el VARCHAR(2000), CONSTRAINT wf_generic_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-391', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 503, '9:43ee21af3492d3fea075aa89bad2469b', 'createTable tableName=wf_generic_transition', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-392::AndriusKarpavicius
CREATE TABLE wf_instance (id BIGINT NOT NULL, version INTEGER, target_entity_class VARCHAR(255) NOT NULL, generic_wf_id BIGINT, current_wf_status_id BIGINT, entity_instance_code VARCHAR(255) NOT NULL, target_cet_code VARCHAR(255), entity_instance_id BIGINT NOT NULL, CONSTRAINT wf_instance_pk PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-393::AndriusKarpavicius
CREATE TABLE adm_custom_generic_entity_code (id BIGINT NOT NULL, entity_class VARCHAR(255), code_el VARCHAR(255), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), format_el VARCHAR(2000), sequence_id BIGINT, CONSTRAINT adm_custom_generic_entity_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-393', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 507, '9:0fd5cc0f3151a07d158f18e53fea8a2b', 'createTable tableName=adm_custom_generic_entity_code', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-394::AndriusKarpavicius
CREATE TABLE cat_offer_tmpl_discount_plan (offer_tmpl_id BIGINT NOT NULL, discount_plan_id BIGINT);

ALTER TABLE cat_offer_tmpl_discount_plan ADD CONSTRAINT cat_offer_tmpl_discount_plan_pkey PRIMARY KEY (offer_tmpl_id, discount_plan_id);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-395::AbdelmounaimAkadid
CREATE TABLE adm_role_secured_entity (role_id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, entity_class VARCHAR(255) NOT NULL, disabled INTEGER DEFAULT 0 NOT NULL);

ALTER TABLE adm_role_secured_entity ADD CONSTRAINT adm_role_secured_entity_pkey PRIMARY KEY (role_id, code, entity_class);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-396::AbdelmounaimAkadid
CREATE TABLE adm_file_format (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), file_name_pattern VARCHAR(255), configuration_template TEXT NOT NULL, record_name VARCHAR(255), input_directory VARCHAR(255) NOT NULL, output_directory VARCHAR(255), reject_directory VARCHAR(255), archive_directory VARCHAR(255), description VARCHAR(255), job_code VARCHAR(255), file_name_uniqueness INTEGER DEFAULT 0, CONSTRAINT adm_file_format_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-396', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 513, '9:2c3d7ae8b8a5702f25489d760c61a354', 'createTable tableName=adm_file_format', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-397::AbdelmounaimAkadid
CREATE TABLE flat_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), description VARCHAR(255), status VARCHAR(255), file_format_id BIGINT, processed INTEGER DEFAULT 0, error_message TEXT, lines_in_success INTEGER, lines_in_warning INTEGER, lines_in_error INTEGER, processing_attempts INTEGER, flat_file_job_code VARCHAR(255), file_original_name VARCHAR(255), file_current_name VARCHAR(255), current_directory VARCHAR(255), CONSTRAINT flat_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-397', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 515, '9:ac480706b7e99af06a96b78f8a23ee31', 'createTable tableName=flat_file', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-398::AbdelmounaimAkadid
CREATE TABLE ar_accounting_writing (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), origin_writing_id BIGINT, tax_id BIGINT, invoice_category_id BIGINT, accounting_code_id BIGINT, event_date date, export_date date, amount numeric(23, 12), event_type VARCHAR(255), extra_param_1 VARCHAR(255), extra_param_2 VARCHAR(255), extra_param_3 VARCHAR(255), CONSTRAINT pk_ar_accounting_writing_seq PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-399::AbdelmounaimAkadid
CREATE TABLE adm_file_format_file_type (file_format_id BIGINT NOT NULL, file_type_id BIGINT NOT NULL);

ALTER TABLE adm_file_format_file_type ADD CONSTRAINT adm_file_format_file_type_pkey PRIMARY KEY (file_format_id, file_type_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-399', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 519, '9:915aeb759c864e30c0cd332e1faef617', 'createTable tableName=adm_file_format_file_type; addPrimaryKey constraintName=adm_file_format_file_type_pkey, tableName=adm_file_format_file_type', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-400::AbdelmounaimAkadid
CREATE TABLE adm_file_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), description VARCHAR(255), CONSTRAINT adm_file_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-400', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 521, '9:cab66aa7da9f5f5f8a92f5130d5b8949', 'createTable tableName=adm_file_type', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-401::AbdelmounaimAkadid
CREATE TABLE cat_unit_of_measure (id BIGINT NOT NULL, version INTEGER, creator VARCHAR(100), updater VARCHAR(100), code VARCHAR(255), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, symbol VARCHAR(100) NOT NULL, description VARCHAR(100), description_i18n JSONB, multiplicator BIGINT NOT NULL, parent_id BIGINT, CONSTRAINT cat_unit_of_measure_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-401', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 523, '9:4603c3d4055836c83f97eb2f949a7855', 'createTable tableName=cat_unit_of_measure', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-402::AbdelmounaimAkadid
CREATE TABLE rating_cdr (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), quantity numeric, reject_reason TEXT, status VARCHAR(255), status_date TIMESTAMP WITHOUT TIME ZONE, parameter_1 VARCHAR(255), parameter_2 VARCHAR(255), parameter_3 VARCHAR(255), parameter_4 VARCHAR(255), 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, decimal_parameter_2 numeric, decimal_parameter_3 numeric, decimal_parameter_4 numeric, decimal_parameter_5 numeric, access_code VARCHAR(255), header_edr_id BIGINT, extra_parameter TEXT, times_tried INTEGER, type VARCHAR(255), line VARCHAR(2000), updater VARCHAR(100), source TEXT, CONSTRAINT rating_cdr_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-402', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 525, '9:275de6ad881141f5c1bf177368011825', 'createTable tableName=rating_cdr', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-403::AbdelmounaimAkadid
CREATE TABLE billing_tax_category (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), description_i18n JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, untdid_taxation_category_id BIGINT, cf_values JSONB, CONSTRAINT billing_tax_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-403', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 527, '9:3f05d1c76e773443f4bec8ddfce7fceb', 'createTable tableName=billing_tax_category', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-404::AbdelmounaimAkadid
CREATE TABLE billing_tax_class (id BIGINT NOT NULL, version INTEGER DEFAULT 0, 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), description_i18n JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, CONSTRAINT billing_tax_class_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-404', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 529, '9:cbbe0b3e1fb843556981b5b4d7fb93ce', 'createTable tableName=billing_tax_class', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-405::AbdelmounaimAkadid
CREATE TABLE billing_tax_mapping (id BIGINT NOT NULL, version INTEGER DEFAULT 0, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), tax_category_id BIGINT, tax_class_id BIGINT, valid_from TIMESTAMP WITHOUT TIME ZONE, valid_to TIMESTAMP WITHOUT TIME ZONE, seller_country_id BIGINT, buyer_country_id BIGINT, filter_el VARCHAR(2000), tax_id BIGINT, tax_el VARCHAR(2000), tax_script_id BIGINT, priority INTEGER DEFAULT 0, source VARCHAR(2000), origin_id BIGINT, CONSTRAINT billing_tax_mapping_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-405', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 531, '9:1c9e57763cf42912c8276014d8a48207', 'createTable tableName=billing_tax_mapping', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-406::AbdelmounaimAkadid
CREATE TABLE cat_serv_usage_counter_template (service_usage_templt_id BIGINT NOT NULL, counter_template_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE cat_serv_usage_counter_template ADD CONSTRAINT cat_serv_usage_counter_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-406', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 533, '9:34ab31cf1b29b55dc46326b9034bc3e7', 'createTable tableName=cat_serv_usage_counter_template; addPrimaryKey constraintName=cat_serv_usage_counter_template_pkey, tableName=cat_serv_usage_counter_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-407::AbdelmounaimAkadid
CREATE TABLE cat_serv_rec_counter_template (service_rec_templt_id BIGINT NOT NULL, counter_template_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE cat_serv_rec_counter_template ADD CONSTRAINT cat_serv_rec_counter_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-407', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 535, '9:3896d529a69218c25999f57938f3a24e', 'createTable tableName=cat_serv_rec_counter_template; addPrimaryKey constraintName=cat_serv_rec_counter_template_pkey, tableName=cat_serv_rec_counter_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-408::AbdelmounaimAkadid
CREATE TABLE cat_serv_sub_counter_template (service_sub_templt_id BIGINT NOT NULL, counter_template_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE cat_serv_sub_counter_template ADD CONSTRAINT cat_serv_sub_counter_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-408', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 537, '9:319828cabb79e4492f3b47a90ed62262', 'createTable tableName=cat_serv_sub_counter_template; addPrimaryKey constraintName=cat_serv_sub_counter_template_pkey, tableName=cat_serv_sub_counter_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-409::AbdelmounaimAkadid
CREATE TABLE cat_serv_trm_counter_template (service_trm_templt_id BIGINT NOT NULL, counter_template_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE cat_serv_trm_counter_template ADD CONSTRAINT cat_serv_trm_counter_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-409', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 539, '9:1bfcc431a21f59f1b2801c2fe60c9d2f', 'createTable tableName=cat_serv_trm_counter_template; addPrimaryKey constraintName=cat_serv_trm_counter_template_pkey, tableName=cat_serv_trm_counter_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-410::AbdelmounaimAkadid
CREATE TABLE billing_chrg_inst_counter (chrg_instance_id BIGINT NOT NULL, counter_instance_id BIGINT NOT NULL);

ALTER TABLE billing_chrg_inst_counter ADD CONSTRAINT billing_chrg_inst_counter_pkey PRIMARY KEY (chrg_instance_id, counter_instance_id);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-411::AbdelmounaimAkadid
CREATE TABLE billing_counter_period_values (counter_key VARCHAR(255) NOT NULL, counter_value numeric(19, 2) NOT NULL, counterperiod_id BIGINT NOT NULL);

ALTER TABLE billing_counter_period_values ADD CONSTRAINT billing_counter_period_values_pkey PRIMARY KEY (counterperiod_id, counter_key);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-411', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 543, '9:677cb3db56e7307a5b93868d96e23811', 'createTable tableName=billing_counter_period_values; addPrimaryKey constraintName=billing_counter_period_values_pkey, tableName=billing_counter_period_values', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-412::AbdelmounaimAkadid
CREATE TABLE cat_fixed_date (id BIGINT NOT NULL, start_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, end_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, cat_calendar_id BIGINT NOT NULL, version INTEGER, CONSTRAINT cat_fixed_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-412', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 545, '9:6aa2a891311298a171a8bc4e654b4775', 'createTable tableName=cat_fixed_date', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-413::AbdelmounaimAkadid
CREATE TABLE wo_aggregation_line (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), field VARCHAR(255), action VARCHAR(25), value VARCHAR(255), required INTEGER, is_custom_field INTEGER, group_by VARCHAR(25), group_by_parameter VARCHAR(25), alias VARCHAR(255), wo_aggregation_settings_id BIGINT, CONSTRAINT wo_aggregation_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-413', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 547, '9:0b5b294f3ce13888456ba8bb210b52ea', 'createTable tableName=wo_aggregation_line', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-414::AbdelmounaimAkadid
CREATE TABLE wo_aggregation_settings (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), description VARCHAR(255), global_aggregation INTEGER, period_aggregation INTEGER, period_end_date_included INTEGER, wallet_operation_filter_id BIGINT, aggregation_rounding INTEGER DEFAULT 2, aggregation_rounding_mode VARCHAR(50) DEFAULT 'NEAREST', additional_order_by VARCHAR(255), CONSTRAINT wo_aggregation_matrix_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-414', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 549, '9:42f8030e3a8dd0ef6960fa578ef1b142', 'createTable tableName=wo_aggregation_settings', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-415::AbdelmounaimAkadid
CREATE TABLE document (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), description VARCHAR(255), description_i18n JSONB, file_type_id BIGINT NOT NULL, creation_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, file_name VARCHAR(255) NOT NULL, tags VARCHAR(255), linked_account_entity_id BIGINT, document_category_id BIGINT, document_status VARCHAR(20) NOT NULL, cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), document_version INTEGER DEFAULT 0 NOT NULL, CONSTRAINT document_pk PRIMARY KEY (id));

ALTER TABLE document ADD CONSTRAINT document_code_version_key UNIQUE (code, document_version);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-415', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 551, '9:b8ed644529ba9aae10657f724c58851c', 'createTable tableName=document; addUniqueConstraint constraintName=document_code_version_key, tableName=document', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-416::AbdelmounaimAkadid
CREATE TABLE document_category (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), description VARCHAR(255), description_i18n JSONB, relative_path VARCHAR(2000) NOT NULL, cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), CONSTRAINT document_category_pk PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-417::AbdelmounaimAkadid
CREATE TABLE document_tags (document_id BIGINT, tags VARCHAR(60));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-418::AbdelmounaimAkadid
CREATE TABLE ar_ao_payment_histories (ao_id BIGINT, history_id BIGINT);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-419::AbdelmounaimAkadid
CREATE TABLE job_execution_error (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, job_instance_id BIGINT NOT NULL, entity_id BIGINT, period_from TIMESTAMP WITHOUT TIME ZONE, period_to TIMESTAMP WITHOUT TIME ZONE, error_reason VARCHAR(2000), CONSTRAINT job_execution_error_pk PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-420::AbdelmounaimAkadid
CREATE TABLE cat_offer_allowed_offer_change (offer_tmpl_id BIGINT NOT NULL, allowed_offer_change_id BIGINT);

ALTER TABLE cat_offer_allowed_offer_change ADD CONSTRAINT cat_offer_allowed_offer_change_pkey PRIMARY KEY (offer_tmpl_id, allowed_offer_change_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-420', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 561, '9:487e7bb9d0119795745c40ccd7c09912', 'createTable tableName=cat_offer_allowed_offer_change; addPrimaryKey constraintName=cat_offer_allowed_offer_change_pkey, tableName=cat_offer_allowed_offer_change', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-421::AbdelmounaimAkadid
CREATE TABLE billing_invoice_agr_amount (aggr_id BIGINT NOT NULL, tax_id BIGINT NOT NULL, amountwithouttax numeric(23, 12), amounttax numeric(23, 12), amountwithtax numeric(23, 12));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-424::AbdelmounaimAkadid
CREATE TABLE bi_data_collector (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), description VARCHAR(255), sql_query TEXT NOT NULL, custom_table_code VARCHAR(255) NOT NULL, aliases JSONB NOT NULL, last_run_date TIMESTAMP WITHOUT TIME ZONE, parameters JSONB, CONSTRAINT data_collector_pk PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-425::AbdelmounaimAkadid
CREATE TABLE wf_generic_action (id BIGINT NOT NULL, version INTEGER, description VARCHAR(255), uuid VARCHAR(255) DEFAULT uuid_generate_v4(), priority INTEGER, condition_el VARCHAR(2000), value_el VARCHAR(2000), type VARCHAR(255), log_level VARCHAR(255), field_to_update VARCHAR(255), is_asynchronous INTEGER DEFAULT 0, action_script_id BIGINT, notification_id BIGINT, transition_id BIGINT, CONSTRAINT wf_generic_action_pk PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-426::AbdelmounaimAkadid
CREATE TABLE generic_sequence (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), description VARCHAR(255), sequence_type VARCHAR(255), sequence_size INTEGER, current_number BIGINT, sequence_pattern VARCHAR(255), CONSTRAINT generic_sequence_pk PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-427::AbdelmounaimAkadid
CREATE TABLE ar_accounting_writing_acc_operations (accounting_writing_id BIGINT, account_operation_id BIGINT);

ALTER TABLE ar_accounting_writing_acc_operations ADD CONSTRAINT ar_accounting_writing_acc_operations_pkey PRIMARY KEY (accounting_writing_id, account_operation_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-427', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 571, '9:02e30a6545e73a632bf329c65881f5cb', 'createTable tableName=ar_accounting_writing_acc_operations; addPrimaryKey constraintName=ar_accounting_writing_acc_operations_pkey, tableName=ar_accounting_writing_acc_operations', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-428::AbdelmounaimAkadid
CREATE TABLE meveo_metrics_config (id BIGINT NOT NULL, code VARCHAR(100) NOT NULL, description VARCHAR(255), full_path VARCHAR(255), method VARCHAR(255), metrics_type VARCHAR(255), metrics_unit VARCHAR(255), version INTEGER, updated TIMESTAMP WITHOUT TIME ZONE, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT meveo_metrics_config_id_pk PRIMARY KEY (id), CONSTRAINT meveo_metrics_config_code_unique UNIQUE (code));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-428::Mbarek-Ay
CREATE TABLE cpq_product (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), status VARCHAR(255), status_date TIMESTAMP WITHOUT TIME ZONE, product_line_id BIGINT, customer_brand_id BIGINT, reference VARCHAR(50), model VARCHAR(20), discount_flag INTEGER DEFAULT 0 NOT NULL, package_flag INTEGER DEFAULT 0 NOT NULL, disabled INTEGER DEFAULT 0 NOT NULL, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, product_version_id BIGINT, is_model INTEGER DEFAULT 0, product_model_id BIGINT, price_version_date_setting VARCHAR(255) DEFAULT 'DELIVERY' NOT NULL, open_order_id BIGINT, agreement_date_setting VARCHAR(20), CONSTRAINT cpq_product_pkey PRIMARY KEY (id), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-429::Mbarek-Ay
CREATE TABLE cpq_product_line (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), long_description TEXT, creator VARCHAR(100), updater VARCHAR(100), seller_id BIGINT, parent_line BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, CONSTRAINT cpq_product_line_pkey PRIMARY KEY (id), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-430::Mbarek-Ay
CREATE TABLE cpq_product_version (id BIGINT NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), version INTEGER, status VARCHAR(255), status_date TIMESTAMP WITHOUT TIME ZONE, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, short_description VARCHAR(255), long_description TEXT, start_date TIMESTAMP WITHOUT TIME ZONE, end_date TIMESTAMP WITHOUT TIME ZONE, product_id BIGINT NOT NULL, current_version INTEGER NOT NULL, valid_from TIMESTAMP WITHOUT TIME ZONE, valid_to TIMESTAMP WITHOUT TIME ZONE, CONSTRAINT cpq_product_version_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-430', 'Mbarek-Ay', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 579, '9:6a0950c07816286df445e8c0c317f5c1', 'createTable tableName=cpq_product_version', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-431::Mbarek-Ay
CREATE TABLE cpq_tag (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), seller_id BIGINT, name VARCHAR(255), tag_type_id BIGINT, parent_tag_id BIGINT, filter_el VARCHAR(2000), CONSTRAINT cpq_tag_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-431', 'Mbarek-Ay', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 581, '9:e41f8c7ebac3288714c38982196960b3', 'createTable tableName=cpq_tag', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-432::Mbarek-Ay
CREATE TABLE cpq_tag_filter (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), tag_id BIGINT, operator VARCHAR(255), entity VARCHAR(255), field VARCHAR(255), comparaison VARCHAR(255), value VARCHAR(255), CONSTRAINT cpq_tag_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-432', 'Mbarek-Ay', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 583, '9:2c84fabc29ef4e0a850181599df5cf01', 'createTable tableName=cpq_tag_filter', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-433::Mbarek-Ay
CREATE TABLE cpq_tag_type (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), seller_id BIGINT, CONSTRAINT cpq_tag_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-433', 'Mbarek-Ay', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 585, '9:51fd17ba306bfba50c38290e1cc1424c', 'createTable tableName=cpq_tag_type', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-434::Mbarek-Ay
CREATE TABLE cpq_media (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), 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, cf_values JSONB, version INTEGER, media_name VARCHAR(255), label VARCHAR(255), main INTEGER DEFAULT 1 NOT NULL, media_type VARCHAR(50), media_path VARCHAR(255), CONSTRAINT cpq_media_pkey PRIMARY KEY (id), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-435::Mbarek-Ay
CREATE TABLE cpq_offer_component (id BIGINT NOT NULL, version INTEGER, offer_template_id BIGINT, product_id BIGINT, sequence INTEGER DEFAULT 0, mandatory INTEGER DEFAULT 0, display INTEGER, quantity_min INTEGER, quantity_max INTEGER, quantity_default INTEGER, product_set VARCHAR(250), CONSTRAINT cpq_offer_component_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-435', 'Mbarek-Ay', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 589, '9:1c3a2fde44f1ce4bd6d9d2628583fe77', 'createTable tableName=cpq_offer_component', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-436::Mbarek-Ay
CREATE TABLE cpq_commercial_rule_header (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, disabled INTEGER DEFAULT 0 NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255) NOT NULL, description VARCHAR(255), creator VARCHAR(100), updater VARCHAR(100), rule_type VARCHAR(50), scope_type VARCHAR(25), offer_template_id BIGINT, product_id BIGINT, product_version_id BIGINT, grouped_service_id BIGINT, service_template_id BIGINT, grouped_attributes_id BIGINT, attribute_id BIGINT, target_attribute_value VARCHAR(255), tag_id BIGINT, rule_el VARCHAR(2000), CONSTRAINT cpq_commercial_rule_header_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-436', 'Mbarek-Ay', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 591, '9:04ca8c0045d9348e7510f6507a5f646b', 'createTable tableName=cpq_commercial_rule_header', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-437::Mbarek-Ay
CREATE TABLE cpq_commercial_rule_item (id BIGINT NOT NULL, version INTEGER, commercial_rule_header_id BIGINT, operator VARCHAR(255), rule_item_el VARCHAR(2000), CONSTRAINT cpq_commercial_rule_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-437', 'Mbarek-Ay', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 593, '9:e04d9db8a18aa404c7f395afdf18be33', 'createTable tableName=cpq_commercial_rule_item', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-438::Mbarek-Ay
CREATE TABLE cpq_commercial_rule_line (id BIGINT NOT NULL, version INTEGER, offer_template_id BIGINT, grouped_attributes_id BIGINT, commercial_rule_item_id BIGINT, product_id BIGINT, product_version_id BIGINT, attribute_id BIGINT, tag_id BIGINT, operator VARCHAR(255), source_attribute_value VARCHAR(255), source_grouped_attribute_value VARCHAR(255), value VARCHAR(255), CONSTRAINT cpq_commercial_rule_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-438', 'Mbarek-Ay', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 595, '9:e2c01679b586040ef788907ead033906', 'createTable tableName=cpq_commercial_rule_line', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-439::Mbarek-Ay
CREATE TABLE cpq_offer_component_tags (offer_component_id BIGINT NOT NULL, tag_id BIGINT NOT NULL);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-440::Mbarek-Ay
CREATE TABLE cpq_grouped_service (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), product_version_id BIGINT, mandatory INTEGER NOT NULL, display INTEGER NOT NULL, sequence INTEGER, CONSTRAINT cpq_grouped_service_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-440', 'Mbarek-Ay', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 599, '9:6589036b4769968cfb7d81ebcac9a373', 'createTable tableName=cpq_grouped_service', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-441::TarikFAKHOURI
CREATE TABLE cpq_quote_lot (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), version INTEGER, creator VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, updater VARCHAR(100), quote_version INTEGER NOT NULL, name VARCHAR(50), duration INTEGER, execution_date TIMESTAMP WITHOUT TIME ZONE, cpq_quote_version_id BIGINT NOT NULL, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, CONSTRAINT cpq_quote_lot_pkey PRIMARY KEY (id), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-442::TarikFAKHOURI
CREATE TABLE cpq_quote_product (id BIGINT NOT NULL, version INTEGER, creator VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, updater VARCHAR(100), quote_version_id BIGINT, quote_lot_id BIGINT, product_version_id BIGINT NOT NULL, quantity numeric(23, 12), cpq_quote_id BIGINT, offer_quote_id BIGINT NOT NULL, discount_plan_id BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, delivery_date TIMESTAMP WITHOUT TIME ZONE, product_action_type VARCHAR(10), termination_date TIMESTAMP WITHOUT TIME ZONE, sub_termin_reason_id BIGINT, mrr numeric(23, 12), CONSTRAINT cpq_quote_product_pkey PRIMARY KEY (id), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-443::TarikFAKHOURI
CREATE TABLE cpq_quote_version (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), cpq_quote_id BIGINT NOT NULL, quote_version INTEGER NOT NULL, status VARCHAR(20) NOT NULL, status_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, start_date TIMESTAMP WITHOUT TIME ZONE, end_date TIMESTAMP WITHOUT TIME ZONE, billing_plan_code VARCHAR(20), short_description VARCHAR(255), invoicing_plan_id BIGINT, cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), pdf_filename VARCHAR(255), xml_filename VARCHAR(255), discount_plan_id BIGINT, contract_id BIGINT, comment VARCHAR(2000), price_list_id BIGINT, CONSTRAINT cpq_quote_version_pkey PRIMARY KEY (id), CONSTRAINT cpq_quote_version_uuid_unique UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-444::TarikFAKHOURI
CREATE TABLE cpq_contract (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), version INTEGER, creator VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, updater VARCHAR(100), seller_id BIGINT, billing_account_id BIGINT, customer_account_id BIGINT, customer_id BIGINT, status VARCHAR(20) NOT NULL, status_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, contract_date date, begin_date date NOT NULL, end_date date NOT NULL, renewal INTEGER NOT NULL, contract_duration INTEGER, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, disabled INTEGER DEFAULT 0 NOT NULL, cf_values JSONB, application_el VARCHAR(2000), CONSTRAINT cpq_contract_pkey PRIMARY KEY (id), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-445::TarikFAKHOURI
CREATE TABLE cpq_contract_item (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), version INTEGER, creator VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, updater VARCHAR(100), cpq_contract_id BIGINT, offer_template_id BIGINT, cpq_product_id BIGINT, price_plan_id BIGINT, charge_template_id BIGINT, service_template_id BIGINT, rate FLOAT8, amount_without_tax numeric(23, 12), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, disabled INTEGER DEFAULT 0 NOT NULL, cf_values JSONB, rate_type VARCHAR(255), separate_discount INTEGER DEFAULT 0, application_el VARCHAR(2000), applicable_on_overridden_price INTEGER DEFAULT 0, CONSTRAINT cpq_contract_item_pkey PRIMARY KEY (id), UNIQUE (code), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-446::TarikF
CREATE TABLE cpq_price_plan_matrix_item (id BIGINT NOT NULL, version INTEGER, dim1_value VARCHAR(50) NOT NULL, dim2_value VARCHAR(50), dim3_value VARCHAR(50), price_without_tax numeric(23, 12), CONSTRAINT cpq_price_plan_matrix_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-446', 'TarikF', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 611, '9:2d9ecaf5757389f6768661231c3e74bc', 'createTable tableName=cpq_price_plan_matrix_item', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-447::TarikF
CREATE TABLE cpq_price_plan_version (id BIGINT NOT NULL, label VARCHAR(255), version INTEGER, current_version INTEGER, creator VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, updater VARCHAR(100), ppm_id BIGINT, status VARCHAR(255) NOT NULL, status_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, valid_from TIMESTAMP WITHOUT TIME ZONE, valid_to TIMESTAMP WITHOUT TIME ZONE, price numeric(23, 12), price_el VARCHAR(2000), is_matrix INTEGER, priority INTEGER DEFAULT 0, price_version_type VARCHAR(255) DEFAULT 'FIXED' NOT NULL, trading_prices_el JSONB, CONSTRAINT cpq_price_plan_version_pkey PRIMARY KEY (id));

ALTER TABLE cpq_price_plan_version ADD CONSTRAINT "cpq_price_plan_version_UNIC" UNIQUE (ppm_id, current_version);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-447', 'TarikF', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 613, '9:d0724c185fd1231a76b555deab1ee43b', 'createTable tableName=cpq_price_plan_version; addUniqueConstraint constraintName=cpq_price_plan_version_UNIC, tableName=cpq_price_plan_version', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-448::TarikF
CREATE TABLE cpq_service_type (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), version INTEGER, creator VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, updater VARCHAR(100), service_type VARCHAR(100) NOT NULL, CONSTRAINT cpq_service_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-448', 'TarikF', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 615, '9:086b2de776d24e5036f49e89027dcff7', 'createTable tableName=cpq_service_type', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-449::NabilOUACHI
CREATE TABLE cpq_offer_template_tags (offer_template_id BIGINT NOT NULL, tag_id BIGINT NOT NULL);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-450::NabilOUACHI
CREATE TABLE cpq_service_template_tags (service_template_id BIGINT NOT NULL, tag_id BIGINT NOT NULL);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-451::NabilOUACHI
CREATE TABLE cpq_product_version_tags (product_version_id BIGINT NOT NULL, tag_id BIGINT NOT NULL);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-452::NabilOUACHI
CREATE TABLE cpq_product_discount_plan (product_id BIGINT NOT NULL, discount_id BIGINT NOT NULL);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-453::NabilOUACHI
CREATE TABLE cpq_product_version_services (product_version_id BIGINT NOT NULL, service_template_id BIGINT NOT NULL);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-454::NabilOUACHI
CREATE TABLE cpq_product_model_children (product_id BIGINT, model_chlidren VARCHAR(100));

ALTER TABLE cpq_product_model_children ADD CONSTRAINT cpq_product_model_children_pkey PRIMARY KEY (product_id, model_chlidren);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-454', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 627, '9:a8447ce9a3b7a11f5fe903adf47c2492', 'createTable tableName=cpq_product_model_children; addPrimaryKey constraintName=cpq_product_model_children_pkey, tableName=cpq_product_model_children', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-455::NabilOUACHI
CREATE TABLE cpq_quote_article_line (id BIGINT NOT NULL, version INTEGER, creator VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, updater VARCHAR(100), billable_account_id BIGINT NOT NULL, accounting_article_id BIGINT NOT NULL, quantity numeric(23, 12) NOT NULL, service_quantity numeric(23, 12) NOT NULL, quote_product_id BIGINT, quote_lot_id BIGINT, quote_version_id BIGINT, CONSTRAINT cpq_quote_article_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-455', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 629, '9:64a97a609b0cfd1534f0a3fe7ce65f5b', 'createTable tableName=cpq_quote_article_line', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-456::NabilOUACHI
CREATE TABLE quote_offer (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), offer_template_id BIGINT NOT NULL, billable_account_id BIGINT, quote_version_id BIGINT NOT NULL, quote_customer_service_id BIGINT, sequence INTEGER, position INTEGER, discount_plan_id BIGINT, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, code VARCHAR(255), description VARCHAR(255), delivery_date TIMESTAMP WITHOUT TIME ZONE, user_account_id BIGINT, quote_line_type VARCHAR(10), subscription_id BIGINT, contract_id BIGINT, CONSTRAINT pk_quote_offer_seq PRIMARY KEY (id), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-457::NabilOUACHI
CREATE TABLE cpq_attribute (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), disabled INTEGER NOT NULL, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, parent_id BIGINT, priority INTEGER DEFAULT 0, attribute_type VARCHAR(100), unit_nb_decimal INTEGER, attribute_category VARCHAR(255) NOT NULL, el_value VARCHAR(1000), CONSTRAINT pk_cpq_attribute PRIMARY KEY (id), UNIQUE (code), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-458::NabilOUACHI
CREATE TABLE cpq_grouped_attributes (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), mandatory INTEGER NOT NULL, priority INTEGER, display INTEGER NOT NULL, sequence INTEGER, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, disabled INTEGER DEFAULT 0 NOT NULL, cf_values JSONB, CONSTRAINT pk_cpq_grouped_attributes PRIMARY KEY (id), UNIQUE (code), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-459::NabilOUACHI
CREATE TABLE cpq_attribute_allowed_values (attribute_id BIGINT, allowed_values VARCHAR(100), order_idx INTEGER);

ALTER TABLE cpq_attribute_allowed_values ADD CONSTRAINT cpq_attribute_allowed_values_pkey PRIMARY KEY (attribute_id, allowed_values);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-459', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 637, '9:eadb1c8652ef04839d30206fc78cfad4', 'createTable tableName=cpq_attribute_allowed_values; addPrimaryKey constraintName=cpq_attribute_allowed_values_pkey, tableName=cpq_attribute_allowed_values', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-460::NabilOUACHI
CREATE TABLE cpq_product_version_attributes (product_version_id BIGINT NOT NULL, attribute_id BIGINT NOT NULL, sequence INTEGER DEFAULT 0, version INTEGER DEFAULT 0, id BIGINT NOT NULL, mandatory INTEGER NOT NULL, priority INTEGER, mandatorwith_el VARCHAR(255), read_only INTEGER DEFAULT 0, display INTEGER DEFAULT 0, default_value VARCHAR(255), validation_type VARCHAR(10), validation_pattern VARCHAR(2000), validation_label VARCHAR(255), CONSTRAINT cpq_product_version_attr_pk PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-461::NabilOUACHI
CREATE TABLE cpq_service_template_attributes (service_template_id BIGINT NOT NULL, attribute_id BIGINT NOT NULL);

ALTER TABLE cpq_service_template_attributes ADD CONSTRAINT cpq_service_template_attributes_pkey PRIMARY KEY (service_template_id, attribute_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-461', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 641, '9:69345f102ae040655559fa241aff2559', 'createTable tableName=cpq_service_template_attributes; addPrimaryKey constraintName=cpq_service_template_attributes_pkey, tableName=cpq_service_template_attributes', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-462::NabilOUACHI
CREATE TABLE cpq_quote (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), seller_id BIGINT, status_version INTEGER, status VARCHAR(20) NOT NULL, previous_status VARCHAR(20), status_date TIMESTAMP WITHOUT TIME ZONE, send_date TIMESTAMP WITHOUT TIME ZONE, quote_date TIMESTAMP WITHOUT TIME ZONE, prestation_date_begin TIMESTAMP WITHOUT TIME ZONE, prestation_duration INTEGER, opportunity_ref VARCHAR(50), customer_ref VARCHAR(50), customer_name VARCHAR(52), contact_name VARCHAR(52), register_number VARCHAR(50), sales_person_name VARCHAR(52), billable_account_id BIGINT NOT NULL, applicant_account_id BIGINT NOT NULL, valid_from TIMESTAMP WITHOUT TIME ZONE, valid_to TIMESTAMP WITHOUT TIME ZONE, quote_number VARCHAR(50), invoice_type_id BIGINT, user_account_id BIGINT, mrr numeric(23, 12), CONSTRAINT pk_cpq_quote PRIMARY KEY (id), UNIQUE (code));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-463::NabilOUACHI
CREATE TABLE cpq_quote_price (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), quote_article_line_id BIGINT, quote_version_id BIGINT NOT NULL, price_level VARCHAR(50), price_type VARCHAR(50), amount_with_tax numeric(23, 12), unit_price_without_tax numeric(23, 12), amount_without_tax numeric(23, 12), amount_without_tax_without_discount numeric(23, 12), tax_amount numeric(23, 12), tax_rate numeric(23, 12), price_over_charged INTEGER DEFAULT 0, currency_code VARCHAR(25), recurrence_duration BIGINT, recurrence_periodicity VARCHAR(50), charge_template_id BIGINT, quote_offer_id BIGINT, quantity numeric(19, 2), discounted_quote_price BIGINT, uuid VARCHAR(60), discount_plan_id BIGINT, discount_value numeric(23, 12), discount_plan_type VARCHAR(50), discount_plan_item_id BIGINT, apply_discounts_on_overriden_price INTEGER, overcharged_unit_amount_without_tax numeric(23, 12), discounted_amount numeric(23, 12), sequence INTEGER, price_plan_matrix_version_id BIGINT, price_plan_matrix_line_id BIGINT, contract_item_id BIGINT, tax_id BIGINT, CONSTRAINT pk_quote_price PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-464::NabilOUACHI
CREATE TABLE cpq_quote_attribute (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), cpq_attribute_id BIGINT NOT NULL, cpq_quote_product_id BIGINT, string_value VARCHAR(255), double_value FLOAT8, date_value TIMESTAMP WITHOUT TIME ZONE, parent_id BIGINT, cpq_quote_offer_id BIGINT, cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), boolean_value INTEGER, CONSTRAINT pk_cpq_quote_attribute PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-465::NabilOUACHI
CREATE TABLE cpq_product_version_grouped_attributes (product_version_id BIGINT NOT NULL, grouped_attributes_id BIGINT NOT NULL);

ALTER TABLE cpq_product_version_grouped_attributes ADD CONSTRAINT cpq_product_version_grouped_attributes_pkey PRIMARY KEY (product_version_id, grouped_attributes_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-465', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 649, '9:b516ed170ebecca62281d0e8813b0122', 'createTable tableName=cpq_product_version_grouped_attributes; addPrimaryKey constraintName=cpq_product_version_grouped_attributes_pkey, tableName=cpq_product_version_grouped_attributes', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-466::NabilOUACHI
CREATE TABLE billing_accounting_article (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) NOT NULL, analytic_code_1 VARCHAR(255), analytic_code_2 VARCHAR(255), analytic_code_3 VARCHAR(255), unit_price numeric(23, 12), tax_class_id BIGINT NOT NULL, invoice_sub_category_id BIGINT NOT NULL, article_family_id BIGINT, accounting_code_id BIGINT, invoice_type_el VARCHAR(255), invoice_type_id BIGINT, description_i18n JSONB, accountingcode_el VARCHAR(500), column_criteria_el VARCHAR(500), disabled INTEGER DEFAULT 0 NOT NULL, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, ignore_aggregation INTEGER DEFAULT 0, allowance_code BIGINT, physical INTEGER DEFAULT 0, CONSTRAINT billing_article_pk PRIMARY KEY (id), UNIQUE (code), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-467::NabilOUACHI
CREATE TABLE billing_article_family (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), code VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, accounting_code_id BIGINT NOT NULL, article_family_ref_id BIGINT, cf_values JSONB, description_i18n JSONB, CONSTRAINT billing_article_family_pk PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-468::NabilOUACHI
CREATE TABLE billing_article_mapping (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) NOT NULL, mapping_script_id BIGINT, CONSTRAINT billing_article_mapping_pk PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-469::NabilOUACHI
CREATE TABLE billing_article_mapping_line (id BIGINT NOT NULL, version INTEGER, code VARCHAR(50), description VARCHAR(255), created TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(50), updater VARCHAR(50), updated TIMESTAMP WITHOUT TIME ZONE, article_mapping_id BIGINT, article_id BIGINT NOT NULL, offer_template_id BIGINT, charge_template_id BIGINT, product_id BIGINT, parameter_1 VARCHAR(255), parameter_2 VARCHAR(255), parameter_3 VARCHAR(255), mapping_key_el VARCHAR(255), attribute_operator VARCHAR(10) DEFAULT 'AND' NOT NULL, CONSTRAINT billing_article_mapping_line_pk PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-470::NabilOUACHI
CREATE TABLE billing_attribute_mapping (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(50), updater VARCHAR(50), updated TIMESTAMP WITHOUT TIME ZONE, article_mapping_line_id BIGINT NOT NULL, attribute_id BIGINT NOT NULL, attribute VARCHAR(30), attribute_value VARCHAR(255), operator VARCHAR(50) DEFAULT 'EQUAL' NOT NULL, CONSTRAINT billing_attribute_mapping_pk PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-471::NabilOUACHI
CREATE TABLE cpq_billing_account_tags (billing_account_id BIGINT NOT NULL, tag_id BIGINT NOT NULL);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-472::NabilOUACHI
CREATE TABLE cpq_attribute_charge (charge_id BIGINT NOT NULL, attribute_id BIGINT NOT NULL);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-473::NabilOUACHI
CREATE TABLE cpq_offer_attributes (offer_template_id BIGINT, attribute_id BIGINT);

ALTER TABLE cpq_offer_attributes ADD PRIMARY KEY (offer_template_id, attribute_id);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-474::NabilOUACHI
CREATE TABLE cpq_commercial_order (id BIGINT NOT NULL, code VARCHAR(50), description VARCHAR(255), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), version INTEGER, seller_id BIGINT NOT NULL, order_number VARCHAR(50), label VARCHAR(255), billing_account_id BIGINT NOT NULL, cpq_quote_id BIGINT, contract_id BIGINT, status VARCHAR(50) NOT NULL, status_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, order_progress INTEGER NOT NULL, progress_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, order_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, realisation_date TIMESTAMP WITHOUT TIME ZONE, customer_service_begin TIMESTAMP WITHOUT TIME ZONE, customer_service_duration INTEGER, external_reference VARCHAR(50), order_parent_id BIGINT, order_type_id BIGINT, invoicing_plan_id BIGINT, invoice_type_id BIGINT NOT NULL, user_account_id BIGINT, access_id BIGINT, rate_invoiced INTEGER NOT NULL, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, oneshot_total_amount numeric(23, 12), discount_plan_id BIGINT, sales_person_name VARCHAR(52), billing_cycle_id BIGINT, billing_run_id BIGINT, price_list_id BIGINT, mrr numeric(23, 12), CONSTRAINT pk_cpq_commercial_order PRIMARY KEY (id), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-475::NabilOUACHI
CREATE TABLE cpq_commercial_order_billing_invoice (commercial_order_id BIGINT NOT NULL, invoice_id BIGINT NOT NULL);

ALTER TABLE cpq_commercial_order_billing_invoice ADD PRIMARY KEY (commercial_order_id, invoice_id);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-476::NabilOUACHI
CREATE TABLE cpq_invoicing_plan (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), 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, disabled INTEGER DEFAULT 0 NOT NULL, cf_values JSONB, CONSTRAINT pk_cpq_invoicing_plan PRIMARY KEY (id), UNIQUE (code), UNIQUE (uuid));

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

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

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-478::NabilOUACHI
CREATE TABLE cpq_order_attribute (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), order_id BIGINT, order_lot_id BIGINT, order_product_id BIGINT, access_point VARCHAR(20), cpq_attribute_id BIGINT, string_value VARCHAR(255), date_value TIMESTAMP WITHOUT TIME ZONE, double_value FLOAT8, parent_id BIGINT, cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), cpq_order_offer_id BIGINT, boolean_value INTEGER, CONSTRAINT pk_cpq_order_item PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-479::NabilOUACHI
CREATE TABLE cpq_order_product (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), order_id BIGINT NOT NULL, order_service_commercial_id BIGINT, order_offer_id BIGINT NOT NULL, product_version_id BIGINT, quantity numeric(23, 12) NOT NULL, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, discount_plan_id BIGINT, quote_product_id BIGINT, delivery_date TIMESTAMP WITHOUT TIME ZONE, order_amendement_suspend_id BIGINT, order_amendement_reactivate_id BIGINT, order_amendement_terminate_id BIGINT, order_amendement_activate_id BIGINT, order_amendement_restart_id BIGINT, production_action_type VARCHAR(10), termination_date TIMESTAMP WITHOUT TIME ZONE, sub_termin_reason_id BIGINT, instance_status VARCHAR(10), service_instance_id BIGINT, mrr numeric(23, 12), CONSTRAINT pk_cpq_order_product PRIMARY KEY (id), UNIQUE (uuid));

ALTER TABLE cpq_order_product ADD CONSTRAINT fk_cpq_order_product_service_instance_id FOREIGN KEY (service_instance_id) REFERENCES billing_service_instance (id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-479', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 677, '9:12575954b9e6f575c650dc770a185cf3', 'createTable tableName=cpq_order_product; addForeignKeyConstraint baseTableName=cpq_order_product, constraintName=fk_cpq_order_product_service_instance_id, referencedTableName=billing_service_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-480::NabilOUACHI
CREATE TABLE cpq_order_lot (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), order_id BIGINT NOT NULL, name VARCHAR(50), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, quote_lot_id BIGINT, CONSTRAINT pk_cpq_order_lot PRIMARY KEY (id), UNIQUE (code), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-481::NabilOUACHI
CREATE TABLE cpq_order_offer (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), order_id BIGINT NOT NULL, offer_template_id BIGINT NOT NULL, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, discount_plan_id BIGINT, quote_offer_id BIGINT, code VARCHAR(255), description VARCHAR(255), delivery_date TIMESTAMP WITHOUT TIME ZONE, user_account_id BIGINT, order_line_type VARCHAR(20), subscription_id BIGINT, termination_date TIMESTAMP WITHOUT TIME ZONE, sub_termin_reason_id BIGINT, contract_id BIGINT, CONSTRAINT pk_cpq_order_offer PRIMARY KEY (id), UNIQUE (uuid));

ALTER TABLE cpq_order_offer ADD CONSTRAINT fk_cpq_order_offer_user_account FOREIGN KEY (user_account_id) REFERENCES billing_user_account (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-481', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 681, '9:d263bd268b17875bd72ff431e0165b20', 'createTable tableName=cpq_order_offer; addForeignKeyConstraint baseTableName=cpq_order_offer, constraintName=fk_cpq_order_offer_user_account, referencedTableName=billing_user_account', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-482::NabilOUACHI
CREATE TABLE order_article_line (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), order_id BIGINT NOT NULL, order_customer_service_id BIGINT, accounting_article_id BIGINT NOT NULL, quantity numeric(23, 12) NOT NULL, quantity_service numeric(23, 12) NOT NULL, os_unit_price_without_tax numeric(23, 12), os_price_without_tax numeric(23, 12), os_tax_code numeric(23, 12), os_tax_rate INTEGER, os_price_with_tax numeric(23, 12), rc_unit_price_without_tax numeric(23, 12), rc_price_without_tax numeric(23, 12), rc_tax_code numeric(23, 12), rc_tax_rate INTEGER, rc_price_with_tax numeric(23, 12), order_product_id BIGINT, quote_offer_id BIGINT, CONSTRAINT pk_order_article_line PRIMARY KEY (id), UNIQUE (code));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-483::NabilOUACHI
CREATE TABLE order_price (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), order_article_line_id BIGINT, order_id BIGINT NOT NULL, price_level VARCHAR(50), price_type VARCHAR(50), amount_with_tax numeric(23, 12), unit_price_without_tax numeric(23, 12), amount_without_tax numeric(23, 12), amount_without_tax_with_discount numeric(23, 12), tax_amount numeric(23, 12), tax_rate numeric(23, 12), price_over_charged INTEGER, currency_code VARCHAR(25), recurrence_duration BIGINT, recurrence_periodicity VARCHAR(50), charge_template_id BIGINT, order_offer_id BIGINT, quantity numeric(19, 2), discounted_order_price BIGINT, discount_plan_id BIGINT, discount_value numeric(23, 12), discount_plan_type VARCHAR(50), discount_plan_item_id BIGINT, apply_discounts_on_overriden_price INTEGER, discounted_amount numeric(23, 12), sequence INTEGER, tax_id BIGINT, CONSTRAINT pk_order_price PRIMARY KEY (id), UNIQUE (code));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-484::NabilOUACHI
CREATE TABLE cpq_order_invoice (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), seller_id BIGINT NOT NULL, billing_account_id BIGINT NOT NULL, invoice_type_id BIGINT NOT NULL, invoice_ref VARCHAR(20), status VARCHAR(20), status_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, invoice_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, due_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, begin_date TIMESTAMP WITHOUT TIME ZONE, end_date TIMESTAMP WITHOUT TIME ZONE, amount_without_tax numeric(23, 12) NOT NULL, amount_with_tax numeric(23, 12) NOT NULL, amount_tax numeric(23, 12) NOT NULL, payment_method_id BIGINT NOT NULL, pdf_link VARCHAR(255), commercial_order_id BIGINT, CONSTRAINT pk_cpq_order_invoice PRIMARY KEY (id), UNIQUE (code));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-485::NabilOUACHI
CREATE TABLE cpq_order_invoice_access_point_list (order_invoice_id BIGINT, access_point_list VARCHAR(100));

ALTER TABLE cpq_order_invoice_access_point_list ADD CONSTRAINT cpq_order_invoice_access_point_list_pkey PRIMARY KEY (order_invoice_id, access_point_list);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-485', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 689, '9:f8f43252733032ca70ce99434e20d9d2', 'createTable tableName=cpq_order_invoice_access_point_list; addPrimaryKey constraintName=cpq_order_invoice_access_point_list_pkey, tableName=cpq_order_invoice_access_point_list', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-486::NabilOUACHI
CREATE TABLE cpq_order_invoice_order_ref_list (order_invoice_id BIGINT, order_ref_list VARCHAR(100));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-487::NabilOUACHI
CREATE TABLE billing_invoice_line (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), invoice_id BIGINT, prestation VARCHAR(255), accounting_article_id BIGINT NOT NULL, offer_service_template_id BIGINT, product_id BIGINT, service_template_id BIGINT, begin_date TIMESTAMP WITHOUT TIME ZONE, end_date TIMESTAMP WITHOUT TIME ZONE, quantity numeric(23, 12) NOT NULL, unit_price numeric(23, 12) NOT NULL, discount_rate numeric(23, 12) NOT NULL, amount_without_tax numeric(23, 12) NOT NULL, tax_rate numeric(23, 12) NOT NULL, amount_with_tax numeric(23, 12) NOT NULL, amount_tax numeric(23, 12) NOT NULL, discount_plan_id BIGINT, tax_id BIGINT, order_ref VARCHAR(20), access_point VARCHAR(20), commercial_order_id BIGINT, billing_run_id BIGINT, billing_account_id BIGINT, label VARCHAR(255) NOT NULL, raw_amount numeric NOT NULL, value_date TIMESTAMP WITHOUT TIME ZONE, order_number VARCHAR(255), discount_amount numeric NOT NULL, subscription_id BIGINT, user_account_id BIGINT, service_instance_id BIGINT, offer_template_id BIGINT, order_lot_id BIGINT, product_version_id BIGINT, cpq_quote_id BIGINT, status VARCHAR(255) NOT NULL, quote_offer_id BIGINT, order_offer_id BIGINT, discounted_invoice_line BIGINT, discount_value numeric(23, 12), discount_plan_type VARCHAR(50), discount_plan_item_id BIGINT, aggregate_id_f BIGINT, tax_mode VARCHAR(50), transactional_unit_price numeric(23, 12), transactional_amount_without_tax numeric(23, 12), transactional_amount_with_tax numeric(23, 12), transactional_amount_tax numeric(23, 12), transactional_discount_amount numeric(23, 12), transactional_raw_amount numeric(23, 12), use_specific_price_conversion INTEGER DEFAULT 0, open_order_number VARCHAR(255), sequence INTEGER, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, adjustment_status VARCHAR(50), conversion_from_billing_currency INTEGER DEFAULT 0, linked_invoice_line_id BIGINT, additional_agg_fields JSONB, invoice_key VARCHAR(255), seller_id BIGINT, invoice_type_id BIGINT, CONSTRAINT pk_billing_invoice_line PRIMARY KEY (id), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-488::NabilOUACHI
CREATE TABLE cpq_invoicing_plan_item (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), billing_plan_id BIGINT NOT NULL, advancement INTEGER NOT NULL, rate_to_bill numeric(23, 12) NOT NULL, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, disabled INTEGER DEFAULT 0 NOT NULL, cf_values JSONB, CONSTRAINT pk_cpq_invoicing_plan_item PRIMARY KEY (id), UNIQUE (code), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-489::NabilOUACHI
CREATE TABLE cpq_price_plan_matrix_column (id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, description VARCHAR(255), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), ppm_version_id BIGINT, position INTEGER, type VARCHAR(255), el_value VARCHAR(255), product_id BIGINT, offer_id BIGINT, attribute_id BIGINT, is_range INTEGER DEFAULT 0, CONSTRAINT cpq_price_plan_matrix_column_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-489', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 697, '9:efc238fc9b739e8eb132053fe9460b11', 'createTable tableName=cpq_price_plan_matrix_column', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-490::NabilOUACHI
CREATE TABLE cpq_price_plan_matrix_value (id BIGINT NOT NULL, version INTEGER, ppm_column_id BIGINT, ppml_id BIGINT, long_value BIGINT, double_value FLOAT8, string_value VARCHAR(255), date_value TIMESTAMP WITHOUT TIME ZONE, from_date_value TIMESTAMP WITHOUT TIME ZONE, to_date_value TIMESTAMP WITHOUT TIME ZONE, from_double_value FLOAT8, to_double_value FLOAT8, boolean_value INTEGER, CONSTRAINT cpq_price_plan_matrix_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-490', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 699, '9:0886fd57b53fdba3107ed1a28439692f', 'createTable tableName=cpq_price_plan_matrix_value', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-491::NabilOUACHI
CREATE TABLE cpq_price_plan_matrix_line (id BIGINT NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), version INTEGER, ppm_version_id BIGINT, priority INTEGER DEFAULT 0, value_el VARCHAR(255), description VARCHAR(255), value numeric(23, 12), accuracy INTEGER DEFAULT 0 NOT NULL, cf_values_accum JSONB, cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, CONSTRAINT pk_cpq_price_plan_matrix_line PRIMARY KEY (id), UNIQUE (uuid));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-492::NabilOUACHI
CREATE TABLE cat_product_wallet_template_1 (product_templt_id BIGINT NOT NULL, wallet_template_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE cat_product_wallet_template_1 ADD CONSTRAINT cat_product_wallet_template_1_pkey PRIMARY KEY (product_templt_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-492', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 703, '9:ab593548c10f5a40e44ad9fbc5d23c5c', 'createTable tableName=cat_product_wallet_template_1; addPrimaryKey constraintName=cat_product_wallet_template_1_pkey, tableName=cat_product_wallet_template_1', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-493::NabilOUACHI
CREATE TABLE cat_product_counter_template (product_templt_id BIGINT NOT NULL, counter_template_id BIGINT NOT NULL, indx INTEGER NOT NULL);

ALTER TABLE cat_product_counter_template ADD CONSTRAINT cat_product_counter_template_pkey PRIMARY KEY (product_templt_id, counter_template_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-493', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 705, '9:acf1eb8d73abeda4e90ad332770c9c77', 'createTable tableName=cat_product_counter_template; addPrimaryKey constraintName=cat_product_counter_template_pkey, tableName=cat_product_counter_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-494::NabilOUACHI
CREATE TABLE cpq_attribute_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), cpq_attribute_id BIGINT NOT NULL, service_instance_id BIGINT, subscription_id BIGINT, string_value VARCHAR(255), double_value FLOAT8, date_value TIMESTAMP WITHOUT TIME ZONE, parent_id BIGINT, cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), boolean_value INTEGER, CONSTRAINT pk_cpq_attribute_instance PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-495::NabilOUACHI
CREATE TABLE cpq_offer_template_media (offer_template_id BIGINT NOT NULL, media_id BIGINT NOT NULL);

ALTER TABLE cpq_offer_template_media ADD CONSTRAINT cpq_offer_template_media_pkey UNIQUE (offer_template_id, media_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-495', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 709, '9:c0d26b09d978a7c1bc02d7f6cef6ebc1', 'createTable tableName=cpq_offer_template_media; addUniqueConstraint constraintName=cpq_offer_template_media_pkey, tableName=cpq_offer_template_media', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-496::NabilOUACHI
CREATE TABLE cpq_product_media (product_id BIGINT NOT NULL, media_id BIGINT NOT NULL);

ALTER TABLE cpq_product_media ADD CONSTRAINT cpq_product_media_pkey UNIQUE (product_id, media_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-496', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 711, '9:5be111ece028d8f59192d1bbb68b5276', 'createTable tableName=cpq_product_media; addUniqueConstraint constraintName=cpq_product_media_pkey, tableName=cpq_product_media', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-497::NabilOUACHI
CREATE TABLE cpq_attribute_media (attribute_id BIGINT NOT NULL, media_id BIGINT NOT NULL);

ALTER TABLE cpq_attribute_media ADD CONSTRAINT cpq_attribute_media_pkey UNIQUE (attribute_id, media_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-497', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 713, '9:33216c4d8d1f8705b61c9263a10e744b', 'createTable tableName=cpq_attribute_media; addUniqueConstraint constraintName=cpq_attribute_media_pkey, tableName=cpq_attribute_media', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-498::NabilOUACHI
CREATE TABLE cpq_grouped_attributes_attribute (grouped_attributes BIGINT NOT NULL, attribute_id BIGINT NOT NULL);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-499::NabilOUACHI
CREATE TABLE cpq_product_charge_template_mapping (id BIGINT NOT NULL, version INTEGER, product_id BIGINT, charge_template_id BIGINT, counter_template_id BIGINT, CONSTRAINT cpq_product_charge_template_mapping_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-499', 'NabilOUACHI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 717, '9:93c1a8936b79aabec8c48dec4dc21261', 'createTable tableName=cpq_product_charge_template_mapping', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-500::NabilOUACHI
CREATE TABLE discount_plan_item_articles (discount_plan_item_id BIGINT NOT NULL, accounting_article_id BIGINT NOT NULL);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-501::NabilOUACHI
CREATE TABLE cpq_attribute_tag (tag_id BIGINT NOT NULL, attribute_id BIGINT NOT NULL);

ALTER TABLE cpq_attribute_tag ADD PRIMARY KEY (tag_id, attribute_id);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-502::NabilOUACHI
CREATE TABLE cpq_commercial_order_order_lot (commercial_order_id BIGINT NOT NULL, order_lot_id BIGINT NOT NULL);

ALTER TABLE cpq_commercial_order_order_lot ADD PRIMARY KEY (commercial_order_id, order_lot_id);

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-429::AndriusKarpavicius
CREATE TABLE billing_rated_transaction_pending (id BIGINT NOT NULL, aggregate_id_f BIGINT, invoice_id BIGINT, invoice_line_id BIGINT, billing_run_id BIGINT, unit_amount_without_tax numeric(23, 12), unit_amount_with_tax numeric(23, 12), unit_amount_tax numeric(23, 12), amount_without_tax numeric(23, 12), amount_with_tax numeric(23, 12), amount_tax numeric(23, 12), tax_id BIGINT, tax_percent numeric(23, 12), CONSTRAINT billing_rt_pending_pk PRIMARY KEY (id));

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

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

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-2021204::ZBariki
CREATE TABLE cat_discount_applicable_entity (disount_plan_id BIGINT NOT NULL, code VARCHAR(255) NOT NULL, entity_class VARCHAR(255) NOT NULL);

ALTER TABLE cat_discount_applicable_entity ADD CONSTRAINT cat_discount_applicable_entity_pkey PRIMARY KEY (disount_plan_id, code, entity_class);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-2021204', 'ZBariki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 729, '9:f6200ea49c98478a7430c98ef907e0fa', 'createTable tableName=cat_discount_applicable_entity; addPrimaryKey constraintName=cat_discount_applicable_entity_pkey, tableName=cat_discount_applicable_entity', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-257_20210625-rebuild::ZBariki
CREATE TABLE report_query (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), target_entity VARCHAR(255) NOT NULL, visibility VARCHAR(255) NOT NULL, filters JSONB, generated_query TEXT, sort_by VARCHAR(255), sort_order VARCHAR(15), query_parameters JSONB, aliases JSONB, advanced_query JSONB, CONSTRAINT cust_query_pkey PRIMARY KEY (id));

CREATE TABLE report_query_fields (id BIGINT NOT NULL, field VARCHAR(255));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-257_20210625-rebuild', 'ZBariki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 731, '9:97ce8ea59c27cf4dc146c94bdc8e1478', 'createTable tableName=report_query; createTable tableName=report_query_fields', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-682_20210707-rebuild::HatimOUDAD
CREATE TABLE query_scheduler (id BIGINT NOT NULL, code VARCHAR(255), description VARCHAR(255), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), file_format VARCHAR(255), year VARCHAR(255), month VARCHAR(255), every_month INTEGER DEFAULT 0, day_month VARCHAR(255), every_day_month INTEGER DEFAULT 0, day_week VARCHAR(255), every_day_week INTEGER DEFAULT 0, hour VARCHAR(255), every_hour INTEGER DEFAULT 0, minute VARCHAR(255), every_minute INTEGER DEFAULT 0, second VARCHAR(255), every_second INTEGER DEFAULT 0, job_instance_id BIGINT, report_query_id BIGINT, is_query_scheduler INTEGER DEFAULT 0, CONSTRAINT query_scheduler_pkey PRIMARY KEY (id));

CREATE TABLE query_scheduler_users (query_scheduler_id BIGINT NOT NULL, user_id BIGINT NOT NULL);

ALTER TABLE query_scheduler_users ADD CONSTRAINT adm_query_scheduler_user_pkey PRIMARY KEY (query_scheduler_id, user_id);

CREATE TABLE query_scheduler_emails (query_scheduler_id BIGINT, emails VARCHAR(100));

CREATE TABLE query_execution_result (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), start_date TIMESTAMP WITHOUT TIME ZONE, end_date TIMESTAMP WITHOUT TIME ZONE, execution_duration BIGINT, file_path VARCHAR(255), line_count INTEGER, error_message VARCHAR(255), status VARCHAR(255) NOT NULL, query_execution_mode VARCHAR(255) NOT NULL, query_scheduler_id BIGINT, report_query_id BIGINT, CONSTRAINT query_result_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-682_20210707-rebuild', 'HatimOUDAD', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 733, '9:d39952564d85e1df4ccd6909ce73d2c4', 'createTable tableName=query_scheduler; createTable tableName=query_scheduler_users; addPrimaryKey constraintName=adm_query_scheduler_user_pkey, tableName=query_scheduler_users; createTable tableName=query_scheduler_emails; createTable tableName=qu...', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-634_20210706-rebuild::Mbarek-Ay
CREATE TABLE dunning_settings (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), dunning_mode VARCHAR(255) NOT NULL, max_dunning_levels INTEGER, max_days_outstanding INTEGER, allow_interest_for_delay INTEGER DEFAULT 1, interest_for_delay_rate numeric(23, 12), allow_dunning_charges INTEGER DEFAULT 1, apply_dunning_charge_fx_exchange_rate INTEGER DEFAULT 1, accounting_article_id BIGINT, customer_balance_id BIGINT, CONSTRAINT dunning_settings_pkey PRIMARY KEY (id));

CREATE TABLE dunning_pause_reasons (id BIGINT NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, pause_reason VARCHAR(255) NOT NULL, description VARCHAR(255), description_i18n JSONB, dunning_settings_id BIGINT NOT NULL, CONSTRAINT dunning_pause_reasons_pkey PRIMARY KEY (id));

CREATE TABLE dunning_stop_reasons (id BIGINT NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, stop_reason VARCHAR(255) NOT NULL, description VARCHAR(255), description_i18n JSONB, dunning_settings_id BIGINT NOT NULL, CONSTRAINT dunning_stop_reasons_pkey PRIMARY KEY (id));

CREATE TABLE dunning_collection_plan_statuses (id BIGINT NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, status VARCHAR(50) NOT NULL, description VARCHAR(255) NOT NULL, color_code VARCHAR(50), dunning_settings_id BIGINT NOT NULL, CONSTRAINT dunning_collection_plan_statuses_pkey PRIMARY KEY (id));

CREATE TABLE dunning_agent (id BIGINT NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, external INTEGER DEFAULT 0, collection_agency VARCHAR(100), agent_first_name_item VARCHAR(100), agent_last_name_item VARCHAR(100), agent_email_item VARCHAR(100), dunning_settings_id BIGINT NOT NULL, CONSTRAINT dunning_agent_pkey PRIMARY KEY (id));

CREATE TABLE dunning_payment_retries (id BIGINT NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, payment_method VARCHAR(100) NOT NULL, psp VARCHAR(255), num_pay_retries INTEGER NOT NULL, pay_retry_frequency_unit VARCHAR(255) NOT NULL, pay_retry_frequency INTEGER NOT NULL, dunning_settings_id BIGINT NOT NULL, CONSTRAINT dunning_payment_retries_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-634_20210706-rebuild', 'Mbarek-Ay', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 735, '9:e6bbed3408a985148760a6f3af9a1137', 'createTable tableName=dunning_settings; createTable tableName=dunning_pause_reasons; createTable tableName=dunning_stop_reasons; createTable tableName=dunning_collection_plan_statuses; createTable tableName=dunning_agent; createTable tableName=dun...', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-1441_20210728-rebuild::TarikFA.
CREATE TABLE cpq_quote_version_media (cpq_quote_version_id BIGINT, cpq_media_id BIGINT);

ALTER TABLE cpq_quote_version_media ADD PRIMARY KEY (cpq_quote_version_id, cpq_media_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-1441_20210728-rebuild', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 737, '9:e2b13c66c1d4ba49790418b82178fa11', 'createTable tableName=cpq_quote_version_media; addPrimaryKey tableName=cpq_quote_version_media', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-1291_20210804-rebuild::HatimOUDAD
CREATE TABLE accounting_period (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), accounting_period_year VARCHAR(20) NOT NULL, start_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, end_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, use_sub_accounting_cycles INTEGER DEFAULT 0, status VARCHAR(255), sub_accounting_period_type VARCHAR(255), sub_accounting_period_progress VARCHAR(255), ongoing_sub_accounting_periods VARCHAR(255), accounting_operation_action VARCHAR(255), regular_user_lock_option VARCHAR(255), custom_lock_number_days INTEGER, custom_lock_option VARCHAR(255), force_option VARCHAR(50), force_custom_day INTEGER, CONSTRAINT accounting_period_pkey PRIMARY KEY (id), UNIQUE (start_date), UNIQUE (end_date));

CREATE TABLE sub_accounting_period (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), period_number INTEGER, start_date date, end_date date, regular_users_sub_period_status VARCHAR(255), regular_users_closed_date TIMESTAMP WITHOUT TIME ZONE, effective_closed_date TIMESTAMP WITHOUT TIME ZONE, accounting_period_id BIGINT, all_users_sub_period_status VARCHAR(255), regularusers_reopening_reason VARCHAR(2000), allusers_reopening_reason VARCHAR(2000), CONSTRAINT sub_accounting_period_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-1291_20210804-rebuild', 'HatimOUDAD', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 739, '9:41f29d8ba0c25385c5445fafe8e97b17', 'createTable tableName=accounting_period; createTable tableName=sub_accounting_period', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-1313_20210809-rebuild::HatimOUDAD
CREATE TABLE journal (id BIGINT NOT NULL, code VARCHAR(255), description VARCHAR(255), version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT journal_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-1313_20210809-rebuild', 'HatimOUDAD', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 741, '9:b83c0c6b4d25c3d7196b684471156a27', 'createTable tableName=journal', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::INTRD-1901_20210920_build::TarikFA.
CREATE TABLE offer_template_attribute (id BIGINT NOT NULL, version INTEGER DEFAULT 0, mandatorwith_el VARCHAR(255), offer_template_id BIGINT NOT NULL, attribute_id BIGINT NOT NULL, sequence INTEGER DEFAULT 0, mandatory INTEGER DEFAULT 0 NOT NULL, read_only INTEGER DEFAULT 0, display INTEGER DEFAULT 0, default_value VARCHAR(255), validation_type VARCHAR(10), validation_pattern VARCHAR(2000), validation_label VARCHAR(255), CONSTRAINT cpq_offer_template_attribute_pk PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-1901_20210920_build', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 743, '9:0fdff7759afcea0d3eae8c0d7257ea43', 'createTable tableName=offer_template_attribute', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-2364-create_data_model_build::AbdelkaderBouazza
CREATE TABLE dunning_action_notification_template (dunning_action_id BIGINT, action_notification_template VARCHAR(200));

CREATE TABLE ar_dunning_level (level_id BIGINT, related_levels VARCHAR(255));

CREATE TABLE ar_dunning_action (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), is_action_active INTEGER DEFAULT 1, action_type VARCHAR(255) NOT NULL, action_mode VARCHAR(255) NOT NULL, action_channel VARCHAR(255), script_instance_id BIGINT, action_notification_template_id BIGINT, attach_overdue_invoices INTEGER DEFAULT 1, attach_due_invoices INTEGER DEFAULT 0, dunning_agent_id BIGINT, type VARCHAR(255), cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, CONSTRAINT ar_dunning_action_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-2364-create_data_model_build', 'AbdelkaderBouazza', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 745, '9:aba01aed0b986dea3eb077a8a1ecd910', 'createTable tableName=dunning_action_notification_template; createTable tableName=ar_dunning_level; createTable tableName=ar_dunning_action', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::INTRD-2444_20211018-rebuild::ZBariki
CREATE TABLE dunning_policy (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), policy_name VARCHAR(255) NOT NULL, policy_description VARCHAR(2000) NOT NULL, interest_for_delay_sequence INTEGER, min_balance_trigger FLOAT8 DEFAULT '0' NOT NULL, include_due_invoices_in_threshold INTEGER DEFAULT 1, total_dunning_levels INTEGER, include_pay_reminder INTEGER DEFAULT 0, attach_invoices_to_emails INTEGER DEFAULT 0, policy_priority INTEGER, is_default_policy INTEGER DEFAULT 0, is_active_policy INTEGER DEFAULT 1, min_balance_trigger_currency_id BIGINT, determine_level_by VARCHAR(255) NOT NULL, disabled INTEGER DEFAULT 0 NOT NULL, type VARCHAR(255), CONSTRAINT dunning_policy_pkey PRIMARY KEY (id), CONSTRAINT uk_dp_dunning_policy_name UNIQUE (policy_name));

CREATE TABLE dunning_policy_rule (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), rule_joint VARCHAR(255), dunning_policy_id BIGINT, CONSTRAINT dunning_policy_rule_pkey PRIMARY KEY (id));

CREATE TABLE dunning_policy_rule_line (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), policy_condition_operator VARCHAR(255), policy_condition_target VARCHAR(255) NOT NULL, policy_condition_target_value VARCHAR(255) NOT NULL, dunning_policy_rule_id BIGINT, rule_line_joint VARCHAR(255), CONSTRAINT dunning_policy_rule_line_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-2444_20211018-rebuild', 'ZBariki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 747, '9:ebdc8e528fcc4c6845574b80a4e39c92', 'createTable tableName=dunning_policy; createTable tableName=dunning_policy_rule; createTable tableName=dunning_policy_rule_line', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-431::AbdelmounaimAkadid
CREATE TABLE dunning_level (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), reminder INTEGER DEFAULT 0, active INTEGER DEFAULT 1, days_overdue INTEGER NOT NULL, soft_decline INTEGER DEFAULT 0, min_balance numeric(23, 12), min_balance_currency_id BIGINT, charge_type VARCHAR(255), charge_value numeric(23, 12), charge_currency_id BIGINT, end_dunning_level INTEGER DEFAULT 0, type VARCHAR(255), cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, CONSTRAINT dunning_level_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-431', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 749, '9:2f3a294fc1ec54f6a2ad47563e6a8c63', 'createTable tableName=dunning_level', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-432::AbdelmounaimAkadid
CREATE TABLE dunning_level_dunning_action (dunning_level_id BIGINT NOT NULL, dunning_action_id BIGINT NOT NULL);

ALTER TABLE dunning_level_dunning_action ADD CONSTRAINT dunning_level_dunning_action_pkey PRIMARY KEY (dunning_level_id, dunning_action_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-432', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 751, '9:6873ad9e999c0c86690e73860386f1ae', 'createTable tableName=dunning_level_dunning_action; addPrimaryKey constraintName=dunning_level_dunning_action_pkey, tableName=dunning_level_dunning_action', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-433::AbdelmounaimAkadid
CREATE TABLE dunning_policy_level (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), sequence INTEGER NOT NULL, dunning_level_id BIGINT, collection_plan_status_id BIGINT, dunning_policy_id BIGINT, CONSTRAINT dunning_policy_level_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-433', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 753, '9:ac073e60765c6baa60d99e5ca3107428', 'createTable tableName=dunning_policy_level', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-503::hhanine
CREATE TABLE crm_provider_payment_plan_policy_pay_methods (provider_id BIGINT, payment_method VARCHAR(255));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-434::HatimOUDAD
CREATE TABLE dunning_collection_plan (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), collection_plan_number VARCHAR(255), related_policy_id BIGINT, initial_collection_plan_id BIGINT, billing_account_id BIGINT, related_invoice_id BIGINT, pause_reason_id BIGINT, stop_reason_id BIGINT, current_dunning_level_sequence INTEGER, start_date TIMESTAMP WITHOUT TIME ZONE, days_open INTEGER, close_date TIMESTAMP WITHOUT TIME ZONE, status_id BIGINT, paused_until_date TIMESTAMP WITHOUT TIME ZONE, balance numeric(23, 12), retry_payment_on_resume_date INTEGER DEFAULT 0, next_action VARCHAR(255), next_action_date TIMESTAMP WITHOUT TIME ZONE, last_action VARCHAR(255), last_action_date TIMESTAMP WITHOUT TIME ZONE, total_dunning_levels INTEGER, pause_duration INTEGER, customer_account_id BIGINT, CONSTRAINT dunning_collection_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-434', 'HatimOUDAD', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 757, '9:c354792c7f2563a09629a5dcf1c8b88d', 'createTable tableName=dunning_collection_plan', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-2973_20211110-rebuild-str-tbl::AmineBENAICHA
CREATE TABLE dunning_level_instance (id BIGINT NOT NULL, version INTEGER, code VARCHAR(255), description VARCHAR(255), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), sequence INTEGER NOT NULL, days_overdue INTEGER NOT NULL, dunning_collection_plan_id BIGINT, dunning_collection_plan_status_id BIGINT, level_status VARCHAR(255), dunning_level_id BIGINT, invoice_id BIGINT, customer_account_id BIGINT, cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, execution_date TIMESTAMP WITHOUT TIME ZONE, CONSTRAINT dunning_level_instance_pkey PRIMARY KEY (id));

CREATE TABLE dunning_action_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), action_type VARCHAR(255) NOT NULL, code VARCHAR(255), description VARCHAR(255), action_mode VARCHAR(255) NOT NULL, dunning_agent_id BIGINT, action_restult VARCHAR(255), action_status VARCHAR(255), dunning_collection_plan_id BIGINT, dunning_level_instance_id BIGINT, dunning_action_id BIGINT, cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, execution_date TIMESTAMP WITHOUT TIME ZONE, CONSTRAINT dunning_action_instance_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-2973_20211110-rebuild-str-tbl', 'AmineBENAICHA', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 759, '9:c6ee9a151c2e46964a904d6cee2afb33', 'createTable tableName=dunning_level_instance; createTable tableName=dunning_action_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::INTRD-3781_20211217-rebuild-str-tbl::hichamElHaloui
CREATE TABLE finance_settings (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), description VARCHAR(255), use_security_deposit INTEGER DEFAULT 0, max_amount_security_deposit numeric(23, 12), max_amount_consumer numeric(23, 12), auto_refund INTEGER DEFAULT 0, open_order_settings_id BIGINT, use_auxiliary_accounting INTEGER DEFAULT 0 NOT NULL, auxiliary_account_code_el VARCHAR(2000) DEFAULT '#{gca.code.substring(0, 3)}#{ca.description}', auxiliary_account_label_el VARCHAR(2000) DEFAULT '#{ca.description}', activate_dunning INTEGER DEFAULT 0, enable_billing_redirection_rules INTEGER DEFAULT 0, discount_advanced_mode INTEGER DEFAULT 0, enable_price_list INTEGER DEFAULT 0, article_selection_mode VARCHAR(30) DEFAULT 'AFTER_PRICING', entities_with_huge_volume JSONB, billing_run_process_warning INTEGER DEFAULT 0, nb_partitions_keep INTEGER, synchronous_mass_action_limit INTEGER DEFAULT 10000, handle_framework_agreement INTEGER DEFAULT 0, handle_invoice_plan INTEGER DEFAULT 0, handle_accounting_periods INTEGER DEFAULT 0, wo_partition_range_months INTEGER, rt_partition_range_months INTEGER, edr_partition_range_months INTEGER, enable_empty_subscription_activation INTEGER DEFAULT 0, enable_quotes_feature INTEGER DEFAULT 0, display_counters INTEGER DEFAULT 0, CONSTRAINT finance_settings_pkey PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-3461_20212128-rebuild-str-tbl::hichamElHaloui
CREATE TABLE security_deposit_templat (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), description VARCHAR(255), template_name VARCHAR(100), currency_id BIGINT, allow_validity_date INTEGER DEFAULT 0, allow_validity_period INTEGER DEFAULT 0, min_amount numeric(23, 12), max_amount numeric(23, 12), status VARCHAR(255), number_instantiation INTEGER, CONSTRAINT security_deposit_templat_pkey PRIMARY KEY (id));

CREATE TABLE security_deposit (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), description VARCHAR(255), cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), templat_id BIGINT, currency_id BIGINT, customer_account_id BIGINT, validity_date date, validity_period INTEGER, validity_period_unit VARCHAR(255), amount numeric(23, 12), current_balance numeric(23, 12), status VARCHAR(255), subscription_id BIGINT, external_reference VARCHAR(255), invoice_receipt_number VARCHAR(255), service_instance_id BIGINT, refund_reason VARCHAR(255), cancel_reason VARCHAR(255), sd_invoice_id BIGINT, billing_account_id BIGINT, sd_adjustment_id BIGINT, seller_id BIGINT NOT NULL, CONSTRAINT security_deposit_pkey PRIMARY KEY (id));

ALTER TABLE security_deposit ADD CONSTRAINT fk_seller_security_deposit FOREIGN KEY (seller_id) REFERENCES crm_seller (id) ON UPDATE NO ACTION ON DELETE NO ACTION;

CREATE TABLE security_deposit_transaction (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), description VARCHAR(255), cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, security_deposit_id BIGINT, account_operation_id BIGINT, security_deposit_operation VARCHAR(255), amount numeric(23, 12), transaction_date date, transaction_category VARCHAR(255), CONSTRAINT security_deposit_transaction_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-3461_20212128-rebuild-str-tbl', 'hichamElHaloui', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 763, '9:1748e6671f30c398917cf147c21022d1', 'createTable tableName=security_deposit_templat; createTable tableName=security_deposit; addForeignKeyConstraint baseTableName=security_deposit, constraintName=fk_seller_security_deposit, referencedTableName=crm_seller; createTable tableName=securi...', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-5419-20220308-tbl::HichamELHALOUI
CREATE TABLE open_order_setting (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), description VARCHAR(255), use_open_orders INTEGER DEFAULT 0, apply_maximum_validity INTEGER DEFAULT 0, apply_maximum_validity_value INTEGER, apply_maximum_validity_unit VARCHAR(6), define_maximum_validity INTEGER DEFAULT 0, define_maximum_validity_value INTEGER, use_managment_validation_for_oo_quotation INTEGER DEFAULT 0, CONSTRAINT open_order_setting_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-5419-20220308-tbl', 'HichamELHALOUI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 765, '9:2999bea7219dae3309d19433fbfcafb1', 'createTable tableName=open_order_setting', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-5310-20220310-tbl::HichamELHALOUI
CREATE TABLE open_order_threshold (id BIGINT NOT NULL, version INTEGER, sequence INTEGER, percentage INTEGER, open_order_template_id BIGINT, external_recipient VARCHAR(100), open_order_quote_id BIGINT, open_order_id BIGINT, CONSTRAINT open_order_threshold_pkey PRIMARY KEY (id));

CREATE TABLE open_order_threshold_recipients (threshold_id BIGINT, recipient VARCHAR(100));

CREATE TABLE open_order_template (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), description VARCHAR(255), open_order_type VARCHAR(50), status VARCHAR(255), template_name VARCHAR(100), CONSTRAINT open_order_template_pkey PRIMARY KEY (id), UNIQUE (code));

CREATE TABLE open_order_template_tags (open_order_template_id BIGINT NOT NULL, tag_id BIGINT NOT NULL);

CREATE TABLE open_order_template_products (open_order_template_id BIGINT NOT NULL, open_product_id BIGINT NOT NULL);

CREATE TABLE open_order_template_articles (open_order_template_id BIGINT NOT NULL, open_article_id BIGINT NOT NULL);

ALTER TABLE open_order_threshold_recipients ADD CONSTRAINT open_order_threshold_recipients_pkey PRIMARY KEY (threshold_id, recipient);

ALTER TABLE open_order_template_tags ADD CONSTRAINT open_order_template_tags_pkey PRIMARY KEY (open_order_template_id, tag_id);

ALTER TABLE open_order_template_products ADD CONSTRAINT open_order_template_products_pkey PRIMARY KEY (open_order_template_id, open_product_id);

ALTER TABLE open_order_template_articles ADD CONSTRAINT open_order_template_articles_pkey PRIMARY KEY (open_order_template_id, open_article_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-5310-20220310-tbl', 'HichamELHALOUI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 767, '9:7d20759a06a3d18d7e9683beb0d8331a', 'createTable tableName=open_order_threshold; createTable tableName=open_order_threshold_recipients; createTable tableName=open_order_template; createTable tableName=open_order_template_tags; createTable tableName=open_order_template_products; creat...', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-504::Mbarek-Ay
CREATE TABLE cpq_assigned_attributes (attribute_id BIGINT NOT NULL, assigned_attribute_id BIGINT NOT NULL);

ALTER TABLE cpq_assigned_attributes ADD PRIMARY KEY (attribute_id, assigned_attribute_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-tbl-504', 'Mbarek-Ay', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 769, '9:975a26d73475f52a36f9231728142ee5', 'createTable tableName=cpq_assigned_attributes; addPrimaryKey tableName=cpq_assigned_attributes', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-5908-20220330-tbl::AmineBENAICHA
CREATE TABLE global_settings (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), quote_default_validity_delay INTEGER DEFAULT 30 NOT NULL, activate_dunning INTEGER DEFAULT 0, CONSTRAINT global_settings_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-5908-20220330-tbl', 'AmineBENAICHA', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 771, '9:0d825c1e1a1b03abd8a5f75bb94e8eb7', 'createTable tableName=global_settings', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-8026_20220622-tbl::HatimOUDAD
CREATE TABLE open_order_quote (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_reference VARCHAR(255), open_order_type VARCHAR(50) NOT NULL, open_order_template_id BIGINT NOT NULL, quote_number VARCHAR(255) NOT NULL, max_amount numeric NOT NULL, currency_id BIGINT NOT NULL, end_validity_date TIMESTAMP WITHOUT TIME ZONE, activation_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, billing_account_id BIGINT NOT NULL, status VARCHAR(255) NOT NULL, open_order_id BIGINT, CONSTRAINT pk_open_order_quote PRIMARY KEY (id), CONSTRAINT open_order_quote_unique UNIQUE (code));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-8026_20220622-tbl', 'HatimOUDAD', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 773, '9:1a148e592767a121ea43b372feb0872a', 'createTable tableName=open_order_quote', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-tbl-8036::hichamhanine
CREATE TABLE invoice_sub_totals (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), sub_total_el VARCHAR(2000), label VARCHAR(50), invoice_type_id BIGINT NOT NULL, label_i18n JSONB, CONSTRAINT invoice_sub_totals_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-8036', 'hichamhanine', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 775, '9:f5ef33957a2a3ecb1ea5de1edac4fc34', 'createTable tableName=invoice_sub_totals', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-8022_20220624_tbl::HatimOUDAD
CREATE TABLE open_order_article (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), active INTEGER, accounting_article_id BIGINT NOT NULL, open_order_template_id BIGINT NOT NULL, CONSTRAINT pk_open_order_article_plan PRIMARY KEY (id));

CREATE TABLE open_order_product (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), active INTEGER, product_id BIGINT NOT NULL, open_order_template_id BIGINT NOT NULL, CONSTRAINT pk_open_order_product_plan PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-8022_20220624_tbl', 'HatimOUDAD', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 777, '9:16c772ffe477f3b1ef49e91baf69d065', 'createTable tableName=open_order_article; createTable tableName=open_order_product', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-8219_20220627_tbl::HatimOUDAD
CREATE TABLE open_order_quote_tags (open_order_quote_id BIGINT NOT NULL, tag_id BIGINT NOT NULL);

CREATE TABLE open_order_quote_products (open_order_quote_id BIGINT NOT NULL, open_product_id BIGINT NOT NULL);

CREATE TABLE open_order_quote_articles (open_order_quote_id BIGINT NOT NULL, open_article_id BIGINT NOT NULL);

ALTER TABLE open_order_quote_tags ADD CONSTRAINT open_order_quote_tags_pkey PRIMARY KEY (open_order_quote_id, tag_id);

ALTER TABLE open_order_quote_products ADD CONSTRAINT open_order_quote_products_pkey PRIMARY KEY (open_order_quote_id, open_product_id);

ALTER TABLE open_order_quote_articles ADD CONSTRAINT open_order_quote_articles_pkey PRIMARY KEY (open_order_quote_id, open_article_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-8219_20220627_tbl', 'HatimOUDAD', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 779, '9:9e6419783e34d4ad93dc30220cb08575', 'createTable tableName=open_order_quote_tags; createTable tableName=open_order_quote_products; createTable tableName=open_order_quote_articles; addPrimaryKey constraintName=open_order_quote_tags_pkey, tableName=open_order_quote_tags; addPrimaryKey ...', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-8117_20220629_rebuild_tbl::ZBariki
CREATE TABLE open_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_reference VARCHAR(255), type VARCHAR(50) NOT NULL, status VARCHAR(25) NOT NULL, open_order_template_id BIGINT NOT NULL, open_order_number VARCHAR(255) NOT NULL, billing_account_id BIGINT NOT NULL, initial_amount numeric(23, 12) NOT NULL, currency_id BIGINT NOT NULL, open_order_quote_id BIGINT, end_of_validity_date TIMESTAMP WITHOUT TIME ZONE, activation_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, balance numeric(23, 12) NOT NULL, cancel_reason VARCHAR(4000), CONSTRAINT pk_open_order PRIMARY KEY (id), CONSTRAINT open_order_code_unique UNIQUE (code));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-8117_20220629_rebuild_tbl', 'ZBariki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 781, '9:3cb2212af5930d040e474538b0305c7a', 'createTable tableName=open_order', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-9451_20220902_rebuild::KhalidHORRI
CREATE TABLE open_order_tags (open_order_id BIGINT NOT NULL, tag_id BIGINT NOT NULL);

ALTER TABLE open_order_tags ADD CONSTRAINT open_order_tags_pkey PRIMARY KEY (open_order_id, tag_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-9451_20220902_rebuild', 'KhalidHORRI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 783, '9:5f6852f03246bd43388211ac8d4fa07f', 'createTable tableName=open_order_tags; addPrimaryKey constraintName=open_order_tags_pkey, tableName=open_order_tags', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-10683_20221107_rebuild::AdilElJaouhari
CREATE TABLE meveo_script_parameter (id BIGINT NOT NULL, version INTEGER, code VARCHAR(255) NOT NULL, script_instance_id BIGINT NOT NULL, description_i18n JSONB, class_name VARCHAR(255) DEFAULT 'java.lang.String' NOT NULL, default_value VARCHAR(255), mandatory INTEGER DEFAULT 0 NOT NULL, allowed_values VARCHAR(255), values_separator VARCHAR(20) DEFAULT '|' NOT NULL, collection INTEGER DEFAULT 0 NOT NULL, filters JSONB, CONSTRAINT pk_meveo_script_parameter PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-10683_20221107_rebuild', 'AdilElJaouhari', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 785, '9:0e6c30230d87fee643f41a21fb895077', 'createTable tableName=meveo_script_parameter', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::INTRD-17487_20230719_build::TarikFA.
CREATE TABLE contract_item_articles (contract_item_id BIGINT NOT NULL, accounting_article_id BIGINT NOT NULL);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-17487_20230719_build', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 787, '9:294f1c668090ce9d9e737fa901b5680e', 'createTable tableName=contract_item_articles', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-18792_advanced_settings-rebuild::Mohammed_ElAzzouzi
CREATE TABLE advanced_settings (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), origin VARCHAR(100), category VARCHAR(100), property_group VARCHAR(100), property_value VARCHAR(255), property_type VARCHAR(255), description_i18n JSONB, long_description_i18n JSONB, CONSTRAINT advanced_settings_pk PRIMARY KEY (id), CONSTRAINT unique_advanced_settings_code UNIQUE (code));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-18792_advanced_settings-rebuild', 'Mohammed_ElAzzouzi', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 789, '9:dbb57c6bad1d2b7f208d5227edb4e7d5', 'createTable tableName=advanced_settings', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-16031_20230508_rebuild::zelmeliani
CREATE TABLE cat_price_list (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(50) NOT NULL, description VARCHAR(300), cf_values JSONB, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), valid_from TIMESTAMP WITHOUT TIME ZONE, valid_until TIMESTAMP WITHOUT TIME ZONE, application_start_date TIMESTAMP WITHOUT TIME ZONE, application_end_date TIMESTAMP WITHOUT TIME ZONE, status VARCHAR(50), CONSTRAINT price_list_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-16031_20230508_rebuild', 'zelmeliani', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 791, '9:f93dd7dd03df8a356af165395814be9b', 'createTable tableName=cat_price_list', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-16039_20230512-rebuild::a.rouaguebe
CREATE TABLE cat_price_list_line (id BIGINT NOT NULL, uuid VARCHAR(60) DEFAULT uuid_generate_v4(), 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(50) NOT NULL, description VARCHAR(300), cf_values JSONB, price_list_id BIGINT, offer_category_id BIGINT, offer_template_id BIGINT, product_id BIGINT, product_line_id BIGINT, charge_template_id BIGINT, price_plan_id BIGINT, price_list_type VARCHAR(25), application_el VARCHAR(255), rate numeric(23, 12), amount numeric(23, 12), CONSTRAINT cat_price_list_line_pk PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-16039_20230512-rebuild', 'a.rouaguebe', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 793, '9:07e39c664b3fc839cf8098c5a6d0d87b', 'createTable tableName=cat_price_list_line', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-16036_20230516-rebuild::zelmeliani
CREATE TABLE cat_price_list_customer_brand (price_list_id BIGINT, customer_brand_id BIGINT);

ALTER TABLE cat_price_list_customer_brand ADD CONSTRAINT cat_price_list_customer_brand_pkey PRIMARY KEY (price_list_id, customer_brand_id);

CREATE TABLE cat_price_list_customer_category (price_list_id BIGINT, customer_category_id BIGINT);

ALTER TABLE cat_price_list_customer_category ADD CONSTRAINT cat_price_list_customer_category_pkey PRIMARY KEY (price_list_id, customer_category_id);

CREATE TABLE cat_price_list_credit_category (price_list_id BIGINT, credit_category_id BIGINT);

ALTER TABLE cat_price_list_credit_category ADD CONSTRAINT cat_price_list_credit_category_pkey PRIMARY KEY (price_list_id, credit_category_id);

CREATE TABLE cat_price_list_country (price_list_id BIGINT, country_id BIGINT);

ALTER TABLE cat_price_list_country ADD CONSTRAINT cat_price_list_country_pkey PRIMARY KEY (price_list_id, country_id);

CREATE TABLE cat_price_list_currency (price_list_id BIGINT, currency_id BIGINT);

ALTER TABLE cat_price_list_currency ADD CONSTRAINT cat_price_list_currency_pkey PRIMARY KEY (price_list_id, currency_id);

CREATE TABLE cat_price_list_legal_entity (price_list_id BIGINT, legal_entity_id BIGINT);

ALTER TABLE cat_price_list_legal_entity ADD CONSTRAINT cat_price_list_legal_entity_pkey PRIMARY KEY (price_list_id, legal_entity_id);

CREATE TABLE cat_price_list_payment_method (price_list_id BIGINT, payment_method VARCHAR(50));

CREATE TABLE cat_price_list_seller (price_list_id BIGINT, seller_id BIGINT);

ALTER TABLE cat_price_list_seller ADD CONSTRAINT cat_price_list_seller_pkey PRIMARY KEY (price_list_id, seller_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-16036_20230516-rebuild', 'zelmeliani', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 795, '9:c83824364f8b71dd12cf481033a085e6', 'createTable tableName=cat_price_list_customer_brand; addPrimaryKey constraintName=cat_price_list_customer_brand_pkey, tableName=cat_price_list_customer_brand; createTable tableName=cat_price_list_customer_category; addPrimaryKey constraintName=cat...', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-15849_20230509-rebuild::TarikFA.
CREATE TABLE billing_seller_media (seller_id BIGINT, media_id BIGINT);

ALTER TABLE billing_seller_media ADD CONSTRAINT seller_id_media_id_unique_key UNIQUE (seller_id, media_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-15849_20230509-rebuild', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 797, '9:0c427e6e74c955e3ac1b802e975f86c8', 'createTable tableName=billing_seller_media; addUniqueConstraint constraintName=seller_id_media_id_unique_key, tableName=billing_seller_media', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-16361_20230606_rebuild::a.rouaguebe
CREATE TABLE cat_price_plan_charge (price_plan_id BIGINT, charge_id BIGINT);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-16361_20230606_rebuild', 'a.rouaguebe', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 799, '9:adb83533a838d2eb09e02a971ca63620', 'createTable tableName=cat_price_plan_charge', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-8753_20220727_001-rebuild::anas.rouaguebe
CREATE TABLE billing_redirection_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), contract_id BIGINT, priority INTEGER NOT NULL, criteria_el VARCHAR(2000) NOT NULL, invoice_ba_code_el VARCHAR(2000) NOT NULL, CONSTRAINT billing_rule_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-8753_20220727_001-rebuild', 'anas.rouaguebe', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 801, '9:4c4ac6fafb670f2e594f8f367a2c9ceb', 'createTable tableName=billing_redirection_rule', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-17632_2023_08_09_rebuild::zbariki
CREATE TABLE billing_offer_amount (id BIGINT NOT NULL, version INTEGER, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, offer_id BIGINT, amount numeric(23, 12), billing_run_report_id BIGINT, rated_transaction_count numeric(23, 12), CONSTRAINT billing_offer_amount_pkey PRIMARY KEY (id));

CREATE TABLE billing_account_amount (id BIGINT NOT NULL, version INTEGER, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, billing_account_id BIGINT, amount numeric(23, 12), billing_run_report_id BIGINT, rated_transaction_count numeric(23, 12), CONSTRAINT billing_account_amount_pkey PRIMARY KEY (id));

CREATE TABLE billing_run_report (id BIGINT NOT NULL, version INTEGER, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, billing_run_id BIGINT NOT NULL, type VARCHAR(50) NOT NULL, creation_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, billing_accounts_count numeric(23, 12) NOT NULL, subscriptions_count numeric(23, 12) NOT NULL, rated_transactions_count numeric(23, 12) NOT NULL, total_amount_without_tax numeric(23, 12) NOT NULL, one_shot_transactions_count numeric(23, 12) NOT NULL, recurring_transactions_count numeric(23, 12) NOT NULL, usage_transactions_count numeric(23, 12) NOT NULL, one_shot_total_amount_without_tax numeric(23, 12) NOT NULL, recurring_total_amount_without_tax numeric(23, 12) NOT NULL, usage_total_amount_without_tax numeric(23, 12) NOT NULL, report_final INTEGER DEFAULT 0, CONSTRAINT billing_run_report_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-17632_2023_08_09_rebuild', 'zbariki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 803, '9:1e9d03ff265b5492d307d20b145d0880', 'createTable tableName=billing_offer_amount; createTable tableName=billing_account_amount; createTable tableName=billing_run_report', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::audit_data_log_rebuild_tbl::AndriusKarpavicius
CREATE TABLE audit_data_log_rec (id BIGINT NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, tx_id BIGINT NOT NULL, ref_table VARCHAR(60) NOT NULL, ref_id BIGINT, action VARCHAR(6) NOT NULL, origin VARCHAR(15) NOT NULL, origin_name VARCHAR(250), user_name VARCHAR(100), data_old JSONB, data_new JSONB, CONSTRAINT audit_data_log_rec_pkey PRIMARY KEY (id));

CREATE TABLE audit_data_log (id BIGINT NOT NULL, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, entity_class VARCHAR(255) NOT NULL, entity_id BIGINT NOT NULL, tx_id BIGINT NOT NULL, action VARCHAR(6) NOT NULL, origin VARCHAR(15) NOT NULL, origin_name VARCHAR(250), user_name VARCHAR(100), data_old JSONB, data_new JSONB, CONSTRAINT audit_data_log_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('audit_data_log_rebuild_tbl', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 805, '9:ac80693bb5b711c86245f820bb78966d', 'createTable tableName=audit_data_log_rec; createTable tableName=audit_data_log', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::audit_data_config_rebuild_tbl::AndriusKarpavicius
CREATE TABLE audit_data_config (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), entity_class VARCHAR(255) NOT NULL, entity_fields VARCHAR(2000), actions VARCHAR(2000), CONSTRAINT audit_data_config_pkey PRIMARY KEY (id));

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

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-19322_add_aggre_fields_rebuild::anas.rouaguebe
CREATE TABLE billing_cycle_aggregation_fields (billing_cycle_id BIGINT, fields VARCHAR(255));

CREATE TABLE billing_run_aggregation_fields (billing_run_id BIGINT, fields VARCHAR(255));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-19322_add_aggre_fields_rebuild', 'anas.rouaguebe', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 809, '9:b7ebb005752de0a40ef52d39388922c5', 'createTable tableName=billing_cycle_aggregation_fields; createTable tableName=billing_run_aggregation_fields', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-17696_2023_09_11_rebuild_tbl::zbariki
CREATE TABLE product_amount (id BIGINT NOT NULL, version INTEGER, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, product_id BIGINT, amount numeric(23, 12), billing_run_report_id BIGINT, rated_transaction_count numeric(23, 12), CONSTRAINT product_amount_pkey PRIMARY KEY (id));

CREATE TABLE subscription_amount (id BIGINT NOT NULL, version INTEGER, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, amount numeric(23, 12), subscription_id BIGINT, billing_run_report_id BIGINT, rated_transaction_count numeric(23, 12), CONSTRAINT subscription_amount_pkey PRIMARY KEY (id));

CREATE TABLE accounting_article_amount (id BIGINT NOT NULL, version INTEGER, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, amount numeric(23, 12), accounting_article_id BIGINT, billing_run_report_id BIGINT, rated_transaction_count numeric(23, 12), CONSTRAINT accounting_article_amount_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-17696_2023_09_11_rebuild_tbl', 'zbariki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 811, '9:7613d7b16e11640496193e7a86419660', 'createTable tableName=product_amount; createTable tableName=subscription_amount; createTable tableName=accounting_article_amount', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-18393_20230920_rebuild::TarikFA.
CREATE TABLE pdp_status_history (id BIGINT NOT NULL, version INTEGER, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, pdp_status VARCHAR(30) NOT NULL, event_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, origin VARCHAR(100) NOT NULL, CONSTRAINT pdp_status_pkey PRIMARY KEY (id));

CREATE TABLE pdp_status (id BIGINT NOT NULL, version INTEGER, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, transmitted_format VARCHAR(15) NOT NULL, origin VARCHAR(50) NOT NULL, return_code INTEGER, label VARCHAR(255), invoice_identifier VARCHAR(50), invoice_number VARCHAR(50), invoice_id BIGINT, status VARCHAR(30), deposit_date TIMESTAMP WITHOUT TIME ZONE, CONSTRAINT pdp_status_history_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-18393_20230920_rebuild', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 813, '9:52341b2b326fc163d80002a5d7ce545a', 'createTable tableName=pdp_status_history; createTable tableName=pdp_status', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-9066_20231009-rebuild::AbdellatifBARI
CREATE TABLE batch_entity (id BIGINT NOT NULL, version INTEGER DEFAULT 0, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, target_job VARCHAR(255), target_entity VARCHAR(255), filters JSONB, notify INTEGER DEFAULT 0, status VARCHAR(25), job_instance_id BIGINT, job_execution_id BIGINT, code VARCHAR(255), description VARCHAR(255), disabled INTEGER DEFAULT 0 NOT NULL, CONSTRAINT batch_entity_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-9066_20231009-rebuild', 'AbdellatifBARI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 815, '9:40ccda1e333619a5b0a84692628a7a02', 'createTable tableName=batch_entity', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-7399_20220603-rebuild-joined-table-created-aos::aelmalki
CREATE TABLE ar_payment_plan_created_aos (payment_plan_id BIGINT, account_operation_id BIGINT);

ALTER TABLE ar_payment_plan_created_aos ADD CONSTRAINT ar_payment_plan_created_aos_pkey PRIMARY KEY (payment_plan_id, account_operation_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-7399_20220603-rebuild-joined-table-created-aos', 'aelmalki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 817, '9:81ac601340637857d643c3cddbe726a9', 'createTable tableName=ar_payment_plan_created_aos; addPrimaryKey constraintName=ar_payment_plan_created_aos_pkey, tableName=ar_payment_plan_created_aos', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-7399_20220603-rebuild-joined-table-targeted-aos::aelmalki
CREATE TABLE ar_payment_plan_targeted_aos (payment_plan_id BIGINT, account_operation_id BIGINT);

ALTER TABLE ar_payment_plan_targeted_aos ADD CONSTRAINT ar_payment_plan_targeted_aos_pkey PRIMARY KEY (payment_plan_id, account_operation_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-7399_20220603-rebuild-joined-table-targeted-aos', 'aelmalki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 819, '9:646b6e17c39a747146fa9dd4aa537fbd', 'createTable tableName=ar_payment_plan_targeted_aos; addPrimaryKey constraintName=ar_payment_plan_targeted_aos_pkey, tableName=ar_payment_plan_targeted_aos', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-5881_20220322-rebuild::aelmalki
CREATE TABLE accounting_journal_entry (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), accounting_operation_id BIGINT NOT NULL, accounting_code_id BIGINT NOT NULL, seller_id BIGINT, customer_account_id BIGINT, tax_id BIGINT, direction VARCHAR(10) NOT NULL, amount numeric(23, 12) NOT NULL, analytic_code_1 VARCHAR(255), analytic_code_2 VARCHAR(255), analytic_code_3 VARCHAR(255), operation_number BIGINT, seller_code VARCHAR(255) NOT NULL, client_unique_id VARCHAR(100), currency VARCHAR(3) NOT NULL, supporting_document_ref BIGINT, supporting_document_type VARCHAR(255), transactional_amount numeric(23, 12), trading_currency VARCHAR(3), auxiliary_account_code VARCHAR(255), auxiliary_account_label VARCHAR(255), journal_code VARCHAR(50), category VARCHAR(50), account VARCHAR(50), label VARCHAR(255), customer_code VARCHAR(50), customer_name VARCHAR(255), seller_name VARCHAR(255), reference VARCHAR(50), document_type VARCHAR(50), matching_code VARCHAR(255), CONSTRAINT pk_accounting_journal_entry PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-5881_20220322-rebuild', 'aelmalki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 821, '9:ecfe261383c39e50abb882299c39bb39', 'createTable tableName=accounting_journal_entry', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-6562_20220414-rebuild::aelmalki
CREATE TABLE accounting_accountingcode_mapping (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), accounting_article_id BIGINT, billing_country_id BIGINT, billing_currency_id BIGINT, seller_country_id BIGINT, seller_id BIGINT, criteria_el_value VARCHAR(500), accounting_code_id BIGINT, CONSTRAINT pk_accounting_accountingcode_mapping PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-6562_20220414-rebuild', 'aelmalki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 823, '9:53cd8f4c0faf7188e2a0c529b5014d74', 'createTable tableName=accounting_accountingcode_mapping', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-7399_20220603-rebuild::aelmalki
CREATE TABLE ar_payment_plan (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), amount_to_recover numeric(23, 12) NOT NULL, amount_per_installment numeric(23, 12) NOT NULL, remaining_amount numeric(23, 12), action_on_remaining_amount VARCHAR(255) NOT NULL, number_of_installments INTEGER NOT NULL, start_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, end_date TIMESTAMP WITHOUT TIME ZONE NOT NULL, recurring_unit VARCHAR(255) NOT NULL, status VARCHAR(255) NOT NULL, customer_account_id BIGINT NOT NULL, CONSTRAINT pk_ar_payment_plan PRIMARY KEY (id), CONSTRAINT ar_payment_plan_code_unique UNIQUE (code));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-7399_20220603-rebuild', 'aelmalki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 825, '9:42848f51c5e19ec0db11bab10688a90d', 'createTable tableName=ar_payment_plan', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-8158_20220624_rebuild::TarikFA.
CREATE TABLE mediation_setting (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), enable_edr_versioning INTEGER DEFAULT 0, CONSTRAINT pk_mediation_setting PRIMARY KEY (id));

CREATE TABLE edr_versioning_rule (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), priority INTEGER NOT NULL, criterial_el VARCHAR(2000) NOT NULL, key_el VARCHAR(2000) NOT NULL, is_new_version_el VARCHAR(2000) NOT NULL, mediation_setting_id BIGINT NOT NULL, CONSTRAINT pk_edr_versioning_rule PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-8158_20220624_rebuild', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 827, '9:28b951b01d3dd52a366b86aad4892097', 'createTable tableName=mediation_setting; createTable tableName=edr_versioning_rule', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-8701_20220801_rebuild::ZBariki
CREATE TABLE billing_tax_composition (main_tax_id BIGINT NOT NULL, sub_tax_id BIGINT NOT NULL);

ALTER TABLE billing_tax_composition ADD CONSTRAINT billing_tax_composition_pkey PRIMARY KEY (main_tax_id, sub_tax_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-8701_20220801_rebuild', 'ZBariki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 829, '9:38adc898550fa100e727870f14936363', 'createTable tableName=billing_tax_composition; addPrimaryKey constraintName=billing_tax_composition_pkey, tableName=billing_tax_composition', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-8777_20220728-rebuild::aelmalki
CREATE TABLE billing_run_job_execution (billing_run_id BIGINT NOT NULL, job_execution_id BIGINT NOT NULL);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-8777_20220728-rebuild', 'aelmalki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 831, '9:48d1f7213b3d2a2e87f4e1f0ffd3773e', 'createTable tableName=billing_run_job_execution', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-9117_20220811-init-table::aelmalki
CREATE TABLE open_order_products (open_order_id BIGINT NOT NULL, open_product_id BIGINT NOT NULL);

ALTER TABLE open_order_products ADD CONSTRAINT open_order_products_pkey PRIMARY KEY (open_order_id, open_product_id);

CREATE TABLE open_order_articles (open_order_id BIGINT NOT NULL, open_article_id BIGINT NOT NULL);

ALTER TABLE open_order_articles ADD CONSTRAINT open_order_articles_pkey PRIMARY KEY (open_order_id, open_article_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-9117_20220811-init-table', 'aelmalki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 833, '9:d694ca8b78321935e3f848d65a1e21e6', 'createTable tableName=open_order_products; addPrimaryKey constraintName=open_order_products_pkey, tableName=open_order_products; createTable tableName=open_order_articles; addPrimaryKey constraintName=open_order_articles_pkey, tableName=open_order...', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-9598-20220909-contact-category-rebuild::a.rouaguebe
CREATE TABLE com_contact_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), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, cf_values JSONB, CONSTRAINT com_contact_category_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-9598-20220909-contact-category-rebuild', 'a.rouaguebe', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 835, '9:fd184aebc3eba6aa1dc76863f6fab71e', 'createTable tableName=com_contact_category', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-9854-20220915-contact-category-many-to-many-rebuild::a.rouaguebe
CREATE TABLE com_contact_category_contact (contact_id BIGINT NOT NULL, contact_category_id BIGINT NOT NULL);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-9854-20220915-contact-category-many-to-many-rebuild', 'a.rouaguebe', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 837, '9:5d470e59f79ee7b5f88da618243b84bf', 'createTable tableName=com_contact_category_contact', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-10541_20221013_build::TarikFA.
CREATE TABLE billing_linked_invoices (id BIGINT NOT NULL, linked_invoice_id BIGINT NOT NULL, amount numeric(23, 12), type VARCHAR(50), transactional_amount numeric(23, 12));

ALTER TABLE billing_linked_invoices ADD CONSTRAINT billing_linked_invoices_pkey PRIMARY KEY (id, linked_invoice_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-10541_20221013_build', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 839, '9:5edb1977f2e10c001a441cf305eca783', 'createTable tableName=billing_linked_invoices; addPrimaryKey constraintName=billing_linked_invoices_pkey, tableName=billing_linked_invoices', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-10768-20221108-validationrule-rebuild::a.rouaguebe
CREATE TABLE billing_invoice_validation_rule (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), code VARCHAR(255) NOT NULL, description VARCHAR(255), invoice_type_id BIGINT NOT NULL, priority INTEGER, valid_from TIMESTAMP WITHOUT TIME ZONE, valid_to TIMESTAMP WITHOUT TIME ZONE, type VARCHAR(50) NOT NULL, fail_status VARCHAR(50), script_instance_id BIGINT, validation_el TEXT, rule_values JSONB, evaluation_mode VARCHAR(50) DEFAULT 'VALIDATION' NOT NULL, operator VARCHAR(10) DEFAULT 'OR', parent_id BIGINT, CONSTRAINT billing_invoice_validation_rule_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-10768-20221108-validationrule-rebuild', 'a.rouaguebe', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 841, '9:cb61ff2325c21c7d4d0f328810de4dc1', 'createTable tableName=billing_invoice_validation_rule', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-12677_20221229_rebuild::AdilElJaouhari
CREATE TABLE crm_provider_order_line_type (provider_id BIGINT, order_line_type VARCHAR(20));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-12677_20221229_rebuild', 'AdilElJaouhari', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 843, '9:635981a50c0f0f6562f416ebb3183a38', 'createTable tableName=crm_provider_order_line_type', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-10544_20221207-rebuild::HatimOUDAD
CREATE TABLE iso_icd (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, scheme_name VARCHAR(500) NOT NULL, CONSTRAINT pk_iso_icd PRIMARY KEY (id), CONSTRAINT iso_icd_unique UNIQUE (code));

CREATE TABLE untdid_1001_invoice_code_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, en16931_interpretation VARCHAR(20) NOT NULL, name VARCHAR(500), CONSTRAINT pk_1001_invoice_type PRIMARY KEY (id), CONSTRAINT iso_1001_code_type_unique UNIQUE (code));

CREATE TABLE untdid_2475_vat_payment_option (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_2005 VARCHAR(10) NOT NULL, value_2005 VARCHAR(500) NOT NULL, code_2475 VARCHAR(10) NOT NULL, value_2475 VARCHAR(500) NOT NULL, CONSTRAINT pk_2475_vat_payment PRIMARY KEY (id));

CREATE TABLE untdid_4451_invoice_subject_code (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, code_name VARCHAR(500) NOT NULL, CONSTRAINT pk_4451_invoice_subject PRIMARY KEY (id), CONSTRAINT iso_4451_subject_code_unique UNIQUE (code));

CREATE TABLE untdid_5305_taxation_category (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, semantic_model VARCHAR(500) NOT NULL, name VARCHAR(500) NOT NULL, CONSTRAINT pk_5305_taxation_category PRIMARY KEY (id), CONSTRAINT iso_5305_taxation_category_unique UNIQUE (code));

CREATE TABLE untdid_vatex (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, remark VARCHAR(500), code_name VARCHAR(500) NOT NULL, CONSTRAINT pk_untdid_vatex PRIMARY KEY (id), CONSTRAINT untdid_vatex_unique UNIQUE (code));

CREATE TABLE untdid_4461_payment_means (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, usage_in_en16931 VARCHAR(500), code_name VARCHAR(500) NOT NULL, CONSTRAINT pk_4461_payment_means PRIMARY KEY (id), CONSTRAINT untdid_4461_payment_unique UNIQUE (code));

CREATE TABLE untdid_5189_allowance_code (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(10) NOT NULL, description VARCHAR(500) NOT NULL, CONSTRAINT pk_5189_allowance_code PRIMARY KEY (id), CONSTRAINT untdid_5189_allowance_code_unique UNIQUE (code));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-10544_20221207-rebuild', 'HatimOUDAD', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 845, '9:e47c9ba2e85618d4715175c7f182955a', 'createTable tableName=iso_icd; createTable tableName=untdid_1001_invoice_code_type; createTable tableName=untdid_2475_vat_payment_option; createTable tableName=untdid_4451_invoice_subject_code; createTable tableName=untdid_5305_taxation_category; ...', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-12609_20221227_converted_ppv-rebuild::a.rouaguebe
CREATE TABLE cpq_trading_price_plan_version (id BIGINT NOT NULL, version INTEGER, creator VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, updater VARCHAR(100), price_plan_matrix_version_id BIGINT, trading_price numeric(23, 12), trading_currency_id BIGINT NOT NULL, rate numeric(23, 12), use_for_billing_accounts INTEGER, trading_price_el VARCHAR(2000), CONSTRAINT cpq_trading_price_plan_version_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-12609_20221227_converted_ppv-rebuild', 'a.rouaguebe', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 847, '9:46236d35534aa83954cda3f0338da2bd', 'createTable tableName=cpq_trading_price_plan_version', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-13062-20230124-rebuild::ZBariki
CREATE TABLE ar_customer_balance (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), description VARCHAR(255), default_balance INTEGER DEFAULT 0, balance_el VARCHAR(2000), CONSTRAINT customer_balance_pkey PRIMARY KEY (id));

CREATE TABLE ar_customer_balance_templates (customer_balance_id BIGINT NOT NULL, template_id BIGINT NOT NULL);

ALTER TABLE ar_customer_balance_templates ADD CONSTRAINT ar_templates_customer_balance_pkey PRIMARY KEY (customer_balance_id, template_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-13062-20230124-rebuild', 'ZBariki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 849, '9:db2fa2fe569270069090fc24825e95ad', 'createTable tableName=ar_customer_balance; createTable tableName=ar_customer_balance_templates; addPrimaryKey constraintName=ar_templates_customer_balance_pkey, tableName=ar_customer_balance_templates', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::INTRD_20240220-rebuild::ME
CREATE TABLE billing_invoices_subscriptions (invoice_id BIGINT NOT NULL, subscription_id BIGINT);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD_20240220-rebuild', 'ME', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 851, '9:4c325b3415f6c9ce8af16b6d5a99ccee', 'createTable tableName=billing_invoices_subscriptions', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#rebuild-INTRD-15664-20230501::aelmalki
CREATE TABLE ar_unmatching_code (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, unmatching_amount_credit numeric(23, 12), unmatching_amount_debit numeric(23, 12), transactional_unmatching_amount_credit numeric(23, 12), transactional_unmatching_amount_debit numeric(23, 12), unmatching_date date, creator VARCHAR(100), updater VARCHAR(100), CONSTRAINT ar_unmatching_code_pkey PRIMARY KEY (id));

CREATE TABLE ar_unmatching_amount (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, unmatching_amount numeric(23, 12), transactional_unmatching_amount numeric(23, 12), creator VARCHAR(100), updater VARCHAR(100), account_operation_id BIGINT, unmatching_code_id BIGINT, CONSTRAINT ar_unmatching_amount_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#rebuild-INTRD-15664-20230501', 'aelmalki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 853, '9:408a36423174707a6917b32678992d67', 'createTable tableName=ar_unmatching_code; createTable tableName=ar_unmatching_amount', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-15823_20230510-rebuild::AdilElJaouhari
CREATE TABLE cat_trading_discount_plan_item (id BIGINT NOT NULL, version INTEGER, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, discount_plan_item_id BIGINT, trading_discount_value numeric(23, 12), trading_currency_id BIGINT NOT NULL, rate numeric(23, 12), CONSTRAINT cat_trading_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 ('#INTRD-15823_20230510-rebuild', 'AdilElJaouhari', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 855, '9:b34817bc40c2daf8a19dd00e2c78b79c', 'createTable tableName=cat_trading_discount_plan_item', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-16600_20230531-rebuild::AdilElJaouhari
CREATE TABLE cpq_trading_contract_item (id BIGINT NOT NULL, version INTEGER, creator VARCHAR(100), updater VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, contract_item_id BIGINT, trading_value numeric(23, 12), trading_currency_id BIGINT NOT NULL, rate numeric(23, 12), CONSTRAINT cpq_trading_contract_item_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-16600_20230531-rebuild', 'AdilElJaouhari', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 857, '9:2970b41be84d0ab79c59f1a18dd31401', 'createTable tableName=cpq_trading_contract_item', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-19124_wo_partitioning_fct-tbl-rebuild::a.rouaguebe
CREATE TABLE tech_wo_partition_log (id BIGINT DEFAULT nextval('tech_wo_partition_log_seq') NOT NULL, partition_name VARCHAR(255) NOT NULL, range_from TIMESTAMP WITHOUT TIME ZONE, range_to TIMESTAMP WITHOUT TIME ZONE, purge_date TIMESTAMP WITHOUT TIME ZONE);

CREATE TABLE tech_rt_partition_log (id BIGINT DEFAULT nextval('tech_rt_partition_log_seq') NOT NULL, partition_name VARCHAR(255) NOT NULL, range_from TIMESTAMP WITHOUT TIME ZONE, range_to TIMESTAMP WITHOUT TIME ZONE, purge_date TIMESTAMP WITHOUT TIME ZONE, CONSTRAINT tech_rt_partition_log_pk PRIMARY KEY (id));

CREATE TABLE tech_edr_partition_log (id BIGINT DEFAULT nextval('tech_edr_partition_log_seq') NOT NULL, partition_name VARCHAR(255) NOT NULL, range_from TIMESTAMP WITHOUT TIME ZONE, range_to TIMESTAMP WITHOUT TIME ZONE, purge_date TIMESTAMP WITHOUT TIME ZONE, CONSTRAINT tech_wedrpartition_log_pk PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-19124_wo_partitioning_fct-tbl-rebuild', 'a.rouaguebe', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 859, '9:5f92b86d0b134502322bbe8734f53e09', 'createTable tableName=tech_wo_partition_log; createTable tableName=tech_rt_partition_log; createTable tableName=tech_edr_partition_log', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::crm_address_book_contact-table-creation::abdelkader.bouazza
CREATE TABLE crm_address_book_contact (id BIGINT NOT NULL, version INTEGER, address_book_id BIGINT, contact_id BIGINT, position VARCHAR(30), main_contact INTEGER DEFAULT 0, CONSTRAINT crm_address_book_contact_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('crm_address_book_contact-table-creation', 'abdelkader.bouazza', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 861, '9:fa608471420f146d824b7356cd69d35a', 'createTable tableName=crm_address_book_contact', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-12614_20221227_BUILD_TABLE::TarikFA.
CREATE TABLE cpq_trading_price_plan_matrix_line (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), trading_value numeric(23, 12), trading_currency_id BIGINT, rate numeric(23, 12), use_for_billing_accounts INTEGER, price_plan_matrix_line_id BIGINT, CONSTRAINT pk_trading_plan_matrix_line PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-12614_20221227_BUILD_TABLE', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 863, '9:92fc291d697c9d99f26d267141594bc2', 'createTable tableName=cpq_trading_price_plan_matrix_line', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-14904_20230915_build::TarikFA.
CREATE TABLE electronic_invoice_settings (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), force_xml_generation INTEGER DEFAULT 0, force_pdf_generation INTEGER DEFAULT 0, force_ubl_generation INTEGER DEFAULT 0, invoicing_job VARCHAR(50), xml_generation_job VARCHAR(50), pdf_generation_job VARCHAR(50), ubl_generation_job VARCHAR(50), vat_date_code INTEGER DEFAULT 432, customization_id VARCHAR(200) DEFAULT 'urn:cen.eu:en16931:2017', CONSTRAINT pk_electr_invoice_settings PRIMARY KEY (id));

CREATE TABLE pdp_status_and_history (pdpstatus_id BIGINT, history_id BIGINT);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-14904_20230915_build', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 865, '9:bd78219c3bcf1a05bfdb925dfb36e096', 'createTable tableName=electronic_invoice_settings; createTable tableName=pdp_status_and_history', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#rebuild-INTRD-16445_20230619::aelmalki
CREATE TABLE crm_provider_manual_refund_methods (provider_id BIGINT, payment_method VARCHAR(255));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#rebuild-INTRD-16445_20230619', 'aelmalki', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 867, '9:a252261ec17bcb032fb79d9162739d49', 'createTable tableName=crm_provider_manual_refund_methods', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::INTRD-20050_20231226_tbl-build::TarikFA.
CREATE TABLE account_registration_number (id BIGINT NOT NULL, version INTEGER, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), registration_no VARCHAR(100), icd_id BIGINT, seller_id BIGINT, billing_account_id BIGINT, user_account_id BIGINT, customer_account_id BIGINT, customer_id BIGINT, CONSTRAINT account_registration_number_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-20050_20231226_tbl-build', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 869, '9:c4c4f7cce8813ce5565f310d78d44f6a', 'createTable tableName=account_registration_number', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-INTRD-19605_2023_12_25::ZBARIKI
CREATE TABLE ar_payment_rejection_code (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), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, creator VARCHAR(100), updater VARCHAR(100), cf_values JSONB, payment_gateway_id BIGINT, description_i18n JSONB, payment_rejection_codes_group_id BIGINT);

ALTER TABLE ar_payment_rejection_code ADD CONSTRAINT ar_payment_rejection_code_pkey PRIMARY KEY (code, payment_gateway_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-INTRD-19605_2023_12_25', 'ZBARIKI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 871, '9:d241eb19fca5c2d3212ce48bb5c94bb7', 'createTable tableName=ar_payment_rejection_code; addPrimaryKey constraintName=ar_payment_rejection_code_pkey, tableName=ar_payment_rejection_code', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::rebuild-str-INTRD-19826_20240103::ZBARIKI
CREATE TABLE ar_payment_rejection_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, code VARCHAR(255) NOT NULL, description VARCHAR(255), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, creator VARCHAR(100), updater VARCHAR(100), cf_values JSONB, sequence INTEGER, script_instance_id BIGINT, payment_rejection_codes_group_id BIGINT, script_parameters JSONB, CONSTRAINT ar_payment_rejection_action_pk PRIMARY KEY (id));

CREATE TABLE ar_payment_rejection_codes_group (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), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, creator VARCHAR(100), updater VARCHAR(100), cf_values JSONB, payment_gateway_id BIGINT, CONSTRAINT ar_payment_rejection_codes_group_pk PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-str-INTRD-19826_20240103', 'ZBARIKI', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 873, '9:9b4f79c18537bf9ee1e6e47028dd1d36', 'createTable tableName=ar_payment_rejection_action; createTable tableName=ar_payment_rejection_codes_group', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::INTRD-20888_20240125-rebuild::AdilElJaouhari
CREATE TABLE ar_payment_rejection_action_report (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), uuid VARCHAR(60) DEFAULT uuid_generate_v4() NOT NULL, creator VARCHAR(100), updater VARCHAR(100), cf_values JSONB, rejected_payment_id BIGINT, payment_rejection_action_id BIGINT, status VARCHAR(30), report TEXT, start_date TIMESTAMP WITHOUT TIME ZONE, end_date TIMESTAMP WITHOUT TIME ZONE, action_script_id BIGINT, CONSTRAINT ar_payment_rejection_action_report_pk PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-20888_20240125-rebuild', 'AdilElJaouhari', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 875, '9:8fc04632753f2fc90864bd69d095c579', 'createTable tableName=ar_payment_rejection_action_report', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-23049_20240520_build::TarikFA.
CREATE TABLE payment_term (id BIGINT NOT NULL, version INTEGER DEFAULT 0, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, creator VARCHAR(100), updater VARCHAR(100), code VARCHAR(255), description VARCHAR(255), disabled INTEGER DEFAULT 0 NOT NULL, description_i18n JSONB, CONSTRAINT payment_term_pkey PRIMARY KEY (id));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-23049_20240520_build', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 877, '9:9e9391c893a8ba592cec90a9f4ba6d4f', 'createTable tableName=payment_term', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-25155_secured_tmp-rebuild::a.rouaguebe
CREATE TABLE tmp_secured_entity (uuid VARCHAR(36) DEFAULT uuid_generate_v4() NOT NULL, search_id VARCHAR(36) NOT NULL, code VARCHAR(255) NOT NULL, created TIMESTAMP WITHOUT TIME ZONE DEFAULT NOW() NOT NULL, CONSTRAINT tmp_secured_entity_pkey PRIMARY KEY (uuid));

CREATE INDEX tmp_secured_entity_search_id_idx ON tmp_secured_entity(search_id);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-25155_secured_tmp-rebuild', 'a.rouaguebe', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 879, '9:00f03f489fa2cbb2b73c9f90cddb0a78', 'createTable tableName=tmp_secured_entity; createIndex indexName=tmp_secured_entity_search_id_idx, tableName=tmp_secured_entity', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-26054_20241101_build::TarikFA.
CREATE TABLE billing_purchase_order (id BIGINT NOT NULL, version INTEGER, creator VARCHAR(100), created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updater VARCHAR(100), updated TIMESTAMP WITHOUT TIME ZONE, code VARCHAR(255), description VARCHAR(255), number VARCHAR(100) NOT NULL, start_date TIMESTAMP WITHOUT TIME ZONE, end_date TIMESTAMP WITHOUT TIME ZONE, delivery_date TIMESTAMP WITHOUT TIME ZONE, account_level VARCHAR(50) NOT NULL, seller_id BIGINT, customer_id BIGINT, customer_account_id BIGINT, billing_account_id BIGINT, CONSTRAINT billing_purchase_order_pkey PRIMARY KEY (id), UNIQUE (number));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-26054_20241101_build', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/structure.xml', NOW(), 881, '9:8ceec9126a03b1988d4717281b0a1f46', 'createTable tableName=billing_purchase_order', '', 'EXECUTED', NULL, NULL, '4.29.0', '4658469362');

-- Changeset src/main/resources/db_resources/changelog/rebuild/structure.xml::#INTRD-22676-rebuild::AndriusKarpavicius
CREATE TABLE adm_endpoint (id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, version INTEGER, disabled INTEGER DEFAULT 0, created TIMESTAMP WITHOUT TIME ZONE NOT NULL, updated TIMESTAMP WITHOUT TIME ZONE, description VARCHAR(255), code VARCHAR(255), creator VARCHAR(255), updater VARCHAR(255), script_id BIGINT NOT NULL, secured INTEGER DEFAULT 1 NOT NULL, synchronous INTEGER DEFAULT 0 NOT NULL, method VARCHAR(10) NOT NULL, returned_variable_name VARCHAR(50), returned_value_example VARCHAR(500), jsonata_transformer VARCHAR(255), serialize_result INTEGER DEFAULT 0 NOT NULL, content_type VARCHAR(16) DEFAULT 'application/json' NOT NULL, base_path VARCHAR(30) NOT NULL, path VARCHAR(255), CONSTRAINT adm_endpoint_pkey PRIMARY KEY (id), UNIQUE (code));

