"""create stakeholders

Revision ID: 9ccd4437c1e5
Revises: 
Create Date: 2020-04-29 18:23:46.443633

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "firm",
        sa.Column("created_at", sa.DateTime(), nullable=False),
        sa.Column("updated_at", sa.DateTime(), nullable=False),
        sa.Column("UUID", sa.String(length=36), nullable=False),
        sa.Column("HEBREW_NAME", sa.String(), nullable=True),
        sa.Column("ENGLISH_NAME", sa.String(), nullable=True),
        sa.Column("ID", sa.String(), nullable=False),
        sa.Column("ID_TYPE", sa.String(), nullable=False),
        sa.PrimaryKeyConstraint("ID", "ID_TYPE"),
    )
    op.create_table(
        "maya_stakeholder",
        sa.Column("updated_at", sa.DateTime(), nullable=False),
        sa.Column("created_at", sa.DateTime(), nullable=False),
        sa.Column("AccumulateHoldings", sa.String(), nullable=True),
        sa.Column("AsmachtaDuachMeshubash", sa.String(), nullable=True),
        sa.Column("IsRequiredToReportChange", sa.String(), nullable=True),
        sa.Column("KodSugYeshut", sa.String(), nullable=True),
        sa.Column("HolderOwner", sa.String(), nullable=True),
        sa.Column("CapitalPct", sa.Float(), nullable=True),
        sa.Column("CapitalPct_Dilul", sa.Float(), nullable=True),
        sa.Column("ChangeSincePrevious", sa.Integer(), nullable=True),
        sa.Column("CompanyName", sa.String(), nullable=True),
        sa.Column("CompanyNameEn", sa.String(), nullable=True),
        sa.Column("CompanyUrl", sa.String(), nullable=True),
        sa.Column("CurrentAmount", sa.Integer(), nullable=True),
        sa.Column("Date2", sa.Date(), nullable=True),
        sa.Column("FullName", sa.String(), nullable=True),
        sa.Column("FullNameEn", sa.String(), nullable=True),
        sa.Column("HeaderMisparBaRasham", sa.String(), nullable=True),
        sa.Column("HeaderSemelBursa", sa.String(), nullable=True),
        sa.Column("IsFrontForOthers", sa.String(), nullable=True),
        sa.Column("MaximumRetentionRate", sa.String(), nullable=True),
        sa.Column("MezahehHotem", sa.Integer(), nullable=True),
        sa.Column("MezahehTofes", sa.Integer(), nullable=True),
        sa.Column("MezahehYeshut", sa.String(), nullable=True),
        sa.Column("MinimumRetentionRate", sa.String(), nullable=True),
        sa.Column("MisparNiarErech", sa.Integer(), nullable=True),
        sa.Column("MisparZihui", sa.String(), nullable=False),
        sa.Column("Nationality", sa.String(), nullable=True),
        sa.Column("NeyarotErechReshumim", sa.String(), nullable=True),
        sa.Column("Notes", sa.Text(), nullable=True),
        sa.Column("Position", sa.String(), nullable=True),
        sa.Column("PreviousAmount", sa.Integer(), nullable=True),
        sa.Column("PreviousCompanyNames", sa.String(), nullable=True),
        sa.Column("PumbiLoPumbi", sa.String(), nullable=True),
        sa.Column("StockName", sa.String(), nullable=False),
        sa.Column("SugMisparZihui", sa.String(), nullable=False),
        sa.Column("TreasuryShares", sa.String(), nullable=True),
        sa.Column("VotePower", sa.Float(), nullable=True),
        sa.Column("VotePower_Dilul", sa.Float(), nullable=True),
        sa.Column("company", sa.String(), nullable=True),
        sa.Column("date", sa.DateTime(), nullable=True),
        sa.Column("fix_for", sa.String(), nullable=True),
        sa.Column("fixed_by", sa.String(), nullable=True),
        sa.Column("id", sa.String(), nullable=True),
        sa.Column("next_doc", sa.String(), nullable=True),
        sa.Column("prev_doc", sa.String(), nullable=True),
        sa.Column("stakeholder_type", sa.String(), nullable=True),
        sa.Column("type", sa.String(), nullable=True),
        sa.Column("url", sa.String(), nullable=True),
        sa.PrimaryKeyConstraint(
            "created_at", "MisparZihui", "StockName", "SugMisparZihui"
        ),
    )
    op.create_table(
        "person",
        sa.Column("created_at", sa.DateTime(), nullable=False),
        sa.Column("updated_at", sa.DateTime(), nullable=False),
        sa.Column("UUID", sa.String(length=36), nullable=False),
        sa.Column("HEBREW_NAME", sa.String(), nullable=True),
        sa.Column("ENGLISH_NAME", sa.String(), nullable=True),
        sa.Column("ID", sa.String(), nullable=False),
        sa.Column("ID_TYPE", sa.String(), nullable=False),
        sa.PrimaryKeyConstraint("ID", "ID_TYPE"),
    )
    op.create_table(
        "stakeholders",
        sa.Column("updated_at", sa.DateTime(), nullable=False),
        sa.Column("HOLDER", sa.String(length=36), nullable=False),
        sa.Column("FIRM", sa.String(length=36), nullable=False),
        sa.Column("CAPITAL_PERCENT", sa.Float(), nullable=True),
        sa.Column("NUM_STOCKS", sa.Integer(), nullable=True),
        sa.Column("DATE", sa.Date(), nullable=True),
        sa.Column("NOTES", sa.Text(), nullable=True),
        sa.Column("created_at", sa.DateTime(), nullable=False),
        sa.PrimaryKeyConstraint("HOLDER", "FIRM", "created_at"),
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("stakeholders")
    op.drop_table("person")
    op.drop_table("maya_stakeholder")
    op.drop_table("firm")
    # ### end Alembic commands ###
