Add subscription and notification for resource changes; fix a bug while pserver node...
[pti/o2.git] / o2ims / adapter / orm.py
index 05a8dc7..bb5c984 100644 (file)
@@ -32,6 +32,7 @@ from sqlalchemy.orm import mapper, relationship
 # from sqlalchemy.sql.sqltypes import Integer\r
 \r
 from o2ims.domain import ocloud as ocloudModel\r
+from o2ims.domain import subscription_obj as subModel\r
 from o2ims.domain.resource_type import ResourceTypeEnum\r
 \r
 from o2common.helper import o2logging\r
@@ -102,6 +103,7 @@ resource = Table(
     Column("resourceId", String(255), primary_key=True),\r
     Column("resourceTypeId", ForeignKey("resourcetype.resourceTypeId")),\r
     Column("resourcePoolId", ForeignKey("resourcepool.resourcePoolId")),\r
+    Column("name", String(255)),\r
     # Column("globalAssetId", String(255)),\r
     Column("parentId", String(255)),\r
     Column("description", String(255)),\r
@@ -165,7 +167,7 @@ def start_o2ims_mappers(engine=None):
             "resourcePools": relationship(resourcepool_mapper)\r
         }\r
     )\r
-    mapper(ocloudModel.Subscription, subscription)\r
+    mapper(subModel.Subscription, subscription)\r
 \r
     if engine is not None:\r
         metadata.create_all(engine)\r