Adding last updated time (#569)
This commit is contained in:
parent
f63ccd033d
commit
9adc5ad59e
|
@ -58,13 +58,14 @@ class Endpoint(db.Model):
|
||||||
type = Column(String(128))
|
type = Column(String(128))
|
||||||
active = Column(Boolean, default=True)
|
active = Column(Boolean, default=True)
|
||||||
port = Column(Integer)
|
port = Column(Integer)
|
||||||
date_created = Column(DateTime, PassiveDefault(func.now()), nullable=False)
|
|
||||||
policy_id = Column(Integer, ForeignKey('policy.id'))
|
policy_id = Column(Integer, ForeignKey('policy.id'))
|
||||||
policy = relationship('Policy', backref='endpoint')
|
policy = relationship('Policy', backref='endpoint')
|
||||||
certificate_id = Column(Integer, ForeignKey('certificates.id'))
|
certificate_id = Column(Integer, ForeignKey('certificates.id'))
|
||||||
source_id = Column(Integer, ForeignKey('sources.id'))
|
source_id = Column(Integer, ForeignKey('sources.id'))
|
||||||
sensitive = Column(Boolean, default=False)
|
sensitive = Column(Boolean, default=False)
|
||||||
source = relationship('Source', back_populates='endpoints')
|
source = relationship('Source', back_populates='endpoints')
|
||||||
|
last_updated = Column(DateTime, PassiveDefault(func.now()), onupdate=func.now(), nullable=False)
|
||||||
|
date_created = Column(DateTime, PassiveDefault(func.now()), nullable=False)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def issues(self):
|
def issues(self):
|
||||||
|
|
Loading…
Reference in New Issue