"""Add investment table

Revision ID: a44974f9c361
Revises: a14fe9823844
Create Date: 2021-03-17 20:01:24.832808

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'a44974f9c361'
down_revision = 'a14fe9823844'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('investment',
    sa.Column('investment_id', sa.Integer(), nullable=False),
    sa.Column('created', sa.DateTime(), nullable=False),
    sa.Column('amount', sa.String(), nullable=False),
    sa.Column('bounty_id', sa.Integer(), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['bounty_id'], ['bounty.bounty_id'], name=op.f('fk_investment_bounty_id_bounty'), ondelete='NO ACTION'),
    sa.ForeignKeyConstraint(['user_id'], ['user.user_id'], name=op.f('fk_investment_user_id_user'), ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('investment_id', name=op.f('pk_investment'))
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('investment')
    # ### end Alembic commands ###
