From a3f79987f300a6f3e35c9d55bae1c60e08e40736 Mon Sep 17 00:00:00 2001 From: DaryaDoronina Date: Fri, 20 Apr 2018 09:16:51 +0700 Subject: [PATCH] Fix datetime for postgres Postgres has no DATETIME type as other databases (sqllite, mysql, etc.). db.DateTime is supported by postgres as for other dbs and is converted for postgres to TIMESTAMP WITHOUT TIME ZONE. --- SpiderKeeper/app/spider/model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SpiderKeeper/app/spider/model.py b/SpiderKeeper/app/spider/model.py index 5376602b..c9ce66c9 100644 --- a/SpiderKeeper/app/spider/model.py +++ b/SpiderKeeper/app/spider/model.py @@ -153,9 +153,9 @@ class JobExecution(Base): project_id = db.Column(db.INTEGER, nullable=False, index=True) service_job_execution_id = db.Column(db.String(50), nullable=False, index=True) job_instance_id = db.Column(db.INTEGER, nullable=False, index=True) - create_time = db.Column(db.DATETIME) - start_time = db.Column(db.DATETIME) - end_time = db.Column(db.DATETIME) + create_time = db.Column(db.DateTime) + start_time = db.Column(db.DateTime) + end_time = db.Column(db.DateTime) running_status = db.Column(db.INTEGER, default=SpiderStatus.PENDING) running_on = db.Column(db.Text)