From 9adc5ad59e47512afa589995d4773dcff9ca45c0 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Wed, 7 Dec 2016 15:43:57 -0800 Subject: [PATCH] Adding last updated time (#569) --- lemur/endpoints/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lemur/endpoints/models.py b/lemur/endpoints/models.py index 7b16058c..0c6bd2c4 100644 --- a/lemur/endpoints/models.py +++ b/lemur/endpoints/models.py @@ -58,13 +58,14 @@ class Endpoint(db.Model): type = Column(String(128)) active = Column(Boolean, default=True) port = Column(Integer) - date_created = Column(DateTime, PassiveDefault(func.now()), nullable=False) policy_id = Column(Integer, ForeignKey('policy.id')) policy = relationship('Policy', backref='endpoint') certificate_id = Column(Integer, ForeignKey('certificates.id')) source_id = Column(Integer, ForeignKey('sources.id')) sensitive = Column(Boolean, default=False) 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 def issues(self):