many improvements
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
from sqlalchemy import Column, DateTime, ForeignKey, Integer, String, Float, Boolean
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm import relationship
|
||||
from sqlalchemy.sql import func
|
||||
|
||||
Base = declarative_base()
|
||||
|
||||
class SingleShift(Base):
|
||||
__tablename__ = 'single_shift'
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
name = Column(String)
|
||||
length = Column(Float)
|
||||
balance_offset = Column(Float, nullable=True)
|
||||
balance_weighting = Column(Float)
|
||||
workers_required = Column(Float)
|
||||
assign_as_block = Column(Boolean)
|
||||
force_as_block = Column(Boolean)
|
||||
hard_constrain_shift = Column(Boolean)
|
||||
bank_holidays_only = Column(Boolean)
|
||||
constraint_id = Column(Integer, ForeignKey('shift_constraint.id'))
|
||||
|
||||
constraint = relationship('ShiftConstraint')
|
||||
|
||||
|
||||
class ShiftConstraint(Base):
|
||||
__tablename__ = 'shift_constraint'
|
||||
id = Column(Integer, primary_key=True)
|
||||
name = Column(String)
|
||||
options = Column(Integer, nullable=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user