1
私はPostgreSQLとAlembicを使って移行しています。私は私のユーザーテーブルに新しい列を追加するとアレンビックは、次のスクリプトでの移行を生成:テーブルをalembicでアップグレードする際に異なるカラム値を設定する
from alembic import op
import sqlalchemy as sa
import random
def generate_toke():
return random.random()
def upgrade():
op.add_column('user', sa.Column('token', sa.String(), nullable=True))
op.execute('some code here')
私は実際に私がゴール