3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Alembic]add_columnでbeforeとかafterしたいとき

Posted at

ちょっと泥臭いけど
model編集して吐かれたversionsのadd_columnを以下のように変更する

    with op.batch_alter_table('hoge_table', recreate='always') as batch_op:
        batch_op.add_column(sa.Column('fuga_column', mysql.TEXT(), nullable=True), insert_before='hoge_column')
    # op.add_column('hoge_table', sa.Column('fuga_column', mysql.TEXT(), nullable=True))

だれかautogenerateのときにこれ出す方法知ってたら教えて下さい

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?