"""Add Event

Revision ID: 2c380be0a31e
Revises: 3265d2120c82
Create Date: 2014-04-04 13:06:03.094082

"""

# revision identifiers, used by Alembic.
revision = '2c380be0a31e'
down_revision = '3265d2120c82'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'event',
        sa.Column('id', sa.GUID(), nullable=False),
        sa.Column('type', sa.String(length=32), nullable=False),
        sa.Column('item_id', sa.GUID(), nullable=False),
        sa.Column('date_created', sa.DateTime(), nullable=True),
        sa.Column('date_modified', sa.DateTime(), nullable=True),
        sa.Column('data', sa.JSONEncodedDict(), nullable=True),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('type', 'item_id', name='unq_event_key')
    )


def downgrade():
    op.drop_table('event')
