diff --git a/Dockerfile b/Dockerfile index ed4bdb0..94f1a14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,4 +9,5 @@ WORKDIR /root COPY thermostat.py /root/ COPY migrate_db.sh /root/ COPY entrypoint.sh /root/ +ENV FLASK_APP thermostat.py ENTRYPOINT ["/root/entrypoint.sh"] diff --git a/thermostat.py b/thermostat.py index 43733b2..4a28e37 100644 --- a/thermostat.py +++ b/thermostat.py @@ -76,7 +76,7 @@ class Set_mode(db.Model): __tablename__ = "set_mode" name = db.Column(db.String, primary_key=True, server_default='mode', nullable=False) value = db.Column(db.String, nullable=False) - timestamp = db.Column(db.DateTime, server_default=text("CURRENT_TIMESTAMP"), nullable=False) + timestamp = db.Column(db.DateTime, server_default=db.text("CURRENT_TIMESTAMP"), nullable=False) Set_mode_resource_fields = { 'name': fields.String(description='mode type'),