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
366 indexName: UQ_FRAGMENT_XPATH
373 - addUniqueConstraint:
374 columnNames: dataspace_id, anchor_id, xpath
375 constraintName: fragment_dataspace_id_anchor_id_xpath_key
381 - addForeignKeyConstraint:
382 baseColumnNames: from_fragment_id
383 baseTableName: relation
384 constraintName: relation_from_fragment_id_fkey
386 initiallyDeferred: false
389 referencedColumnNames: id
390 referencedTableName: fragment
396 - addForeignKeyConstraint:
397 baseColumnNames: to_fragment_id
398 baseTableName: relation
399 constraintName: relation_to_fragment_id_fkey
401 initiallyDeferred: false
404 referencedColumnNames: id
405 referencedTableName: fragment
411 - addUniqueConstraint:
412 columnNames: name, dataspace_id
413 constraintName: schema_set_name_dataspace_id_key
414 tableName: schema_set
419 - addForeignKeyConstraint:
420 baseColumnNames: schema_set_id
421 baseTableName: schema_set_yang_resources
422 constraintName: schema_set_resource
424 initiallyDeferred: false
427 referencedColumnNames: id
428 referencedTableName: schema_set
434 - addUniqueConstraint:
435 columnNames: checksum
436 constraintName: yang_resource_checksum_key
437 tableName: yang_resource
442 - addUniqueConstraint:
444 constraintName: UQ_NAME
450 - addForeignKeyConstraint:
451 baseColumnNames: dataspace_id
452 baseTableName: fragment
453 constraintName: fragment_dataspace_id_fkey
455 initiallyDeferred: false
458 referencedColumnNames: id
459 referencedTableName: dataspace
465 - addForeignKeyConstraint:
466 baseColumnNames: dataspace_id
467 baseTableName: schema_set
468 constraintName: schema_set_dataspace
470 initiallyDeferred: false
473 referencedColumnNames: id
474 referencedTableName: dataspace
483 name: schema_node_identifier
484 indexName: PERF_SCHEMA_NODE_SCHEMA_NODE_ID
485 tableName: schema_node
490 - addForeignKeyConstraint:
491 baseColumnNames: yang_resource_id
492 baseTableName: schema_set_yang_resources
493 constraintName: schema_set_yang_resources_yang_resource_id_fkey
495 initiallyDeferred: false
498 referencedColumnNames: id
499 referencedTableName: yang_resource
505 - addForeignKeyConstraint:
506 baseColumnNames: dataspace_id
507 baseTableName: anchor
508 constraintName: anchor_dataspace_id_fkey
510 initiallyDeferred: false
513 referencedColumnNames: id
514 referencedTableName: dataspace
520 - addForeignKeyConstraint:
521 baseColumnNames: schema_set_id
522 baseTableName: anchor
523 constraintName: anchor_schema_set_id_fkey
525 initiallyDeferred: false
528 referencedColumnNames: id
529 referencedTableName: schema_set
535 - addForeignKeyConstraint:
536 baseColumnNames: relation_type_id
537 baseTableName: relation
538 constraintName: relation_relation_type_id_fkey
540 initiallyDeferred: false
543 referencedColumnNames: id
544 referencedTableName: relation_type
550 - addForeignKeyConstraint:
551 baseColumnNames: parent_id
552 baseTableName: fragment
553 constraintName: fragment_parent_id_fkey
555 initiallyDeferred: false
558 referencedColumnNames: id
559 referencedTableName: fragment
565 - addForeignKeyConstraint:
566 baseColumnNames: schema_node_id
567 baseTableName: fragment
568 constraintName: fragment_schema_node_id_fkey
570 initiallyDeferred: false
573 referencedColumnNames: id
574 referencedTableName: schema_node
580 label: add-module-name-and-revision-column
584 tableName: yang_resource
595 label: update-previous-data-module-name-and-revision
599 sql: update yang_resource set module_name = 'dummy_module_name', revision = '2021-08-04' where module_name is null and revision is null
601 sql: update yang_resource set module_name = null, revision = null where module_name = 'dummy_module_name' and revision = '2021-08-04'
605 label: yang-resource-rename-column
609 tableName: yang_resource
612 newColumnName: file_name
615 sql: alter table yang_resource rename column file_name to name