def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_table('category',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=64), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
)
op.add_column(u'posts', sa.Column('category_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'posts', 'category', ['category_id'], ['id'])
### end Alembic commands ###
评论列表
文章目录