"""initial

Revision ID: ef<PASSWORD>
Revises:
Create Date: 2022-03-03 15:21:30.974400

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

# revision identifiers, used by Alembic.
revision = "ef<PASSWORD>"
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "sandbox",
        sa.Column(
            "id",
            postgresql.UUID(as_uuid=True),
            server_default=sa.text("gen_random_uuid()"),
            nullable=False,
        ),
        sa.Column(
            "created_at",
            postgresql.TIMESTAMP(),
            server_default=sa.text("now()"),
            nullable=False,
        ),
        sa.Column(
            "updated_at",
            postgresql.TIMESTAMP(),
            server_default=sa.text("now()"),
            nullable=False,
        ),
        sa.Column("tag", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "job_applicant",
        sa.Column(
            "id",
            postgresql.UUID(as_uuid=True),
            server_default=sa.text("gen_random_uuid()"),
            nullable=False,
        ),
        sa.Column(
            "created_at",
            postgresql.TIMESTAMP(),
            server_default=sa.text("now()"),
            nullable=False,
        ),
        sa.Column(
            "updated_at",
            postgresql.TIMESTAMP(),
            server_default=sa.text("now()"),
            nullable=False,
        ),
        sa.Column("name", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("sandbox_id", sqlmodel.sql.sqltypes.GUID(), nullable=False),
        sa.Column("degree", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("date", sa.DateTime(), nullable=True),
        sa.Column(
            "invitation_state", sqlmodel.sql.sqltypes.AutoString(), nullable=True
        ),
        sa.Column("connection_id", sqlmodel.sql.sqltypes.GUID(), nullable=True),
        sa.Column("wallet_id", sqlmodel.sql.sqltypes.GUID(), nullable=True),
        sa.Column("alias", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.ForeignKeyConstraint(
            ["sandbox_id"],
            ["sandbox.id"],
        ),
        sa.PrimaryKeyConstraint("id"),
        sa.UniqueConstraint("name", "sandbox_id"),
    )
    op.create_index(
        op.f("ix_job_applicant_name"), "job_applicant", ["name"], unique=False
    )
    op.create_table(
        "line_of_business",
        sa.Column(
            "id",
            postgresql.UUID(as_uuid=True),
            server_default=sa.text("gen_random_uuid()"),
            nullable=False,
        ),
        sa.Column(
            "created_at",
            postgresql.TIMESTAMP(),
            server_default=sa.text("now()"),
            nullable=False,
        ),
        sa.Column(
            "updated_at",
            postgresql.TIMESTAMP(),
            server_default=sa.text("now()"),
            nullable=False,
        ),
        sa.Column("name", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("webhook_url", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("sandbox_id", sqlmodel.sql.sqltypes.GUID(), nullable=False),
        sa.Column("traction_issue_enabled", sa.Boolean(), nullable=False),
        sa.Column("public_did", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("cred_def_id", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("wallet_id", sqlmodel.sql.sqltypes.GUID(), nullable=False),
        sa.Column("wallet_key", sqlmodel.sql.sqltypes.GUID(), nullable=False),
        sa.ForeignKeyConstraint(
            ["sandbox_id"],
            ["sandbox.id"],
        ),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "student",
        sa.Column(
            "id",
            postgresql.UUID(as_uuid=True),
            server_default=sa.text("gen_random_uuid()"),
            nullable=False,
        ),
        sa.Column(
            "created_at",
            postgresql.TIMESTAMP(),
            server_default=sa.text("now()"),
            nullable=False,
        ),
        sa.Column(
            "updated_at",
            postgresql.TIMESTAMP(),
            server_default=sa.text("now()"),
            nullable=False,
        ),
        sa.Column("name", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("sandbox_id", sqlmodel.sql.sqltypes.GUID(), nullable=False),
        sa.Column("degree", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("age", sa.Integer(), nullable=True),
        sa.Column("student_id", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("date", sa.DateTime(), nullable=True),
        sa.Column(
            "invitation_state", sqlmodel.sql.sqltypes.AutoString(), nullable=True
        ),
        sa.Column("connection_id", sqlmodel.sql.sqltypes.GUID(), nullable=True),
        sa.Column("wallet_id", sqlmodel.sql.sqltypes.GUID(), nullable=True),
        sa.Column("alias", 