class CIIndexValueDateTime(Model): __tablename__ = "c_value_index_datetime" 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.DateTime, nullable=False) ci = db.relationship("CI", backref="c_value_index_datetime.ci_id") attr = db.relationship("Attribute", backref="c_value_index_datetime.attr_id") __table_args__ = (db.Index("datetime_attr_value_index", "attr_id", "value"),)
class CIIndexValueText(Model): __tablename__ = "c_value_index_texts" 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.String(128), nullable=False) ci = db.relationship("CI", backref="c_value_index_texts.ci_id") attr = db.relationship("Attribute", backref="c_value_index_texts.attr_id") __table_args__ = (db.Index("text_attr_value_index", "attr_id", "value"),)