"""empty message

Revision ID: 3d5f08e1d388
Revises: 849128cdb118
Create Date: 2021-04-01 01:21:15.323458

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

# revision identifiers, used by Alembic.
revision = '3d5f08e1d388'
down_revision = '849128cdb118'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('people_sw',
    sa.Column('id_people', sa.Integer(), nullable=False),
    sa.Column('people_height', sa.Integer(), nullable=False),
    sa.Column('people_mass', sa.Integer(), nullable=False),
    sa.Column('people_hair_color', sa.String(length=250), nullable=False),
    sa.Column('people_skin_color', sa.String(length=250), nullable=False),
    sa.Column('people_eye_color', sa.String(length=250), nullable=False),
    sa.Column('people_birth_year', sa.String(length=250), nullable=False),
    sa.Column('people_gender', sa.String(length=250), nullable=False),
    sa.Column('people_created', sa.String(length=250), nullable=False),
    sa.Column('people_edited', sa.String(length=250), nullable=False),
    sa.Column('people_name', sa.String(length=250), nullable=False),
    sa.Column('people_homeworld', sa.String(length=250), nullable=False),
    sa.Column('people_url', sa.String(length=250), nullable=False),
    sa.Column('planets_id_fk', sa.Integer(), nullable=False),
    sa.PrimaryKeyConstraint('id_people')
    )
    op.create_table('planets_sw',
    sa.Column('id_planets', sa.Integer(), nullable=False),
    sa.Column('planets_name', sa.String(length=250), nullable=False),
    sa.Column('planets_diameter', sa.Integer(), nullable=False),
    sa.Column('planets_rotation_period', sa.Integer(), nullable=False),
    sa.Column('planets_orbital_period', sa.Integer(), nullable=False),
    sa.Column('planets_gravity', sa.String(length=250), nullable=False),
    sa.Column('planets_population', sa.Integer(), nullable=False),
    sa.Column('planets_climate', sa.String(length=250), nullable=False),
    sa.Column('planets_terrain', sa.String(length=250), nullable=False),
    sa.Column('planets_surface_water', sa.Integer(), nullable=False),
    sa.Column('planets_created', sa.String(length=250), nullable=False),
    sa.Column('planets_edited', sa.String(length=250), nullable=False),
    sa.Column('planets_url', sa.String(length=250), nullable=False),
    sa.PrimaryKeyConstraint('id_planets')
    )
    op.create_table('user_sw',
    sa.Column('id_user', sa.Integer(), nullable=False),
    sa.Column('name_user', sa.String(length=250), nullable=False),
    sa.Column('password', sa.String(length=250), nullable=False),
    sa.Column('email_user', sa.String(length=250), nullable=False),
    sa.Column('birth_user', sa.String(length=250), nullable=False),
    sa.Column('is_active', sa.Boolean(), nullable=False),
    sa.PrimaryKeyConstraint('id_user')
    )
    op.create_table('favorite_sw',
    sa.Column('id_favorite', sa.Integer(), nullable=False),
    sa.Column('user_id_fk', sa.Integer(), nullable=False),
    sa.Column('planets_id_fk', sa.Integer(), nullable=False),
    sa.Column('people_id_fk', sa.Integer(), nullable=False),
    sa.Column('type_favorite', sa.String(length=250), nullable=False),
    sa.ForeignKeyConstraint(['people_id_fk'], ['people_sw.id_people'], ),
    sa.ForeignKeyConstraint(['planets_id_fk'], ['planets_sw.id_planets'], ),
    sa.ForeignKeyConstraint(['user_id_fk'], ['user_sw.id_user'], ),
    sa.PrimaryKeyConstraint('id_favorite')
    )
    op.drop_table('user_SW')
    op.drop_table('people_SW')
    op.drop_table('planets_SW')
    op.drop_table('favorite_SW')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('favorite_SW',
    sa.Column('id_favorite', mysql.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('user_id_fk', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('planets_id_fk', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('people_id_fk', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('type_favorite', mysql.VARCHAR(length=250), nullable=False),
    sa.PrimaryKeyConstraint('id_favorite'),
    mysql_collate='utf8mb4_0900_ai_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('planets_SW',
    sa.Column('id_planets', mysql.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('planets_name', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('planets_diameter', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('planets_rotation_period', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('planets_orbital_period', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('planets_gravity', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('planets_population', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('planets_climate', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('planets_terrain', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('planets_surface_water', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('planets_created', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('planets_edited', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('planets_url', mysql.VARCHAR(length=250), nullable=False),
    sa.PrimaryKeyConstraint('id_planets'),
    mysql_collate='utf8mb4_0900_ai_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('people_SW',
    sa.Column('id_people', mysql.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('people_height', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('people_mass', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('people_hair_color', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('people_skin_color', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('people_eye_color', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('people_birth_year', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('people_gender', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('people_created', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('people_edited', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('people_name', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('people_homeworld', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('people_url', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('planets_id_fk', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('id_people'),
    mysql_collate='utf8mb4_0900_ai_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('user_SW',
    sa.Column('id_user', mysql.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('name_user', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('password', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('email_user', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('birth_user', mysql.VARCHAR(length=250), nullable=False),
    sa.Column('is_active', mysql.TINYINT(display_width=1), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('id_user'),
    mysql_collate='utf8mb4_0900_ai_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.drop_table('favorite_sw')
    op.drop_table('user_sw')
    op.drop_table('planets_sw')
    op.drop_table('people_sw')
    # ### end Alembic commands ###
