"""Adding the notification models.

Revision ID: 5240e406ddaa
Revises: 29e5e1f3afaa
Create Date: 2012-06-27 10:14:46.178907

"""

# revision identifiers, used by Alembic.
revision = '5240e406ddaa'
down_revision = '29e5e1f3afaa'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('notification_items',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('type', sa.String(length=50), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('game_start_notifications',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('game_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['game_id'], ['games.id'], ),
    sa.ForeignKeyConstraint(['id'], ['notification_items.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('game_invite_notifications',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('player_id', sa.Integer(), nullable=True),
    sa.Column('game_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['game_id'], ['games.id'], ),
    sa.ForeignKeyConstraint(['id'], ['notification_items.id'], ),
    sa.ForeignKeyConstraint(['player_id'], ['players.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('notifications',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('player_id', sa.Integer(), nullable=True),
    sa.Column('notification_item_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['notification_item_id'], ['notification_items.id'], ),
    sa.ForeignKeyConstraint(['player_id'], ['players.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('notifications')
    op.drop_table('game_invite_notifications')
    op.drop_table('game_start_notifications')
    op.drop_table('notification_items')
    ### end Alembic commands ###

ba8b1a9f3c2f4b18ed10dd841ccfc98a9e40f64b
<mask token>


def upgrade():
    op.create_table('notification_items', sa.Column('id', sa.Integer(),
        nullable=False), sa.Column('created', sa.DateTime(), nullable=True),
        sa.Column('type', sa.String(length=50), nullable=True), sa.
        PrimaryKeyConstraint('id'))
    op.create_table('game_start_notifications', sa.Column('id', sa.Integer(
        ), nullable=False), sa.Column('game_id', sa.Integer(), nullable=
        True), sa.ForeignKeyConstraint(['game_id'], ['games.id']), sa.
        ForeignKeyConstraint(['id'], ['notification_items.id']), sa.
        PrimaryKeyConstraint('id'))
    op.create_table('game_invite_notifications', sa.Column('id', sa.Integer
        (), nullable=False), sa.Column('player_id', sa.Integer(), nullable=
        True), sa.Column('game_id', sa.Integer(), nullable=True), sa.
        ForeignKeyConstraint(['game_id'], ['games.id']), sa.
        ForeignKeyConstraint(['id'], ['notification_items.id']), sa.
        ForeignKeyConstraint(['player_id'], ['players.id']), sa.
        PrimaryKeyConstraint('id'))
    op.create_table('notifications', sa.Column('id', sa.Integer(), nullable
        =False), sa.Column('player_id', sa.Integer(), nullable=True), sa.
        Column('notification_item_id', sa.Integer(), nullable=True), sa.
        ForeignKeyConstraint(['notification_item_id'], [
        'notification_items.id']), sa.ForeignKeyConstraint(['player_id'], [
        'players.id']), sa.PrimaryKeyConstraint('id'))


<mask token>

<mask token>


def upgrade():
    op.create_table('notification_items', sa.Column('id', sa.Integer(),
        nullable=False), sa.Column('created', sa.DateTime(), nullable=True),
        sa.Column('type', sa.String(length=50), nullable=True), sa.
        PrimaryKeyConstraint('id'))
    op.create_table('game_start_notifications', sa.Column('id', sa.Integer(
        ), nullable=False), sa.Column('game_id', sa.Integer(), nullable=
        True), sa.ForeignKeyConstraint(['game_id'], ['games.id']), sa.
        ForeignKeyConstraint(['id'], ['notification_items.id']), sa.
        PrimaryKeyConstraint('id'))
    op.create_table('game_invite_notifications', sa.Column('id', sa.Integer
        (), nullable=False), sa.Column('player_id', sa.Integer(), nullable=
        True), sa.Column('game_id', sa.Integer(), nullable=True), sa.
        ForeignKeyConstraint(['game_id'], ['games.id']), sa.
        ForeignKeyConstraint(['id'], ['notification_items.id']), sa.
        ForeignKeyConstraint(['player_id'], ['players.id']), sa.
        PrimaryKeyConstraint('id'))
    op.create_table('notifications', sa.Column('id', sa.Integer(), nullable
        =False), sa.Column('player_id', sa.Integer(), nullable=True), sa.
        Column('notification_item_id', sa.Integer(), nullable=True), sa.
        ForeignKeyConstraint(['notification_item_id'], [
        'notification_items.id']), sa.ForeignKeyConstraint(['player_id'], [
        'players.id']), sa.PrimaryKeyConstraint('id'))


def downgrade():
    op.drop_table('notifications')
    op.drop_table('game_invite_notifications')
    op.drop_table('game_start_notifications')
    op.drop_table('notification_items')

<mask token>
revision = '5240e406ddaa'
down_revision = '29e5e1f3afaa'
<mask token>


def upgrade():
    op.create_table('notification_items', sa.Column('id', sa.Integer(),
        nullable=False), sa.Column('created', sa.DateTime(), nullable=True),
        sa.Column('type', sa.String(length=50), nullable=True), sa.
        PrimaryKeyConstraint('id'))
    op.create_table('game_start_notifications', sa.Column('id', sa.Integer(
        ), nullable=False), sa.Column('game_id', sa.Integer(), nullable=
        True), sa.ForeignKeyConstraint(['game_id'], ['games.id']), sa.
        ForeignKeyConstraint(['id'], ['notification_items.id']), sa.
        PrimaryKeyConstraint('id'))
    op.create_table('game_invite_notifications', sa.Column('id', sa.Integer
        (), nullable=False), sa.Column('player_id', sa.Integer(), nullable=
        True), sa.Column('game_id', sa.Integer(), nullable=True), sa.
        ForeignKeyConstraint(['game_id'], ['games.id']), sa.
        ForeignKeyConstraint(['id'], ['notification_items.id']), sa.
        ForeignKeyConstraint(['player_id'], ['players.id']), sa.
        PrimaryKeyConstraint('id'))
    op.create_table('notifications', sa.Column('id', sa.Integer(), nullable
        =False), sa.Column('player_id', sa.Integer(), nullable=True), sa.
        Column('notification_item_id', sa.Integer(), nullable=True), sa.
        ForeignKeyConstraint(['notification_item_id'], [
        'notification_items.id']), sa.ForeignKeyConstraint(['player_id'], [
        'players.id']), sa.PrimaryKeyConstraint('id'))


def downgrade():
    op.drop_table('notifications')
    op.drop_table('game_invite_notifications')
    op.drop_table('game_start_notifications')
    op.drop_table('notification_items')

<mask token>
revision = '5240e406ddaa'
down_revision = '29e5e1f3afaa'
from alembic import op
import sqlalchemy as sa


def upgrade():
    op.create_table('notification_items', sa.Column('id', sa.Integer(),
        nullable=False), sa.Column('created', sa.DateTime(), nullable=True),
        sa.Column('type', sa.String(length=50), nullable=True), sa.
        PrimaryKeyConstraint('id'))
    op.create_table('game_start_notifications', sa.Column('id', sa.Integer(
        ), nullable=False), sa.Column('game_id', sa.Integer(), nullable=
        True), sa.ForeignKeyConstraint(['game_id'], ['games.id']), sa.
        ForeignKeyConstraint(['id'], ['notification_items.id']), sa.
        PrimaryKeyConstraint('id'))
    op.create_table('game_invite_notifications', sa.Column('id', sa.Integer
        (), nullable=False), sa.Column('player_id', sa.Integer(), nullable=
        True), sa.Column('game_id', sa.Integer(), nullable=True), sa.
        ForeignKeyConstraint(['game_id'], ['games.id']), sa.
        ForeignKeyConstraint(['id'], ['notification_items.id']), sa.
        ForeignKeyConstraint(['player_id'], ['players.id']), sa.
        PrimaryKeyConstraint('id'))
    op.create_table('notifications', sa.Column('id', sa.Integer(), nullable
        =False), sa.Column('player_id', sa.Integer(), nullable=True), sa.
        Column('notification_item_id', sa.Integer(), nullable=True), sa.
        ForeignKeyConstraint(['notification_item_id'], [
        'notification_items.id']), sa.ForeignKeyConstraint(['player_id'], [
        'players.id']), sa.PrimaryKeyConstraint('id'))


def downgrade():
    op.drop_table('notifications')
    op.drop_table('game_invite_notifications')
    op.drop_table('game_start_notifications')
    op.drop_table('notification_items')

"""Adding the notification models.

Revision ID: 5240e406ddaa
Revises: 29e5e1f3afaa
Create Date: 2012-06-27 10:14:46.178907

"""

# revision identifiers, used by Alembic.
revision = '5240e406ddaa'
down_revision = '29e5e1f3afaa'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('notification_items',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('type', sa.String(length=50), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('game_start_notifications',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('game_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['game_id'], ['games.id'], ),
    sa.ForeignKeyConstraint(['id'], ['notification_items.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('game_invite_notifications',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('player_id', sa.Integer(), nullable=True),
    sa.Column('game_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['game_id'], ['games.id'], ),
    sa.ForeignKeyConstraint(['id'], ['notification_items.id'], ),
    sa.ForeignKeyConstraint(['player_id'], ['players.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('notifications',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('player_id', sa.Integer(), nullable=True),
    sa.Column('notification_item_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['notification_item_id'], ['notification_items.id'], ),
    sa.ForeignKeyConstraint(['player_id'], ['players.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('notifications')
    op.drop_table('game_invite_notifications')
    op.drop_table('game_start_notifications')
    op.drop_table('notification_items')
    ### end Alembic commands ###
