"""adding invoice table

Revision ID: 968030faf65e
Revises: 3227d3516d16
Create Date: 2024-08-01 13:26:37.660902

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '968030faf65e'
down_revision = '3227d3516d16'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('invoice',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('company_id', sa.Integer(), nullable=True),
    sa.Column('amount', sa.Float(), nullable=False),
    sa.Column('status', sa.String(length=50), nullable=False),
    sa.Column('due_date', sa.DateTime(), nullable=False),
    sa.Column('paid_date', sa.DateTime(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['company_id'], ['company.id'], name=op.f('fk_invoice_company_id_company')),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_invoice'))
    )
    # ### end Alembic commands ###


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