"""Add GithubRepository table

Revision ID: d6a7fdeab59b
Revises: 4524b64aef6b
Create Date: 2021-04-22 22:24:08.683196

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'd6a7fdeab59b'
down_revision = '4524b64aef6b'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('github_repository',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('full_name', sa.String(), nullable=False),
    sa.Column('html_url', sa.String(), nullable=False),
    sa.Column('url', sa.String(), nullable=False),
    sa.Column('description', sa.String(), nullable=True),
    sa.Column('owner_avatar_url', sa.String(), nullable=False),
    sa.Column('langauge', sa.String(), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.user_id'], name=op.f('fk_github_repository_user_id_user'), ondelete='NO ACTION'),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_github_repository')),
    sa.UniqueConstraint('full_name', name=op.f('uq_github_repository_full_name')),
    sa.UniqueConstraint('html_url', name=op.f('uq_github_repository_html_url')),
    sa.UniqueConstraint('url', name=op.f('uq_github_repository_url'))
    )
    # ### end Alembic commands ###


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