I tried to change in Alembic but when I try to run Alembic current I got error. I'm new in alembic, please tell me why I get this error and how can I solve it?
I can see alembic.ini
in migration folder and also revision identifiers, used by Alembic and everything seems fine.
$alembic current
No handlers could be found for logger "alembic.util"
FAILED: No config file 'alembic.ini' found, or file has no '[alembic]' section
20c921506336_.py
:
"""empty message
Revision ID: 20c921506336
Revises: None
Create Date: 2015-01-30 16:28:38.981023
"""
# revision identifiers, used by Alembic.
revision = '20c921506336'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_table('user',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=50), nullable=True),
sa.Column('email', sa.String(length=50), nullable=True),
sa.Column('age', sa.Integer(), nullable=True),
sa.Column('bestfriend_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['bestfriend_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_index(u'ix_user_age', 'user', ['age'], unique=True)
op.create_index(u'ix_user_email', 'user', ['email'], unique=True)
op.create_index(u'ix_user_name', 'user', ['name'], unique=True)
op.create_table('friends',
sa.Column('user_id', sa.Integer(), nullable=True),
sa.Column('friend_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['friend_id'], ['user.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], )
)
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_table('friends')
op.drop_index(u'ix_user_name', table_name='user')
op.drop_index(u'ix_user_email', table_name='user')
op.drop_index(u'ix_user_age', table_name='user')
op.drop_table('user')
### end Alembic commands ###