sqlalchemy.exc.UnboundExecutionError: Table object 'responsibles' is not bound to an Engine or Connection

Viewed 5525

I'm trying to migrate a table with SQLAlchemy Migrate, but I'm getting this error:

sqlalchemy.exc.UnboundExecutionError: Table object 'responsibles' is not bound to an Engine or Connection.  Execution can not proceed without a database to execute against.

When I run:

python manage.py test

This is my migration file:

from sqlalchemy import *
from migrate import *

meta = MetaData()

responsibles = Table(
    'responsibles', meta,
    Column('id', Integer, primary_key=True),
    Column('breakdown_type', String(255)),
    Column('breakdown_name', String(500)),
    Column('email', String(255)),
    Column('name', String(255)),
)

def upgrade(migrate_engine):
    # Upgrade operations go here. Don't create your own engine; bind
    # migrate_engine to your metadata
    responsibles.create()

def downgrade(migrate_engine):
    # Operations to reverse the above upgrade go here.
    responsibles.drop()
2 Answers
Related