Add apscheduler_jobs table to models
watcher-db-manage create_schema doesn't create apscheduler_jobs. Change-Id: I57327317aab0186b0ff641111b90e6f958f1e5fe Closes-Bug: #1783504
This commit is contained in:
@@ -23,8 +23,10 @@ from sqlalchemy import Boolean
|
|||||||
from sqlalchemy import Column
|
from sqlalchemy import Column
|
||||||
from sqlalchemy import DateTime
|
from sqlalchemy import DateTime
|
||||||
from sqlalchemy.ext.declarative import declarative_base
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
|
from sqlalchemy import Float
|
||||||
from sqlalchemy import ForeignKey
|
from sqlalchemy import ForeignKey
|
||||||
from sqlalchemy import Integer
|
from sqlalchemy import Integer
|
||||||
|
from sqlalchemy import LargeBinary
|
||||||
from sqlalchemy import Numeric
|
from sqlalchemy import Numeric
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm
|
||||||
from sqlalchemy import String
|
from sqlalchemy import String
|
||||||
@@ -294,3 +296,23 @@ class ActionDescription(Base):
|
|||||||
id = Column(Integer, primary_key=True)
|
id = Column(Integer, primary_key=True)
|
||||||
action_type = Column(String(255), nullable=False)
|
action_type = Column(String(255), nullable=False)
|
||||||
description = Column(String(255), nullable=False)
|
description = Column(String(255), nullable=False)
|
||||||
|
|
||||||
|
|
||||||
|
class APScheulerJob(Base):
|
||||||
|
"""Represents apscheduler jobs"""
|
||||||
|
|
||||||
|
__tablename__ = 'apscheduler_jobs'
|
||||||
|
__table_args__ = (
|
||||||
|
UniqueConstraint('id',
|
||||||
|
name="uniq_apscheduler_jobs0id"),
|
||||||
|
table_args()
|
||||||
|
)
|
||||||
|
id = Column(String(191), nullable=False, primary_key=True)
|
||||||
|
next_run_time = Column(Float(25), index=True)
|
||||||
|
job_state = Column(LargeBinary, nullable=False)
|
||||||
|
tag = Column(JSONEncodedDict(), nullable=True)
|
||||||
|
service_id = Column(Integer, ForeignKey('services.id'),
|
||||||
|
nullable=False)
|
||||||
|
|
||||||
|
service = orm.relationship(
|
||||||
|
Service, foreign_keys=service_id, lazy=None)
|
||||||
|
|||||||
Reference in New Issue
Block a user