"""onion services

Revision ID: c3d6e95caa79
Revises: 56fbcfa1138c
Create Date: 2022-05-04 15:03:52.406674

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'c3d6e95caa79'
down_revision = '56fbcfa1138c'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('eotk',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('added', sa.DateTime(), nullable=False),
    sa.Column('updated', sa.DateTime(), nullable=False),
    sa.Column('deprecated', sa.DateTime(), nullable=True),
    sa.Column('deprecation_reason', sa.String(), nullable=True),
    sa.Column('destroyed', sa.DateTime(), nullable=True),
    sa.Column('group_id', sa.Integer(), nullable=False),
    sa.Column('instance_id', sa.String(length=100), nullable=True),
    sa.Column('region', sa.String(length=20), nullable=False),
    sa.ForeignKeyConstraint(['group_id'], ['group.id'], name=op.f('fk_eotk_group_id_group')),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_eotk'))
    )
    op.create_table('onion',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('description', sa.String(length=255), nullable=False),
    sa.Column('added', sa.DateTime(), nullable=False),
    sa.Column('updated', sa.DateTime(), nullable=False),
    sa.Column('destroyed', sa.DateTime(), nullable=True),
    sa.Column('group_id', sa.Integer(), nullable=False),
    sa.Column('domain_name', sa.String(length=255), nullable=False),
    sa.Column('onion_name', sa.String(length=56), nullable=False),
    sa.ForeignKeyConstraint(['group_id'], ['group.id'], name=op.f('fk_onion_group_id_group')),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_onion')),
    sa.UniqueConstraint('onion_name', name=op.f('uq_onion_onion_name'))
    )
    # ### end Alembic commands ###


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