"""Changed Views table name

Revision ID: 7f559bb24ca4
Revises: cc927fe47c8f
Create Date: 2021-08-20 23:20:31.959984

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "7f559bb24ca4"
down_revision = "cc927fe47c8f"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "views",
        sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
        sa.Column("url_id", sa.String(length=31), nullable=True),
        sa.ForeignKeyConstraint(
            ["url_id"],
            ["urls.id"],
        ),
        sa.PrimaryKeyConstraint("id"),
    )
    op.drop_table("view")
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "view",
        sa.Column("id", sa.INTEGER(), nullable=False),
        sa.Column("url_id", sa.VARCHAR(length=31), nullable=True),
        sa.ForeignKeyConstraint(
            ["url_id"],
            ["urls.id"],
        ),
        sa.PrimaryKeyConstraint("id"),
    )
    op.drop_table("views")
    # ### end Alembic commands ###
