[update] change meta_project_info to project_meta & alter table project_meta column cycle type string to jsonb
This commit is contained in:
@@ -6,11 +6,11 @@ from sqlalchemy.dialects.postgresql import JSONB
|
||||
from .base import Base
|
||||
|
||||
class MetaProjectInfo(Base):
|
||||
__tablename__ = "meta_project_info"
|
||||
__tablename__ = "project_meta"
|
||||
|
||||
id = Column(Integer, primary_key=True)
|
||||
project = Column(String(36))
|
||||
cycle = Column(String)
|
||||
cycle = Column(JSONB)
|
||||
task = Column(JSONB)
|
||||
serial_number = Column(Integer)
|
||||
deleted = Column(Boolean, default = False)
|
||||
@@ -259,13 +259,13 @@ class Project(threading.Thread):
|
||||
self.log_verbose('file name ' + task_info['file_name'])
|
||||
|
||||
if instruction_set != None and self.get_device_parameter_set(action.target) != None:
|
||||
if action.type == 'start':
|
||||
self._count += 1
|
||||
for instruction in instruction_set:
|
||||
print('instruction 1', device, instruction, datetime.now())
|
||||
args = list(map(lambda arg: task_info[arg], instruction['arguments']))
|
||||
target=getattr(device, instruction['method'])(*args)
|
||||
print('instruction 2', device, instruction, datetime.now())
|
||||
if action.type == 'start':
|
||||
self._count += 1
|
||||
|
||||
delay_time += (time() - now)
|
||||
|
||||
|
||||
@@ -553,7 +553,7 @@ class DataBaseProcess(Process):
|
||||
return True
|
||||
|
||||
def project_insert(self, device_id, _data):
|
||||
sql_str = 'INSERT INTO "public"."meta_project_info" ('
|
||||
sql_str = 'INSERT INTO "public"."project_meta" ('
|
||||
sql_set = []
|
||||
for item in _data.keys():
|
||||
sql_str = sql_str + str(item) + ', '
|
||||
|
||||
@@ -34,7 +34,7 @@ from biopro.api.device import DeviceAPI
|
||||
from biopro.project.project_manager import ProjectManager
|
||||
from biopro.db.base import Base, Session, engine
|
||||
from biopro.db.project_report import ProjectReport
|
||||
from biopro.db.meta_project_info import MetaProjectInfo
|
||||
from biopro.db.project_meta import MetaProjectInfo
|
||||
|
||||
|
||||
_RUNTIME_COMPILE = False
|
||||
|
||||
Reference in New Issue
Block a user