2 -- ============LICENSE_START=======================================================
3 -- Copyright (C) 2024 Ericsson
4 -- Modifications Copyright (C) 2024 OpenInfra Foundation Europe
5 -- ================================================================================
6 -- Licensed under the Apache License, Version 2.0 (the "License");
7 -- you may not use this file except in compliance with the License.
8 -- You may obtain a copy of the License at
10 -- http://www.apache.org/licenses/LICENSE-2.0
12 -- Unless required by applicable law or agreed to in writing, software
13 -- distributed under the License is distributed on an "AS IS" BASIS,
14 -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 -- See the License for the specific language governing permissions and
16 -- limitations under the License.
18 -- SPDX-License-Identifier: Apache-2.0
19 -- ============LICENSE_END=========================================================
24 DROP SCHEMA IF EXISTS ties_model cascade;
25 CREATE SCHEMA IF NOT EXISTS ties_model;
26 ALTER SCHEMA ties_model OWNER TO :pguser;
27 SET default_tablespace = '';
28 SET default_table_access_method = heap;
32 CREATE TABLE IF NOT EXISTS ties_model.execution_status (
33 "schema" VARCHAR(127) PRIMARY KEY,
37 CREATE TABLE IF NOT EXISTS ties_model.hash_info (
38 "name" VARCHAR(511) PRIMARY KEY,
39 "hashedValue" VARCHAR(511),
43 CREATE TABLE IF NOT EXISTS ties_model.module_reference (
44 "name" VARCHAR(511) PRIMARY KEY,
45 "namespace" VARCHAR(511),
46 "domain" VARCHAR(511),
47 "includedModules" jsonb,
48 "revision" VARCHAR(511),
52 CREATE TABLE IF NOT EXISTS ties_model.entity_info (
53 "storedAt" VARCHAR(511) PRIMARY KEY,
54 "name" VARCHAR(511) NOT NULL,
55 "moduleReferenceName" VARCHAR(511) NOT NULL,
56 "attributeNames" jsonb DEFAULT '[]'::jsonb,
57 FOREIGN KEY ("moduleReferenceName") REFERENCES ties_model.module_reference ("name") ON DELETE CASCADE
60 CREATE TABLE IF NOT EXISTS ties_model.relationship_info (
61 "name" VARCHAR(511) NOT NULL,
62 "aSideAssociationName" TEXT NOT NULL,
63 "aSideMOType" TEXT NOT NULL,
64 "aSideModule" TEXT NOT NULL,
65 "aSideMinCardinality" BIGINT NOT NULL,
66 "aSideMaxCardinality" BIGINT NOT NULL,
67 "bSideAssociationName" TEXT NOT NULL,
68 "bSideMOType" TEXT NOT NULL,
69 "bSideModule" TEXT NOT NULL,
70 "bSideMinCardinality" BIGINT NOT NULL,
71 "bSideMaxCardinality" BIGINT NOT NULL,
72 "associationKind" TEXT NOT NULL,
73 "relationshipDataLocation" TEXT NOT NULL,
74 "connectSameEntity" BOOLEAN NOT NULL,
75 "storedAt" VARCHAR(511) NOT NULL,
76 "moduleReferenceName" TEXT NOT NULL,
77 PRIMARY KEY ("name", "moduleReferenceName"),
78 FOREIGN KEY ("moduleReferenceName") REFERENCES ties_model.module_reference ("name") ON DELETE CASCADE
81 -- Update model schema exec status
82 INSERT INTO ties_model.execution_status("schema", "status") VALUES ('ties_model', 'success');
84 COPY ties_model.hash_info("name", "hashedValue", "type") FROM stdin;
87 COPY ties_model.module_reference("name", "namespace", "domain", "includedModules", "revision", "content") FROM stdin;
90 COPY ties_model.entity_info("storedAt", "name", "moduleReferenceName", "attributeNames") FROM stdin;
93 COPY ties_model.relationship_info("name", "aSideAssociationName", "aSideMOType", "aSideModule", "aSideMinCardinality", "aSideMaxCardinality", "bSideAssociationName", "bSideMOType", "bSideModule", "bSideMinCardinality", "bSideMaxCardinality", "associationKind", "connectSameEntity", "relationshipDataLocation", "storedAt", "moduleReferenceName") FROM stdin;
94 ENODEBFUNCTION_PROVIDES_LTESECTORCARRIER provided-lteSectorCarrier ENodeBFunction o-ran-smo-teiv-ran 1 1 provided-by-enodebFunction LTESectorCarrier o-ran-smo-teiv-ran 0 100 BI_DIRECTIONAL false B_SIDE o-ran-smo-teiv-ran:LTESectorCarrier o-ran-smo-teiv-ran
95 LTESECTORCARRIER_USES_ANTENNACAPABILITY used-antennaCapability LTESectorCarrier o-ran-smo-teiv-ran 0 9223372036854775807 used-by-lteSectorCarrier AntennaCapability o-ran-smo-teiv-ran 0 1 BI_DIRECTIONAL false A_SIDE o-ran-smo-teiv-ran:LTESectorCarrier o-ran-smo-teiv-ran