support JSON type

This commit is contained in:
pycook
2019-12-23 18:51:33 +08:00
parent 3a8d4ecebc
commit 317a16aa21
12 changed files with 62 additions and 14 deletions

View File

@@ -250,6 +250,17 @@ class CIValueDateTime(Model):
attr = db.relationship("Attribute", backref="c_value_datetime.attr_id")
class CIValueJson(Model):
__tablename__ = "c_value_json"
ci_id = db.Column(db.Integer, db.ForeignKey('c_cis.id'), nullable=False)
attr_id = db.Column(db.Integer, db.ForeignKey('c_attributes.id'), nullable=False)
value = db.Column(db.JSON, nullable=False)
ci = db.relationship("CI", backref="c_value_json.ci_id")
attr = db.relationship("Attribute", backref="c_value_json.attr_id")
# history
class OperationRecord(Model):
__tablename__ = "c_records"