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
141 primaryKeyName: schema_set_pkey
154 tableName: schema_set
166 primaryKeyName: yang_resource_pkey
184 tableName: yang_resource
196 primaryKeyName: dataspace_pkey
214 name: schema_node_identifier
221 primaryKeyName: schema_node_pkey
224 tableName: schema_node
239 name: yang_resource_id
241 tableName: schema_set_yang_resources
250 indexName: FKI_ANCHOR_SCHEMA_SET_ID_FK
256 - addUniqueConstraint:
257 columnNames: dataspace_id, name
258 constraintName: anchor_dataspace_id_name_key
264 - addForeignKeyConstraint:
265 baseColumnNames: anchor_id
266 baseTableName: fragment
267 constraintName: fragment_anchor_id_fkey
269 initiallyDeferred: false
272 referencedColumnNames: id
273 referencedTableName: anchor
282 name: from_fragment_id
283 indexName: FKI_RELATIONS_FROM_ID_FK
293 indexName: FKI_RELATIONS_TO_ID_FK
302 name: relation_type_id
303 indexName: FKI_RELATION_TYPE_ID_FK
310 columnNames: to_fragment_id, from_fragment_id, relation_type_id
311 constraintName: relation_pkey
321 indexName: FKI_FRAGMENT_ANCHOR_ID_FK
331 indexName: FKI_FRAGMENT_PARENT_ID_FK
341 indexName: FKI_SCHEMA_NODE_ID_TO_ID
347 - addUniqueConstraint:
348 columnNames: anchor_id, xpath
349 constraintName: fragment_anchor_id_xpath_key
355 - addForeignKeyConstraint:
356 baseColumnNames: from_fragment_id
357 baseTableName: relation
358 constraintName: relation_from_fragment_id_fkey
360 initiallyDeferred: false
363 referencedColumnNames: id
364 referencedTableName: fragment
370 - addForeignKeyConstraint:
371 baseColumnNames: to_fragment_id
372 baseTableName: relation
373 constraintName: relation_to_fragment_id_fkey
375 initiallyDeferred: false
378 referencedColumnNames: id
379 referencedTableName: fragment
385 - addUniqueConstraint:
386 columnNames: name, dataspace_id
387 constraintName: schema_set_name_dataspace_id_key
388 tableName: schema_set
393 - addForeignKeyConstraint:
394 baseColumnNames: schema_set_id
395 baseTableName: schema_set_yang_resources
396 constraintName: schema_set_resource
398 initiallyDeferred: false
401 referencedColumnNames: id
402 referencedTableName: schema_set
408 - addUniqueConstraint:
409 columnNames: checksum
410 constraintName: yang_resource_checksum_key
411 tableName: yang_resource
416 - addUniqueConstraint:
418 constraintName: UQ_NAME
424 - addForeignKeyConstraint:
425 baseColumnNames: dataspace_id
426 baseTableName: schema_set
427 constraintName: schema_set_dataspace
429 initiallyDeferred: false
432 referencedColumnNames: id
433 referencedTableName: dataspace
442 name: schema_node_identifier
443 indexName: PERF_SCHEMA_NODE_SCHEMA_NODE_ID
444 tableName: schema_node
449 - addForeignKeyConstraint:
450 baseColumnNames: yang_resource_id
451 baseTableName: schema_set_yang_resources
452 constraintName: schema_set_yang_resources_yang_resource_id_fkey
454 initiallyDeferred: false
457 referencedColumnNames: id
458 referencedTableName: yang_resource
464 - addForeignKeyConstraint:
465 baseColumnNames: dataspace_id
466 baseTableName: anchor
467 constraintName: anchor_dataspace_id_fkey
469 initiallyDeferred: false
472 referencedColumnNames: id
473 referencedTableName: dataspace
479 - addForeignKeyConstraint:
480 baseColumnNames: schema_set_id
481 baseTableName: anchor
482 constraintName: anchor_schema_set_id_fkey
484 initiallyDeferred: false
487 referencedColumnNames: id
488 referencedTableName: schema_set
494 - addForeignKeyConstraint:
495 baseColumnNames: relation_type_id
496 baseTableName: relation
497 constraintName: relation_relation_type_id_fkey
499 initiallyDeferred: false
502 referencedColumnNames: id
503 referencedTableName: relation_type
509 - addForeignKeyConstraint:
510 baseColumnNames: parent_id
511 baseTableName: fragment
512 constraintName: fragment_parent_id_fkey
514 initiallyDeferred: false
517 referencedColumnNames: id
518 referencedTableName: fragment
524 - addForeignKeyConstraint:
525 baseColumnNames: schema_node_id
526 baseTableName: fragment
527 constraintName: fragment_schema_node_id_fkey
529 initiallyDeferred: false
532 referencedColumnNames: id
533 referencedTableName: schema_node
539 label: add-module-name-and-revision-column
543 tableName: yang_resource
554 label: update-previous-data-module-name-and-revision
558 sql: update yang_resource set module_name = 'dummy_module_name', revision = '2021-08-04' where module_name is null and revision is null
560 sql: update yang_resource set module_name = null, revision = null where module_name = 'dummy_module_name' and revision = '2021-08-04'
564 label: yang-resource-rename-column
568 tableName: yang_resource
571 newColumnName: file_name
574 sql: alter table yang_resource rename column file_name to name
584 indexName: FKI_SCHEMA_SET_YANG_RESOURCES_SCHEMA_SET_ID_FK
585 tableName: schema_set_yang_resources
588 indexName: FKI_SCHEMA_SET_YANG_RESOURCES_SCHEMA_SET_ID_FK
589 tableName: schema_set_yang_resources
595 - dropForeignKeyConstraint:
596 baseTableName: fragment
597 constraintName: fragment_parent_id_fkey
598 - addForeignKeyConstraint:
599 baseColumnNames: parent_id
600 baseTableName: fragment
601 constraintName: fragment_parent_id_fkey
603 initiallyDeferred: false
606 referencedColumnNames: id
607 referencedTableName: fragment
610 - dropForeignKeyConstraint:
611 baseTableName: fragment
612 constraintName: fragment_parent_id_fkey
613 - addForeignKeyConstraint:
614 baseColumnNames: parent_id
615 baseTableName: fragment
616 constraintName: fragment_parent_id_fkey
618 initiallyDeferred: false
621 referencedColumnNames: id
622 referencedTableName: fragment