1 # ============LICENSE_START=======================================================
2 # Copyright (c) 2023 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
8 # http://www.apache.org/licenses/LICENSE-2.0
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 # ============LICENSE_END=========================================================
29 primaryKeyName: anchor_pkey
53 name: from_fragment_id
63 name: relation_type_id
92 primaryKeyName: relation_type_pkey
95 tableName: relation_type
107 primaryKeyName: fragment_pkey
144 primaryKeyName: schema_set_pkey
157 tableName: schema_set
169 primaryKeyName: yang_resource_pkey
187 tableName: yang_resource
199 primaryKeyName: dataspace_pkey
217 name: schema_node_identifier
224 primaryKeyName: schema_node_pkey
227 tableName: schema_node
242 name: yang_resource_id
244 tableName: schema_set_yang_resources
253 indexName: FKI_ANCHOR_SCHEMA_SET_ID_FK
259 - addUniqueConstraint:
260 columnNames: dataspace_id, name
261 constraintName: anchor_dataspace_id_name_key
267 - addForeignKeyConstraint:
268 baseColumnNames: anchor_id
269 baseTableName: fragment
270 constraintName: fragment_anchor_id_fkey
272 initiallyDeferred: false
275 referencedColumnNames: id
276 referencedTableName: anchor
285 name: from_fragment_id
286 indexName: FKI_RELATIONS_FROM_ID_FK
296 indexName: FKI_RELATIONS_TO_ID_FK
305 name: relation_type_id
306 indexName: FKI_RELATION_TYPE_ID_FK
313 columnNames: to_fragment_id, from_fragment_id, relation_type_id
314 constraintName: relation_pkey
324 indexName: FKI_FRAGMENT_ANCHOR_ID_FK
334 indexName: FKI_FRAGMENT_DATASPACE_ID_FK
344 indexName: FKI_FRAGMENT_PARENT_ID_FK
354 indexName: FKI_SCHEMA_NODE_ID_TO_ID
360 - addUniqueConstraint:
361 columnNames: dataspace_id, anchor_id, xpath
362 constraintName: fragment_dataspace_id_anchor_id_xpath_key
368 - addForeignKeyConstraint:
369 baseColumnNames: from_fragment_id
370 baseTableName: relation
371 constraintName: relation_from_fragment_id_fkey
373 initiallyDeferred: false
376 referencedColumnNames: id
377 referencedTableName: fragment
383 - addForeignKeyConstraint:
384 baseColumnNames: to_fragment_id
385 baseTableName: relation
386 constraintName: relation_to_fragment_id_fkey
388 initiallyDeferred: false
391 referencedColumnNames: id
392 referencedTableName: fragment
398 - addUniqueConstraint:
399 columnNames: name, dataspace_id
400 constraintName: schema_set_name_dataspace_id_key
401 tableName: schema_set
406 - addForeignKeyConstraint:
407 baseColumnNames: schema_set_id
408 baseTableName: schema_set_yang_resources
409 constraintName: schema_set_resource
411 initiallyDeferred: false
414 referencedColumnNames: id
415 referencedTableName: schema_set
421 - addUniqueConstraint:
422 columnNames: checksum
423 constraintName: yang_resource_checksum_key
424 tableName: yang_resource
429 - addUniqueConstraint:
431 constraintName: UQ_NAME
437 - addForeignKeyConstraint:
438 baseColumnNames: dataspace_id
439 baseTableName: fragment
440 constraintName: fragment_dataspace_id_fkey
442 initiallyDeferred: false
445 referencedColumnNames: id
446 referencedTableName: dataspace
452 - addForeignKeyConstraint:
453 baseColumnNames: dataspace_id
454 baseTableName: schema_set
455 constraintName: schema_set_dataspace
457 initiallyDeferred: false
460 referencedColumnNames: id
461 referencedTableName: dataspace
470 name: schema_node_identifier
471 indexName: PERF_SCHEMA_NODE_SCHEMA_NODE_ID
472 tableName: schema_node
477 - addForeignKeyConstraint:
478 baseColumnNames: yang_resource_id
479 baseTableName: schema_set_yang_resources
480 constraintName: schema_set_yang_resources_yang_resource_id_fkey
482 initiallyDeferred: false
485 referencedColumnNames: id
486 referencedTableName: yang_resource
492 - addForeignKeyConstraint:
493 baseColumnNames: dataspace_id
494 baseTableName: anchor
495 constraintName: anchor_dataspace_id_fkey
497 initiallyDeferred: false
500 referencedColumnNames: id
501 referencedTableName: dataspace
507 - addForeignKeyConstraint:
508 baseColumnNames: schema_set_id
509 baseTableName: anchor
510 constraintName: anchor_schema_set_id_fkey
512 initiallyDeferred: false
515 referencedColumnNames: id
516 referencedTableName: schema_set
522 - addForeignKeyConstraint:
523 baseColumnNames: relation_type_id
524 baseTableName: relation
525 constraintName: relation_relation_type_id_fkey
527 initiallyDeferred: false
530 referencedColumnNames: id
531 referencedTableName: relation_type
537 - addForeignKeyConstraint:
538 baseColumnNames: parent_id
539 baseTableName: fragment
540 constraintName: fragment_parent_id_fkey
542 initiallyDeferred: false
545 referencedColumnNames: id
546 referencedTableName: fragment
552 - addForeignKeyConstraint:
553 baseColumnNames: schema_node_id
554 baseTableName: fragment
555 constraintName: fragment_schema_node_id_fkey
557 initiallyDeferred: false
560 referencedColumnNames: id
561 referencedTableName: schema_node
567 label: add-module-name-and-revision-column
571 tableName: yang_resource
582 label: update-previous-data-module-name-and-revision
586 sql: update yang_resource set module_name = 'dummy_module_name', revision = '2021-08-04' where module_name is null and revision is null
588 sql: update yang_resource set module_name = null, revision = null where module_name = 'dummy_module_name' and revision = '2021-08-04'
592 label: yang-resource-rename-column
596 tableName: yang_resource
599 newColumnName: file_name
602 sql: alter table yang_resource rename column file_name to name
612 indexName: FKI_SCHEMA_SET_YANG_RESOURCES_SCHEMA_SET_ID_FK
613 tableName: schema_set_yang_resources
616 indexName: FKI_SCHEMA_SET_YANG_RESOURCES_SCHEMA_SET_ID_FK
617 tableName: schema_set_yang_resources