"""Initial migration

Revision ID: 7c1e00c61cc7
Revises: 
Create Date: 2020-08-09 14:45:49.127980

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '7c1e00c61cc7'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('api_keys',
    sa.Column('key', sa.Text(), nullable=False),
    sa.Column('is_admin', sa.Boolean(), nullable=False),
    sa.Column('creator', sa.BigInteger(), nullable=True),
    sa.PrimaryKeyConstraint('key')
    )
    op.create_table('short_urls',
    sa.Column('short_code', sa.Text(), nullable=False),
    sa.Column('long_url', sa.Text(), nullable=False),
    sa.Column('creator', sa.BigInteger(), nullable=False),
    sa.Column('creation_date', sa.DateTime(), nullable=False),
    sa.Column('notes', sa.Text(), nullable=True),
    sa.Column('clicks', sa.Integer(), nullable=False),
    sa.PrimaryKeyConstraint('short_code')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('short_urls')
    op.drop_table('api_keys')
    # ### end Alembic commands ###
