"""Add messages table
Revision ID: 7836665787cd
Revises: 0689a529bce0
Create Date: 2016-11-12 08:20:05.648069
"""
revision = '7836665787cd'
down_revision = '0689a529bce0'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('messages',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('nick', sa.String(), nullable=True),
sa.Column('channel', sa.String(), nullable=True),
sa.Column('message', sa.String(), nullable=True),
sa.Column('userhost', sa.String(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.drop_constraint(u'locations_nick_key', 'locations', type_='unique')
def downgrade():
op.create_unique_constraint(u'locations_nick_key', 'locations', ['nick'])
op.drop_table('messages')