25 lines
1.1 KiB
Python
25 lines
1.1 KiB
Python
from sqlalchemy import Column, Integer, String, Date, UniqueConstraint, Numeric, Text
|
|
|
|
from core.extensions import db
|
|
|
|
|
|
class LocalMaterial(db.Model):
|
|
__tablename__ = 'LOCAL_MATERIAL'
|
|
id = Column('ID', Integer, primary_key=True)
|
|
name = Column('NAME', String(128), default='', comment='名称')
|
|
city = Column('CITY', String(128), default='', comment='地市')
|
|
county = Column('COUNTY', String(128), default='', comment='区县')
|
|
material_id = Column('MATERIAL_ID', String(128), comment='材料id')
|
|
spec = Column('SPEC', String(128), default='', comment='规格')
|
|
unit = Column('UNIT', String(128), default='', comment='单位')
|
|
price = Column('PRICE', Numeric(16, 4), default=0, comment='价格')
|
|
price_without_tax = Column('PRICE_WITHOUT_TAX', Numeric(16, 4), default=0, comment='除税价')
|
|
date = Column('DATE', Date, comment='日期')
|
|
position = Column('POSITION', String(256), comment='位置')
|
|
remark = Column('REMARK', Text, comment='备注')
|
|
|
|
__table_args__ = (
|
|
UniqueConstraint(name, spec, city, county, date, name='Idx_key'),
|
|
{'comment': '地材'},
|
|
)
|