Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/31#discussion_r90882024
  
    --- Diff: aria/storage/models.py ---
    @@ -339,94 +324,100 @@ class Node(SQLModelBase):
         Node model representation.
         """
         __tablename__ = 'nodes'
    +    id = Column(Integer, primary_key=True)
     
         # See base class for an explanation on these properties
         is_id_unique = False
     
    -    _private_fields = ['deployment_fk']
    -    deployment_fk = foreign_key(Deployment.storage_id)
    -
    -    deployment_id = association_proxy('deployment', 'id')
    -    blueprint_id = association_proxy('blueprint', 'id')
    +    _private_fields = ['deployment_id', 'host_id']
    +    deployment_id = foreign_key(Deployment.id)
    +    host_id = foreign_key('nodes.id', nullable=True)
     
         @declared_attr
         def deployment(cls):
    -        return one_to_many_relationship(cls, Deployment, cls.deployment_fk)
    +        return one_to_many_relationship(cls, Deployment, cls.deployment_id)
     
         deploy_number_of_instances = Column(Integer, nullable=False)
         # TODO: This probably should be a foreign key, but there's no guarantee
         # in the code, currently, that the host will be created beforehand
    -    host_id = Column(Text)
    +    _host_id = foreign_key('nodes.id', nullable=True)
         max_number_of_instances = Column(Integer, nullable=False)
         min_number_of_instances = Column(Integer, nullable=False)
         number_of_instances = Column(Integer, nullable=False)
         planned_number_of_instances = Column(Integer, nullable=False)
    -    plugins = Column(MutableDict.as_mutable(Dict))
    -    plugins_to_install = Column(MutableDict.as_mutable(Dict))
    -    properties = Column(MutableDict.as_mutable(Dict))
    -    operations = Column(MutableDict.as_mutable(Dict))
    +    plugins = Column(Dict)
    +    plugins_to_install = Column(Dict)
    +    properties = Column(Dict)
    +    operations = Column(Dict)
         type = Column(Text, nullable=False, index=True)
         type_hierarchy = Column(PickleType)
     
    +    host = relationship('Node',
    --- End diff --
    
    pretify


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to