python function not executed

Issue #385 closed
bin381
created an issue
revision = '894c4ad1e760'
down_revision = '95b9fa751136'

from alembic import op
import sqlalchemy as sa
import random


def random_value():
    return random.random()

def upgrade():
    op.add_column('user', sa.Column('token', sa.String(), nullable=True,default=random_value))


def downgrade():
    op.drop_column('user', 'token')

http://docs.sqlalchemy.org/en/latest/core/defaults.html#python-executed-functions From the doc,it shows that it can execute a python function where insert or update. But,In fact the column 'token' is still Null