068a61580d4e87b700eb4c842cedc9bda2959a8c
[cps.git] / cps-ri / src / main / resources / changelog / db / changes / 10-loadData-dmi-registry-fragment.yaml
1 # ============LICENSE_START=======================================================
2 # Copyright (C) 2021-2022 Nordix Foundation.
3 # ================================================================================
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 # SPDX-License-Identifier: Apache-2.0
17 # ============LICENSE_END=========================================================
18
19 databaseChangeLog:
20   - changeSet:
21       author: cps
22       label: dmi-registry-schema-preload
23       id: 10
24       loadUpdateData:
25         encoding: UTF-8
26         file: 'changelog/db/changes/data/dmi/fragment.csv'
27         onlyUpdate: 'false'
28         primaryKey: 'id'
29         quotchar: '"'
30         separator: '|'
31         tableName: 'fragment'
32         columns:
33           - column:
34               header: id
35               name: id
36               type: NUMERIC
37           - column:
38               header: xpath
39               name: xpath
40               type: STRING
41           - column:
42               header: attributes
43               name: attributes
44               type: CLOB
45           - column:
46               header: anchor_id
47               name: anchor_id
48               type: NUMERIC
49           - column:
50               header: parent_id
51               name: parent_id
52               type: NUMERIC
53           - column:
54               header: dataspace_id
55               name: dataspace_id
56               type: NUMERIC
57           - column:
58               header: schema_node_id
59               name: schema_node_id
60               type: NUMERIC
61       rollback:
62         sql: DELETE FROM fragment WHERE xpath = '/dmi-registry' AND anchor_id = (select id from anchor where name='ncmp-dmi-registry') AND dataspace_id = (select id from dataspace where name='NCMP-Admin')
63         comment: Removes the fragment added by fragment.csv file
64
65   - changeSet:
66       author: cps
67       label: dmi-registry-schema-preload
68       id: 10.1
69       changes:
70         - sql:
71             comment: Fixes the id sequence after data insert with predefined ids
72             dbms: postgresql
73             sql: ALTER SEQUENCE IF EXISTS fragment_id_seq RESTART WITH 200
74       rollback:
75         comment: Rollback for 10.1 is not supported. Please rollback change set 10 to undo change set 10.1. Cannot revert sequence altering.
76