"""empty message

Revision ID: 473794ed3043
Revises: 
Create Date: 2020-04-28 02:35:47.202036

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('company',
    sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('status', sa.Boolean(), nullable=True),
    sa.Column('created_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('removed_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('removed_at', sa.DateTime(), nullable=True),
    sa.Column('name', sa.VARCHAR(length=100), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('movie',
    sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('status', sa.Boolean(), nullable=True),
    sa.Column('created_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('removed_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('removed_at', sa.DateTime(), nullable=True),
    sa.Column('name', sa.VARCHAR(length=100), nullable=False),
    sa.Column('duration', sa.Integer(), nullable=False),
    sa.Column('gender', sa.VARCHAR(length=55), nullable=False),
    sa.Column('half_price', sa.Integer(), autoincrement=True, nullable=True),
    sa.Column('full_price', sa.Integer(), autoincrement=True, nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('headquarters',
    sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('status', sa.Boolean(), nullable=True),
    sa.Column('created_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('removed_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('removed_at', sa.DateTime(), nullable=True),
    sa.Column('company_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('city', sa.VARCHAR(length=100), nullable=False),
    sa.Column('state', sa.VARCHAR(length=100), nullable=False),
    sa.ForeignKeyConstraint(['company_id'], ['company.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('profile',
    sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('status', sa.Boolean(), nullable=True),
    sa.Column('created_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('removed_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('removed_at', sa.DateTime(), nullable=True),
    sa.Column('company_id', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('name', sa.VARCHAR(length=100), nullable=False),
    sa.Column('permission', postgresql.JSON(astext_type=sa.Text()), nullable=False),
    sa.Column('supreme', sa.BOOLEAN(), nullable=False),
    sa.ForeignKeyConstraint(['company_id'], ['company.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cinema',
    sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('status', sa.Boolean(), nullable=True),
    sa.Column('created_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('removed_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('removed_at', sa.DateTime(), nullable=True),
    sa.Column('company_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('name', sa.VARCHAR(length=100), nullable=False),
    sa.Column('qt_salas', sa.Integer(), nullable=False),
    sa.Column('headquarters', postgresql.UUID(as_uuid=True), nullable=False),
    sa.ForeignKeyConstraint(['company_id'], ['company.id'], ),
    sa.ForeignKeyConstraint(['headquarters'], ['headquarters.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('user',
    sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('status', sa.Boolean(), nullable=True),
    sa.Column('created_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('removed_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('removed_at', sa.DateTime(), nullable=True),
    sa.Column('profile_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('name', sa.VARCHAR(length=100), nullable=False),
    sa.Column('email', sa.VARCHAR(length=100), nullable=False),
    sa.Column('salt', sa.VARCHAR(length=32), nullable=False),
    sa.Column('password', sa.VARCHAR(length=32), nullable=False),
    sa.Column('password_recovery', sa.VARCHAR(length=32), nullable=True),
    sa.Column('password_history', postgresql.JSON(astext_type=sa.Text()), nullable=True),
    sa.Column('permission', postgresql.ARRAY(sa.String()), nullable=False),
    sa.Column('token', postgresql.ARRAY(sa.String()), nullable=True),
    sa.ForeignKeyConstraint(['profile_id'], ['profile.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('movie_theater',
    sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('status', sa.Boolean(), nullable=True),
    sa.Column('created_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('removed_by', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('removed_at', sa.DateTime(), nullable=True),
    sa.Column('cinema_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('name', sa.VARCHAR(length=100), nullable=False),
    sa.Column('qt_seats', sa.Integer(), nullable=False),
    sa.Column('type_of', sa.Integer(), nullable=False),
    sa.Column('movie_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.ForeignKeyConstraint(['cinema_id'], ['cinema.id'], ),
    sa.ForeignKeyConstraint(['movie_id'], ['movie.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('movie_theater')
    op.drop_table('user')
    op.drop_table('cinema')
    op.drop_table('profile')
    op.drop_table('headquarters')
    op.drop_table('movie')
    op.drop_table('company')
    # ### end Alembic commands ###
