diff options
Diffstat (limited to 'cps-ri/src/main/resources/changelog/db/changes/01-createCPSTables.yaml')
-rw-r--r-- | cps-ri/src/main/resources/changelog/db/changes/01-createCPSTables.yaml | 239 |
1 files changed, 239 insertions, 0 deletions
diff --git a/cps-ri/src/main/resources/changelog/db/changes/01-createCPSTables.yaml b/cps-ri/src/main/resources/changelog/db/changes/01-createCPSTables.yaml index 07ffb93196..c9fbf8faaf 100644 --- a/cps-ri/src/main/resources/changelog/db/changes/01-createCPSTables.yaml +++ b/cps-ri/src/main/resources/changelog/db/changes/01-createCPSTables.yaml @@ -14,6 +14,7 @@ # limitations under the License. # ============LICENSE_END========================================================= +# For legacy reasons, previous files for changeset Ids: 6, 11, 15, 17-21 have been condensed into this file. databaseChangeLog: - changeSet: id: 1-1 @@ -573,4 +574,242 @@ databaseChangeLog: referencedColumnNames: id referencedTableName: schema_node validate: true + - changeSet: + logicalFilePath: changelog/db/changes/06-delete-not-required-fragment-index.yaml + id: 6 + author: cps + comment: Drop unique index for dataspace and xpath on fragment table + changes: + - dropIndex: + indexName: UQ_FRAGMENT_XPATH + tableName: fragment + rollback: + - createIndex: + columns: + - column: + name: xpath + - column: + name: dataspace_id + indexName: UQ_FRAGMENT_XPATH + tableName: fragment + unique: true + - changeSet: + logicalFilePath: changelog/db/changes/11-add-column-to-yang-resources-table.yaml + id: 11 + label: add-module-name-and-revision-column + author: cps + changes: + - addColumn: + tableName: yang_resource + columns: + - column: + name: module_name + type: TEXT + - column: + name: revision + type: TEXT + - changeSet: + logicalFilePath: changelog/db/changes/11-add-column-to-yang-resources-table.yaml + id: 11.1 + label: update-previous-data-module-name-and-revision + author: cps + changes: + - sql: + sql: update yang_resource set module_name = 'dummy_module_name', revision = '2021-08-04' where module_name is null and revision is null + rollback: + sql: update yang_resource set module_name = null, revision = null where module_name = 'dummy_module_name' and revision = '2021-08-04' + - changeSet: + logicalFilePath: changelog/db/changes/15-rename-column-yang-resource-table.yaml + author: cps + label: yang-resource-rename-column + id: 15 + changes: + - renameColumn: + tableName: yang_resource + columnDataType: TEXT + oldColumnName: name + newColumnName: file_name + rollback: + - sql: + sql: alter table yang_resource rename column file_name to name + - changeSet: + logicalFilePath: changelog/db/changes/17-add-index-to-schema-set-yang-resources.yaml + author: cps + id: 17 + changes: + - createIndex: + columns: + - column: + name: schema_set_id + indexName: FKI_SCHEMA_SET_YANG_RESOURCES_SCHEMA_SET_ID_FK + tableName: schema_set_yang_resources + rollback: + - dropIndex: + indexName: FKI_SCHEMA_SET_YANG_RESOURCES_SCHEMA_SET_ID_FK + tableName: schema_set_yang_resources + - changeSet: + logicalFilePath: changelog/db/changes/18-cascade-delete-fragment-children.yaml + author: cps + id: 18 + changes: + - dropForeignKeyConstraint: + baseTableName: fragment + constraintName: fragment_parent_id_fkey + - addForeignKeyConstraint: + baseColumnNames: parent_id + baseTableName: fragment + constraintName: fragment_parent_id_fkey + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: NO ACTION + referencedColumnNames: id + referencedTableName: fragment + validate: true + rollback: + - dropForeignKeyConstraint: + baseTableName: fragment + constraintName: fragment_parent_id_fkey + - addForeignKeyConstraint: + baseColumnNames: parent_id + baseTableName: fragment + constraintName: fragment_parent_id_fkey + deferrable: false + initiallyDeferred: false + onDelete: NO ACTION + onUpdate: NO ACTION + referencedColumnNames: id + referencedTableName: fragment + validate: true + - changeSet: + logicalFilePath: changelog/db/changes/19-delete-not-required-dataspace-id-from-fragment.yaml + id: 19-1 + author: cps + changes: + - dropIndex: + indexName: FKI_FRAGMENT_DATASPACE_ID_FK + tableName: fragment + rollback: + - createIndex: + columns: + - column: + name: dataspace_id + indexName: FKI_FRAGMENT_DATASPACE_ID_FK + tableName: fragment + - changeSet: + logicalFilePath: changelog/db/changes/19-delete-not-required-dataspace-id-from-fragment.yaml + id: 19-2 + author: cps + changes: + - dropUniqueConstraint: + constraintName: fragment_dataspace_id_anchor_id_xpath_key + tableName: fragment + - addUniqueConstraint: + columnNames: anchor_id, xpath + constraintName: fragment_anchor_id_xpath_key + tableName: fragment + rollback: + - dropUniqueConstraint: + constraintName: fragment_anchor_id_xpath_key + tableName: fragment + - addUniqueConstraint: + columnNames: dataspace_id, anchor_id, xpath + constraintName: fragment_dataspace_id_anchor_id_xpath_key + tableName: fragment + - changeSet: + logicalFilePath: changelog/db/changes/19-delete-not-required-dataspace-id-from-fragment.yaml + id: 19-3 + author: cps + changes: + - dropForeignKeyConstraint: + baseTableName: fragment + constraintName: fragment_dataspace_id_fkey + rollback: + - addForeignKeyConstraint: + baseColumnNames: dataspace_id + baseTableName: fragment + constraintName: fragment_dataspace_id_fkey + deferrable: false + initiallyDeferred: false + onDelete: NO ACTION + onUpdate: NO ACTION + referencedColumnNames: id + referencedTableName: dataspace + validate: true + - changeSet: + logicalFilePath: changelog/db/changes/19-delete-not-required-dataspace-id-from-fragment.yaml + id: 19-4 + author: cps + changes: + - dropColumn: + columnName: dataspace_id + tableName: fragment + rollback: + - addColumn: + tableName: fragment + columns: + - column: + name: dataspace_id + type: INTEGER + - sqlFile: + path: changelog/db/changes/19-repopulate-dataspace-id-for-rollback.sql + - addNotNullConstraint: + tableName: fragment + columnName: dataspace_id + columnDataType: INTEGER + + - changeSet: + logicalFilePath: changelog/db/changes/19-delete-not-required-dataspace-id-from-fragment.yaml + id: 19-5 + author: cps + changes: + - addNotNullConstraint: + tableName: fragment + columnName: anchor_id + columnDataType: BIGINT + rollback: + - dropNotNullConstraint: + tableName: fragment + columnName: anchor_id + columnDataType: BIGINT + - changeSet: + author: cps + logicalFilePath: changelog/db/changes/20-change-foreign-key-id-types-to-integer.yaml + id: 20 + changes: + - modifyDataType: + columnName: dataspace_id + newDataType: INTEGER + tableName: schema_set + - modifyDataType: + columnName: schema_set_id + newDataType: INTEGER + tableName: schema_set_yang_resources + - modifyDataType: + columnName: yang_resource_id + newDataType: INTEGER + tableName: schema_set_yang_resources + rollback: + - modifyDataType: + columnName: dataspace_id + newDataType: BIGINT + tableName: schema_set + - modifyDataType: + columnName: schema_set_id + newDataType: BIGINT + tableName: schema_set_yang_resources + - modifyDataType: + columnName: yang_resource_id + newDataType: BIGINT + tableName: schema_set_yang_resources + - changeSet: + logicalFilePath: changelog/db/changes/21-escape-quotes-in-xpath.yaml + id: 21 + author: cps + changes: + - sqlFile: + path: changelog/db/changes/21-escape-quotes-in-xpath-forward.sql + rollback: + - sqlFile: + path: changelog/db/changes/21-escape-quotes-in-xpath-rollback.sql
\ No newline at end of file |