"""notifications

Revision ID: 31be6cb7946f
Revises: b10d2926bf0a
Create Date: 2019-11-03 16:42:42.850600

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '31be6cb7946f'
down_revision = 'b10d2926bf0a'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('notifications',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('accion', sa.String(length=50), nullable=True),
    sa.Column('other_user', sa.String(length=50), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_notifications_timestamp'), 'notifications', ['timestamp'], unique=False)
    op.drop_constraint('comments_ibfk_1', 'comments', type_='foreignkey')
    op.drop_constraint('comments_ibfk_2', 'comments', type_='foreignkey')
    op.create_foreign_key(None, 'comments', 'user', ['user_id'], ['id'], ondelete='CASCADE')
    op.create_foreign_key(None, 'comments', 'post', ['post_id'], ['id'], ondelete='CASCADE')
    op.drop_constraint('likes_ibfk_2', 'likes', type_='foreignkey')
    op.drop_constraint('likes_ibfk_1', 'likes', type_='foreignkey')
    op.create_foreign_key(None, 'likes', 'post', ['post_id'], ['id'], ondelete='CASCADE')
    op.create_foreign_key(None, 'likes', 'user', ['user_id'], ['id'], ondelete='CASCADE')
    op.drop_constraint('post_ibfk_1', 'post', type_='foreignkey')
    op.create_foreign_key(None, 'post', 'user', ['user_id'], ['id'], ondelete='CASCADE')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'post', type_='foreignkey')
    op.create_foreign_key('post_ibfk_1', 'post', 'user', ['user_id'], ['id'])
    op.drop_constraint(None, 'likes', type_='foreignkey')
    op.drop_constraint(None, 'likes', type_='foreignkey')
    op.create_foreign_key('likes_ibfk_1', 'likes', 'post', ['post_id'], ['id'])
    op.create_foreign_key('likes_ibfk_2', 'likes', 'user', ['user_id'], ['id'])
    op.drop_constraint(None, 'comments', type_='foreignkey')
    op.drop_constraint(None, 'comments', type_='foreignkey')
    op.create_foreign_key('comments_ibfk_2', 'comments', 'user', ['user_id'], ['id'])
    op.create_foreign_key('comments_ibfk_1', 'comments', 'post', ['post_id'], ['id'])
    op.drop_index(op.f('ix_notifications_timestamp'), table_name='notifications')
    op.drop_table('notifications')
    # ### end Alembic commands ###

3dfceb055c56e2591f88062eab0c63a1c4996196
<mask token>


def upgrade():
    op.create_table('notifications', sa.Column('id', sa.Integer(), nullable
        =False), sa.Column('user_id', sa.Integer(), nullable=True), sa.
        Column('accion', sa.String(length=50), nullable=True), sa.Column(
        'other_user', sa.String(length=50), nullable=True), sa.Column(
        'timestamp', sa.DateTime(), nullable=True), sa.ForeignKeyConstraint
        (['user_id'], ['user.id'], ondelete='CASCADE'), sa.
        PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_notifications_timestamp'), 'notifications', [
        'timestamp'], unique=False)
    op.drop_constraint('comments_ibfk_1', 'comments', type_='foreignkey')
    op.drop_constraint('comments_ibfk_2', 'comments', type_='foreignkey')
    op.create_foreign_key(None, 'comments', 'user', ['user_id'], ['id'],
        ondelete='CASCADE')
    op.create_foreign_key(None, 'comments', 'post', ['post_id'], ['id'],
        ondelete='CASCADE')
    op.drop_constraint('likes_ibfk_2', 'likes', type_='foreignkey')
    op.drop_constraint('likes_ibfk_1', 'likes', type_='foreignkey')
    op.create_foreign_key(None, 'likes', 'post', ['post_id'], ['id'],
        ondelete='CASCADE')
    op.create_foreign_key(None, 'likes', 'user', ['user_id'], ['id'],
        ondelete='CASCADE')
    op.drop_constraint('post_ibfk_1', 'post', type_='foreignkey')
    op.create_foreign_key(None, 'post', 'user', ['user_id'], ['id'],
        ondelete='CASCADE')


<mask token>

<mask token>


def upgrade():
    op.create_table('notifications', sa.Column('id', sa.Integer(), nullable
        =False), sa.Column('user_id', sa.Integer(), nullable=True), sa.
        Column('accion', sa.String(length=50), nullable=True), sa.Column(
        'other_user', sa.String(length=50), nullable=True), sa.Column(
        'timestamp', sa.DateTime(), nullable=True), sa.ForeignKeyConstraint
        (['user_id'], ['user.id'], ondelete='CASCADE'), sa.
        PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_notifications_timestamp'), 'notifications', [
        'timestamp'], unique=False)
    op.drop_constraint('comments_ibfk_1', 'comments', type_='foreignkey')
    op.drop_constraint('comments_ibfk_2', 'comments', type_='foreignkey')
    op.create_foreign_key(None, 'comments', 'user', ['user_id'], ['id'],
        ondelete='CASCADE')
    op.create_foreign_key(None, 'comments', 'post', ['post_id'], ['id'],
        ondelete='CASCADE')
    op.drop_constraint('likes_ibfk_2', 'likes', type_='foreignkey')
    op.drop_constraint('likes_ibfk_1', 'likes', type_='foreignkey')
    op.create_foreign_key(None, 'likes', 'post', ['post_id'], ['id'],
        ondelete='CASCADE')
    op.create_foreign_key(None, 'likes', 'user', ['user_id'], ['id'],
        ondelete='CASCADE')
    op.drop_constraint('post_ibfk_1', 'post', type_='foreignkey')
    op.create_foreign_key(None, 'post', 'user', ['user_id'], ['id'],
        ondelete='CASCADE')


def downgrade():
    op.drop_constraint(None, 'post', type_='foreignkey')
    op.create_foreign_key('post_ibfk_1', 'post', 'user', ['user_id'], ['id'])
    op.drop_constraint(None, 'likes', type_='foreignkey')
    op.drop_constraint(None, 'likes', type_='foreignkey')
    op.create_foreign_key('likes_ibfk_1', 'likes', 'post', ['post_id'], ['id'])
    op.create_foreign_key('likes_ibfk_2', 'likes', 'user', ['user_id'], ['id'])
    op.drop_constraint(None, 'comments', type_='foreignkey')
    op.drop_constraint(None, 'comments', type_='foreignkey')
    op.create_foreign_key('comments_ibfk_2', 'comments', 'user', ['user_id'
        ], ['id'])
    op.create_foreign_key('comments_ibfk_1', 'comments', 'post', ['post_id'
        ], ['id'])
    op.drop_index(op.f('ix_notifications_timestamp'), table_name=
        'notifications')
    op.drop_table('notifications')

<mask token>
revision = '31be6cb7946f'
down_revision = 'b10d2926bf0a'
branch_labels = None
depends_on = None


def upgrade():
    op.create_table('notifications', sa.Column('id', sa.Integer(), nullable
        =False), sa.Column('user_id', sa.Integer(), nullable=True), sa.
        Column('accion', sa.String(length=50), nullable=True), sa.Column(
        'other_user', sa.String(length=50), nullable=True), sa.Column(
        'timestamp', sa.DateTime(), nullable=True), sa.ForeignKeyConstraint
        (['user_id'], ['user.id'], ondelete='CASCADE'), sa.
        PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_notifications_timestamp'), 'notifications', [
        'timestamp'], unique=False)
    op.drop_constraint('comments_ibfk_1', 'comments', type_='foreignkey')
    op.drop_constraint('comments_ibfk_2', 'comments', type_='foreignkey')
    op.create_foreign_key(None, 'comments', 'user', ['user_id'], ['id'],
        ondelete='CASCADE')
    op.create_foreign_key(None, 'comments', 'post', ['post_id'], ['id'],
        ondelete='CASCADE')
    op.drop_constraint('likes_ibfk_2', 'likes', type_='foreignkey')
    op.drop_constraint('likes_ibfk_1', 'likes', type_='foreignkey')
    op.create_foreign_key(None, 'likes', 'post', ['post_id'], ['id'],
        ondelete='CASCADE')
    op.create_foreign_key(None, 'likes', 'user', ['user_id'], ['id'],
        ondelete='CASCADE')
    op.drop_constraint('post_ibfk_1', 'post', type_='foreignkey')
    op.create_foreign_key(None, 'post', 'user', ['user_id'], ['id'],
        ondelete='CASCADE')


def downgrade():
    op.drop_constraint(None, 'post', type_='foreignkey')
    op.create_foreign_key('post_ibfk_1', 'post', 'user', ['user_id'], ['id'])
    op.drop_constraint(None, 'likes', type_='foreignkey')
    op.drop_constraint(None, 'likes', type_='foreignkey')
    op.create_foreign_key('likes_ibfk_1', 'likes', 'post', ['post_id'], ['id'])
    op.create_foreign_key('likes_ibfk_2', 'likes', 'user', ['user_id'], ['id'])
    op.drop_constraint(None, 'comments', type_='foreignkey')
    op.drop_constraint(None, 'comments', type_='foreignkey')
    op.create_foreign_key('comments_ibfk_2', 'comments', 'user', ['user_id'
        ], ['id'])
    op.create_foreign_key('comments_ibfk_1', 'comments', 'post', ['post_id'
        ], ['id'])
    op.drop_index(op.f('ix_notifications_timestamp'), table_name=
        'notifications')
    op.drop_table('notifications')

<mask token>
from alembic import op
import sqlalchemy as sa
revision = '31be6cb7946f'
down_revision = 'b10d2926bf0a'
branch_labels = None
depends_on = None


def upgrade():
    op.create_table('notifications', sa.Column('id', sa.Integer(), nullable
        =False), sa.Column('user_id', sa.Integer(), nullable=True), sa.
        Column('accion', sa.String(length=50), nullable=True), sa.Column(
        'other_user', sa.String(length=50), nullable=True), sa.Column(
        'timestamp', sa.DateTime(), nullable=True), sa.ForeignKeyConstraint
        (['user_id'], ['user.id'], ondelete='CASCADE'), sa.
        PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_notifications_timestamp'), 'notifications', [
        'timestamp'], unique=False)
    op.drop_constraint('comments_ibfk_1', 'comments', type_='foreignkey')
    op.drop_constraint('comments_ibfk_2', 'comments', type_='foreignkey')
    op.create_foreign_key(None, 'comments', 'user', ['user_id'], ['id'],
        ondelete='CASCADE')
    op.create_foreign_key(None, 'comments', 'post', ['post_id'], ['id'],
        ondelete='CASCADE')
    op.drop_constraint('likes_ibfk_2', 'likes', type_='foreignkey')
    op.drop_constraint('likes_ibfk_1', 'likes', type_='foreignkey')
    op.create_foreign_key(None, 'likes', 'post', ['post_id'], ['id'],
        ondelete='CASCADE')
    op.create_foreign_key(None, 'likes', 'user', ['user_id'], ['id'],
        ondelete='CASCADE')
    op.drop_constraint('post_ibfk_1', 'post', type_='foreignkey')
    op.create_foreign_key(None, 'post', 'user', ['user_id'], ['id'],
        ondelete='CASCADE')


def downgrade():
    op.drop_constraint(None, 'post', type_='foreignkey')
    op.create_foreign_key('post_ibfk_1', 'post', 'user', ['user_id'], ['id'])
    op.drop_constraint(None, 'likes', type_='foreignkey')
    op.drop_constraint(None, 'likes', type_='foreignkey')
    op.create_foreign_key('likes_ibfk_1', 'likes', 'post', ['post_id'], ['id'])
    op.create_foreign_key('likes_ibfk_2', 'likes', 'user', ['user_id'], ['id'])
    op.drop_constraint(None, 'comments', type_='foreignkey')
    op.drop_constraint(None, 'comments', type_='foreignkey')
    op.create_foreign_key('comments_ibfk_2', 'comments', 'user', ['user_id'
        ], ['id'])
    op.create_foreign_key('comments_ibfk_1', 'comments', 'post', ['post_id'
        ], ['id'])
    op.drop_index(op.f('ix_notifications_timestamp'), table_name=
        'notifications')
    op.drop_table('notifications')

"""notifications

