databaseChangeLog:
    - include:
        file: db/changelog/0-base/000-base-schema.sql
    - include:
        file: db/changelog/0-base/001-last-row-count.sql
    - include:
        file: db/changelog/0-base/002-int-to-var.sql
    - include:
        file: db/changelog/0-base/003-random-in-range.sql
    - include:
        file: db/changelog/0-base/004-jsonb-changes-delta.sql
    - include:
        file: db/changelog/0-base/005-uuid-ossp-extension.sql
    - include:
        file: db/changelog/0-base/006-numeric-hash-functions.sql
    - include:
        file: db/changelog/0-base/007-table-columns.sql
    - include:
        file: db/changelog/0-base/008-raise-functions.sql
    - include:
        file: db/changelog/0-base/009-check-environment.sql
    - include:
        file: db/changelog/0-base/010-context.sql
    - include:
        file: db/changelog/0-base/011-table-schema-and-name.sql
    - include:
        file: db/changelog/0-base/020-audit-log.sql
    - include:
        file: db/changelog/0-base/030-historization.sql
    - include:
        file: db/changelog/0-base/040-array-functions.sql
    - include:
        file: db/changelog/0-base/090-log-slow-queries-extensions.sql

    - include:
        file: db/changelog/1-rbac/1000-rbac-schema.sql
    - include:
        file: db/changelog/1-rbac/1050-rbac-base.sql
    - include:
        file: db/changelog/1-rbac/1051-rbac-subject-grant.sql
    - include:
        file: db/changelog/1-rbac/1054-rbac-context.sql
    - include:
        file: db/changelog/1-rbac/1055-rbac-views.sql
    - include:
        file: db/changelog/1-rbac/1056-rbac-trigger-context.sql
    - include:
        file: db/changelog/1-rbac/1057-rbac-role-builder.sql
    - include:
        file: db/changelog/1-rbac/1058-rbac-generators.sql
    - include:
        file: db/changelog/1-rbac/1059-rbac-statistics.sql
    - include:
        file: db/changelog/1-rbac/1080-rbac-global.sql

    - include:
        file: db/changelog/2-rbactest/200-rbactest-schema.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/2-rbactest/201-rbactest-customer/2010-rbactest-customer.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/2-rbactest/201-rbactest-customer/2013-rbactest-customer-rbac.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/2-rbactest/201-rbactest-customer/2018-rbactest-customer-test-data.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/2-rbactest/202-rbactest-package/2020-rbactest-package.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/2-rbactest/202-rbactest-package/2023-rbactest-package-rbac.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/2-rbactest/202-rbactest-package/2028-rbactest-package-test-data.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/2-rbactest/203-rbactest-domain/2030-rbactest-domain.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/2-rbactest/203-rbactest-domain/2033-rbactest-domain-rbac.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/2-rbactest/203-rbactest-domain/2038-rbactest-domain-test-data.sql
        context: "!without-test-data"

    - include:
        file: db/changelog/5-hs-office/500-hs-office-schema.sql
    - include:
        file: db/changelog/5-hs-office/501-contact/5010-hs-office-contact.sql
    - include:
        file: db/changelog/5-hs-office/501-contact/5013-hs-office-contact-rbac.sql
    - include:
        file: db/changelog/5-hs-office/501-contact/5016-hs-office-contact-migration.sql
    - include:
        file: db/changelog/5-hs-office/501-contact/5018-hs-office-contact-test-data.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/5-hs-office/502-person/5020-hs-office-person.sql
    - include:
        file: db/changelog/5-hs-office/502-person/5023-hs-office-person-rbac.sql
    - include:
        file: db/changelog/5-hs-office/502-person/5028-hs-office-person-test-data.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/5-hs-office/502-person/5028-hs-office-person-test-data-for-accounts.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/5-hs-office/503-relation/5030-hs-office-relation.sql
    - include:
        file: db/changelog/5-hs-office/503-relation/5033-hs-office-relation-rbac.sql
    - include:
        file: db/changelog/5-hs-office/503-relation/5038-hs-office-relation-test-data.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/5-hs-office/504-partner/5040-hs-office-partner.sql
    - include:
        file: db/changelog/5-hs-office/504-partner/5043-hs-office-partner-rbac.sql
    - include:
        file: db/changelog/5-hs-office/504-partner/5044-hs-office-partner-details-rbac.sql
    - include:
        file: db/changelog/5-hs-office/504-partner/5046-hs-office-partner-migration.sql
    - include:
        file: db/changelog/5-hs-office/504-partner/5048-hs-office-partner-test-data.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/5-hs-office/505-bankaccount/5050-hs-office-bankaccount.sql
    - include:
        file: db/changelog/5-hs-office/505-bankaccount/5053-hs-office-bankaccount-rbac.sql
    - include:
          file: db/changelog/5-hs-office/505-bankaccount/5058-hs-office-bankaccount-test-data.sql
          context: "!without-test-data"
    - include:
        file: db/changelog/5-hs-office/506-debitor/5060-hs-office-debitor.sql
    - include:
        file: db/changelog/5-hs-office/506-debitor/5063-hs-office-debitor-rbac.sql
    - include:
        file: db/changelog/5-hs-office/506-debitor/5068-hs-office-debitor-test-data.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/5-hs-office/507-sepamandate/5070-hs-office-sepamandate.sql
    - include:
        file: db/changelog/5-hs-office/507-sepamandate/5073-hs-office-sepamandate-rbac.sql
    - include:
        file: db/changelog/5-hs-office/507-sepamandate/5076-hs-office-sepamandate-migration.sql
    - include:
        file: db/changelog/5-hs-office/507-sepamandate/5078-hs-office-sepamandate-test-data.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/5-hs-office/510-membership/5100-hs-office-membership.sql
    - include:
        file: db/changelog/5-hs-office/510-membership/5103-hs-office-membership-rbac.sql
    - include:
        file: db/changelog/5-hs-office/510-membership/5108-hs-office-membership-test-data.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/5-hs-office/511-coopshares/5110-hs-office-coopshares.sql
    - include:
        file: db/changelog/5-hs-office/511-coopshares/5113-hs-office-coopshares-rbac.sql
    - include:
        file: db/changelog/5-hs-office/511-coopshares/5116-hs-office-coopshares-migration.sql
    - include:
        file: db/changelog/5-hs-office/511-coopshares/5118-hs-office-coopshares-test-data.sql
        context: "!without-test-data"
    - include:
        file: db/changelog/5-hs-office/512-coopassets/5120-hs-office-coopassets.sql
    - include:
        file: db/changelog/5-hs-office/512-coopassets/5123-hs-office-coopassets-rbac.sql
    - include:
        file: db/changelog/5-hs-office/512-coopassets/5126-hs-office-coopassets-migration.sql
    - include:
        file: db/changelog/5-hs-office/512-coopassets/5128-hs-office-coopassets-test-data.sql
        context: "!without-test-data"

    - include:
        file: db/changelog/6-hs-booking/600-hs-booking-schema.sql
        context: "!only-prod-schema"
    - include:
        file: db/changelog/6-hs-booking/610-booking-debitor/6100-hs-booking-debitor.sql
        context: "!only-prod-schema"
    - include:
        file: db/changelog/6-hs-booking/620-booking-project/6200-hs-booking-project.sql
        context: "!only-prod-schema"
    - include:
        file: db/changelog/6-hs-booking/620-booking-project/6203-hs-booking-project-rbac.sql
        context: "!only-prod-schema"
    - include:
        file: db/changelog/6-hs-booking/620-booking-project/6208-hs-booking-project-test-data.sql
        context: "!only-prod-schema and !without-test-data"
    - include:
        file: db/changelog/6-hs-booking/630-booking-item/6300-hs-booking-item.sql
        context: "!only-prod-schema"
    - include:
        file: db/changelog/6-hs-booking/630-booking-item/6303-hs-booking-item-rbac.sql
        context: "!only-prod-schema"
    - include:
        file: db/changelog/6-hs-booking/630-booking-item/6308-hs-booking-item-test-data.sql
        context: "!only-prod-schema and !without-test-data"

    - include:
        file: db/changelog/7-hs-hosting/700-hs-hosting-schema.sql
        context: "!only-prod-schema"
    - include:
        file: db/changelog/7-hs-hosting/701-hosting-asset/7010-hs-hosting-asset.sql
        context: "!only-prod-schema"
    - include:
        file: db/changelog/7-hs-hosting/701-hosting-asset/7013-hs-hosting-asset-rbac.sql
        context: "!only-prod-schema"
    - include:
        file: db/changelog/7-hs-hosting/701-hosting-asset/7016-hs-hosting-asset-migration.sql
        context: "!only-prod-schema"
    - include:
        file: db/changelog/7-hs-hosting/701-hosting-asset/7018-hs-hosting-asset-test-data.sql
        context: "!only-prod-schema and !without-test-data"

    - include:
        file: db/changelog/9-hs-global/9000-statistics.sql
        context: "!only-prod-schema"

    - include:
          file: db/changelog/9-hs-global/950-accounts/9500-hs-accounts-schema.sql
          context: "!only-prod-schema"
    - include:
          file: db/changelog/9-hs-global/950-accounts/9510-hs-accounts.sql
          context: "!only-prod-schema"
    #    TODO_impl: RBAC rules for _rv do not yet work properly
    #    - include:
    #          file: db/changelog/9-hs-global/950-accounts/9513-hs-accounts-context-rbac.sql
    - include:
          file: db/changelog/9-hs-global/950-accounts/9519-hs-accounts-test-data.sql
          context: "!only-prod-schema and !without-test-data"

    - include:
          file: db/changelog/9-hs-global/960-integrations/9600-hs-integration-schema.sql
    - include:
          file: db/changelog/9-hs-global/960-integrations/9610-integration-kimai.sql
    - include:
          file: db/changelog/9-hs-global/960-integrations/9620-integration-znuny.sql
    - include:
          file: db/changelog/9-hs-global/960-integrations/9630-integration-mlmmj.sql

    - include:
          file: db/changelog/9-hs-global/9800-cleanup.sql
          context: "without-test-data"

    - include:
        file: db/changelog/9-hs-global/9999-liquibase-migration-test.sql
        context: liquibase-migration-test
