what's "won't work" ?  error message?  stack trace ?  silent failure (if so 
what does SQL output say?)


On Feb 21, 2013, at 4:21 PM, junepeach <juneyh...@gmail.com> wrote:

> When run 'alembic upgrade head', the below won't work:
> ----
> 
> revision = '2e76fbbd703c'
> down_revision = None
> 
> from alembic import op
> import sqlalchemy as sa
> 
> def upgrade():
>    op.create_table('test1',
>    sa.Column('id', sa.Integer(), nullable=False),
>    sa.PrimaryKeyConstraint('id'))
> 
>    op.create_table('test2',
>    sa.Column('id', sa.String(length=20), nullable=False),
>    sa.Column('type_id', sa.Integer(), nullable=False),
>    sa.Column('description', sa.TEXT(), nullable=True),
>    sa.Column('whattime', sa.DateTime(), nullable=True),
>    sa.ForeignKeyConstraint(['type_id'], ['test1.id'], ),
>    sa.PrimaryKeyConstraint('id'),
>    mysql_ENGINE='InnoDB',
>    mysql_DEFAULT_CHARSET='ascii')
> 
> def downgrade():
>    op.drop_table("test2")
>    op.drop_table("test1")
> ---
> But it will work if I removed 'sa.ForeignKeyConstraint(['type_id'], 
> ['test1.id'], ),', I don't know what causes that. My python and sqlelchemy 
> versions are:
> Python 2.7.3 (default, Sep 21 2012, 14:43:48)
> [GCC 4.4.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import sqlalchemy
>>>> print sqlalchemy.__version__
> 0.8.0b2
> 
> alembic==0.4.0
> 
> Is there a bug or something I need to change to make it working.
> 
> Thanks a lot.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to