Revision ID: 31be6cb7946f
Revises: b10d2926bf0a
Create Date: 2019-11-03 16:42:42.850600

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '31be6cb7946f'
down_revision = 'b10d2926bf0a'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('notifications',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('accion', sa.String(length=50), nullable=True),
    sa.Column('other_user', sa.String(length=50), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_notifications_timestamp'), 'notifications', ['timestamp'], unique=False)
    op.drop_constraint('comments_ibfk_1', 'comments', type_='foreignkey')
    op.drop_constraint('comments_ibfk_2', 'comments', type_='foreignkey')
    op.create_foreign_key(None, 'comments', 'user', ['user_id'], ['id'], ondelete='CASCADE')
    op.create_foreign_key(None, 'comments', 'post', ['post_id'], ['id'], ondelete='CASCADE')
    op.drop_constraint('likes_ibfk_2', 'likes', type_='foreignkey')
    op.drop_constraint('likes_ibfk_1', 'likes', type_='foreignkey')
    op.create_foreign_key(None, 'likes', 'post', ['post_id'], ['id'], ondelete='CASCADE')
    op.create_foreign_key(None, 'likes', 'user', ['user_id'], ['id'], ondelete='CASCADE')
    op.drop_constraint('post_ibfk_1', 'post', type_='foreignkey')
    op.create_foreign_key(None, 'post', 'user', ['user_id'], ['id'], ondelete='CASCADE')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'post', type_='foreignkey')
    op.create_foreign_key('post_ibfk_1', 'post', 'user', ['user_id'], ['id'])
    op.drop_constraint(None, 'likes', type_='foreignkey')
    op.drop_constraint(None, 'likes', type_='foreignkey')
    op.create_foreign_key('likes_ibfk_1', 'likes', 'post', ['post_id'], ['id'])
    op.create_foreign_key('likes_ibfk_2', 'likes', 'user', ['user_id'], ['id'])
    op.drop_constraint(None, 'comments', type_='foreignkey')
    op.drop_constraint(None, 'comments', type_='foreignkey')
    op.create_foreign_key('comments_ibfk_2', 'comments', 'user', ['user_id'], ['id'])
    op.create_foreign_key('comments_ibfk_1', 'comments', 'post', ['post_id'], ['id'])
    op.drop_index(op.f('ix_notifications_timestamp'), table_name='notifications')
    op.drop_table('notifications')
    # ### end Alembic commands ###
