I am using PostgreSQL and Alembic for migration. When I added new column to
my User table Alembic generated migration with the following script:
from alembic import opimport sqlalchemy as saimport 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')
What I actually want to do is autogenerating the value of token by the
generate_toke function for existing data in my DB.
Is there a solution?
Alembic`s onwer Michael Bayer redirect me there
https://bitbucket.org/zzzeek/alembic/issues/383/set-the-value-of-column-when-upgrading
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.