"""empty message

Revision ID: ca262f78c4b1
Revises: 
Create Date: 2021-02-24 00:17:16.505557

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "ca262f78c4b1"
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "announcements",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("created_date", sa.DateTime(), nullable=True),
        sa.Column("title", sa.String(length=100), nullable=True),
        sa.Column("content", sa.String(length=1024), nullable=True),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "appointments",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("name", sa.String(length=100), nullable=True),
        sa.Column("date", sa.String(length=20), nullable=True),
        sa.Column("time", sa.String(length=20), nullable=True),
        sa.Column("active", sa.String(length=20), nullable=True),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "contact",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("created_date", sa.DateTime(), nullable=True),
        sa.Column("name", sa.String(length=100), nullable=True),
        sa.Column("email", sa.String(length=100), nullable=True),
        sa.Column("message", sa.String(length=1024), nullable=True),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "images",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("filename", sa.String(length=50), nullable=False),
        sa.Column("thumbnail", sa.String(length=50), nullable=False),
        sa.Column("file_size", sa.Integer(), nullable=False),
        sa.Column("file_width", sa.Integer(), nullable=False),
        sa.Column("file_height", sa.Integer(), nullable=False),
        sa.Column("create_date", sa.DateTime(), nullable=False),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "pages",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("created_date", sa.DateTime(), nullable=True),
        sa.Column("title", sa.String(length=100), nullable=True),
        sa.Column("slug", sa.String(length=100), nullable=True),
        sa.Column("content", sa.String(length=1024), nullable=True),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "people",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("name", sa.String(length=100), nullable=True),
        sa.Column("phone", sa.Integer(), nullable=True),
        sa.Column("mobile", sa.Integer(), nullable=True),
        sa.Column("email", sa.String(length=100), nullable=True),
        sa.Column("facebook", sa.String(length=128), nullable=True),
        sa.Column("twitter", sa.String(length=128), nullable=True),
        sa.Column("linkedin", sa.String(length=128), nullable=True),
        sa.Column("age", sa.Integer(), nullable=True),
        sa.Column("birthday", sa.String(length=100), nullable=True),
        sa.Column("notes", sa.String(length=100), nullable=True),
        sa.Column("is_manufacturer", sa.Boolean(), nullable=True),
        sa.Column("manufacturer_name", sa.String(length=100), nullable=True),
        sa.Column("manufacturer_phone", sa.Integer(), nullable=True),
        sa.Column(
            "manufacturer_address", sa.String(length=200), nullable=True
        ),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "resources",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("filename", sa.String(length=50), nullable=False),
        sa.Column("type", sa.String(length=50), nullable=False),
        sa.Column("category", sa.String(length=50), nullable=False),
        sa.Column("created_date", sa.DateTime(), nullable=False),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "roles",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("name", sa.String(length=100), nullable=False),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "settings",
        sa.Column("setting", sa.String(length=100), nullable=False),
        sa.Column("value", sa.String(length=100), nullable=True),
        sa.PrimaryKeyConstraint("setting"),
    )
    op.create_table(
        "users",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("username", sa.String(length=100), nullable=True),
        sa.Column("_password", sa.String(length=128), nullable=False),
        sa.Column("first_name", sa.String(length=128), nullable=True),
        sa.Column("last_name", sa.String(length=128), nullable=True),
        sa.Column("is_admin", sa.Boolean(), nullable=True),
        sa.Column("email", sa.String(length=120), nullable=False),
        sa.Column("date_registered", sa.DateTime(), nullable=False),
        sa.Column("is_email_confirmed", sa.Boolean(), nullable=False),
        sa.Column("email_confirm_date", sa.DateTime(), nullable=True),
        sa.PrimaryKeyConstraint("id"),
        sa.UniqueConstraint("email"),
        sa.UniqueConstraint("username"),
    )
    op.create_table(
        "role_user_bridge",
        sa.Column("user_id", sa.Integer(), nullable=False),
        sa.Column("role_id", sa.Integer(), nullable=False),
        sa.ForeignKeyConstraint(["role_id"], ["roles.id"], ondelete="CASCADE"),
        sa.ForeignKeyConstraint(["user_id"], ["users.id"], ondelete="CASCADE"),
        sa.PrimaryKeyConstraint("user_id", "role_id"),
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("role_user_bridge")
    op.drop_table("users")
    op.drop_table("settings")
    op.drop_table("roles")
    op.drop_table("resources")
    op.drop_table("people")
    op.drop_table("pages")
    op.drop_table("images")
    op.drop_table("contact")
    op.drop_table("appointments")
    op.drop_table("announcements")
    # ### end Alembic commands ###
