"""create table models

Revision ID: a6c448d0edcd
Revises: 
Create Date: 2021-08-12 10:35:32.081332

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('tourist_attraction',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=50), nullable=False),
    sa.Column('category', sa.String(length=255), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_tourist_attraction_id'), 'tourist_attraction', ['id'], unique=False)
    op.create_table('address',
    sa.Column('tourist_attraction_id', sa.Integer(), nullable=False),
    sa.Column('subvillage', sa.String(length=255), nullable=True),
    sa.Column('village', sa.String(length=255), nullable=True),
    sa.Column('district', sa.String(length=255), nullable=True),
    sa.Column('regency', sa.String(length=255), nullable=True),
    sa.Column('province', sa.String(length=255), nullable=True),
    sa.ForeignKeyConstraint(['tourist_attraction_id'], ['tourist_attraction.id'], ),
    sa.PrimaryKeyConstraint('tourist_attraction_id')
    )
    op.create_table('location',
    sa.Column('tourist_attraction_id', sa.Integer(), nullable=False),
    sa.Column('latitude', sa.Float(), nullable=False),
    sa.Column('longitude', sa.Float(), nullable=False),
    sa.ForeignKeyConstraint(['tourist_attraction_id'], ['tourist_attraction.id'], ),
    sa.PrimaryKeyConstraint('tourist_attraction_id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('location')
    op.drop_table('address')
    op.drop_index(op.f('ix_tourist_attraction_id'), table_name='tourist_attraction')
    op.drop_table('tourist_attraction')
    # ### end Alembic commands ###
