Add 'data' fields to cluster and node
This commit is contained in:
parent
3835c3e364
commit
e3caa76fbc
@ -53,6 +53,7 @@ def upgrade(migrate_engine):
|
||||
sqlalchemy.Column('status', sqlalchemy.String(255)),
|
||||
sqlalchemy.Column('status_reason', sqlalchemy.String(255)),
|
||||
sqlalchemy.Column('tags', types.Json),
|
||||
sqlalchemy.Column('data', types.Json),
|
||||
mysql_engine='InnoDB',
|
||||
mysql_charset='utf8'
|
||||
)
|
||||
@ -76,6 +77,7 @@ def upgrade(migrate_engine):
|
||||
sqlalchemy.Column('status', sqlalchemy.String(255)),
|
||||
sqlalchemy.Column('status_reason', sqlalchemy.String(255)),
|
||||
sqlalchemy.Column('tags', types.Json),
|
||||
sqlalchemy.Column('data', types.Json),
|
||||
mysql_engine='InnoDB',
|
||||
mysql_charset='utf8'
|
||||
)
|
||||
|
@ -103,6 +103,7 @@ class Cluster(BASE, SenlinBase, SoftDelete):
|
||||
status = sqlalchemy.Column(sqlalchemy.String(255))
|
||||
status_reason = sqlalchemy.Column(sqlalchemy.String(255))
|
||||
tags = sqlalchemy.Column(types.Json)
|
||||
data = sqlalchemy.Column(types.Json)
|
||||
|
||||
|
||||
class Node(BASE, SenlinBase):
|
||||
@ -128,6 +129,7 @@ class Node(BASE, SenlinBase):
|
||||
status = sqlalchemy.Column(sqlalchemy.String(255))
|
||||
status_reason = sqlalchemy.Column(sqlalchemy.String(255))
|
||||
tags = sqlalchemy.Column(types.Json)
|
||||
data = sqlalchemy.Column(types.Json)
|
||||
|
||||
|
||||
class ClusterLock(BASE, SenlinBase):
|
||||
|
@ -56,6 +56,7 @@ class Cluster(object):
|
||||
|
||||
self.status = ''
|
||||
self.status_reason = ''
|
||||
self.data = {}
|
||||
self.tags = {}
|
||||
|
||||
# persist object into database very early because:
|
||||
|
@ -48,6 +48,7 @@ class Node(object):
|
||||
|
||||
self.status = self.ACTIVE
|
||||
self.status_reason = 'Initialized'
|
||||
self.data = {}
|
||||
self.tags = {}
|
||||
# TODO: store this to database
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user