1 ##############################################################################
2 # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 from __future__ import absolute_import
10 from sqlalchemy import Column
11 from sqlalchemy import Integer
12 from sqlalchemy import String
13 from sqlalchemy import Text
15 from api.database import Base
19 __tablename__ = 'tasks'
20 id = Column(Integer, primary_key=True)
21 task_id = Column(String(30))
22 status = Column(Integer)
23 error = Column(String(120))
25 details = Column(String(120))
28 return '<Task %r>' % Tasks.task_id
31 class AsyncTasks(Base):
32 __tablename__ = 'asynctasks'
33 id = Column(Integer, primary_key=True)
34 task_id = Column(String(30))
35 status = Column(Integer)
36 error = Column(String(120))
39 return '<Task %r>' % AsyncTasks.task_id