def upgrade():
op.create_table(
'projects',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=40), nullable=True),
sa.Column('notes', sa.String(length=254), nullable=True),
sa.Column('is_active', sa.Boolean(), nullable=True),
sa.PrimaryKeyConstraint('id', name=op.f('pk_projects')),
mysql_engine='InnoDB'
)
op.create_table(
'bom_items',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('project_id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=254), nullable=True),
sa.Column('notes', sa.String(length=254), nullable=True),
sa.Column('quantity', sa.Integer(), nullable=True),
sa.Column(
'unit_cost', sa.Numeric(precision=10, scale=4), nullable=True
),
sa.Column('url', sa.String(length=254), nullable=True),
sa.Column('is_active', sa.Boolean(), nullable=True),
sa.ForeignKeyConstraint(
['project_id'], ['projects.id'],
name=op.f('fk_bom_items_project_id_projects')
),
sa.PrimaryKeyConstraint('id', name=op.f('pk_bom_items')),
mysql_engine='InnoDB'
)
ceb73ddf66eb_add_project_and_bomitem_models.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录