Skip to content

Commit

Permalink
Add DB migrations, fix factories, adjust tests temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
chouinar committed Mar 5, 2024
1 parent 99b24fe commit 86ee26d
Show file tree
Hide file tree
Showing 7 changed files with 574 additions and 64 deletions.
91 changes: 91 additions & 0 deletions api/src/db/migrations/versions/2024_03_05_drop_summary_table.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
"""drop summary table
Revision ID: 81cb9c6033b3
Revises: 5d58c38f2cac
Create Date: 2024-03-05 12:15:07.389544
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "81cb9c6033b3"
down_revision = "5d58c38f2cac"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table("opportunity_summary")
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"opportunity_summary",
sa.Column("opportunity_id", sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column("opportunity_status_id", sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column("summary_description", sa.TEXT(), autoincrement=False, nullable=True),
sa.Column("is_cost_sharing", sa.BOOLEAN(), autoincrement=False, nullable=True),
sa.Column("close_date", sa.DATE(), autoincrement=False, nullable=True),
sa.Column("close_date_description", sa.TEXT(), autoincrement=False, nullable=True),
sa.Column("post_date", sa.DATE(), autoincrement=False, nullable=True),
sa.Column("archive_date", sa.DATE(), autoincrement=False, nullable=True),
sa.Column("unarchive_date", sa.DATE(), autoincrement=False, nullable=True),
sa.Column("expected_number_of_awards", sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column(
"estimated_total_program_funding", sa.INTEGER(), autoincrement=False, nullable=True
),
sa.Column("award_floor", sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column("award_ceiling", sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column("additional_info_url", sa.TEXT(), autoincrement=False, nullable=True),
sa.Column("additional_info_url_description", sa.TEXT(), autoincrement=False, nullable=True),
sa.Column("version_number", sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column("modification_comments", sa.TEXT(), autoincrement=False, nullable=True),
sa.Column("funding_category_description", sa.TEXT(), autoincrement=False, nullable=True),
sa.Column(
"applicant_eligibility_description", sa.TEXT(), autoincrement=False, nullable=True
),
sa.Column("agency_code", sa.TEXT(), autoincrement=False, nullable=True),
sa.Column("agency_name", sa.TEXT(), autoincrement=False, nullable=True),
sa.Column("agency_phone_number", sa.TEXT(), autoincrement=False, nullable=True),
sa.Column("agency_contact_description", sa.TEXT(), autoincrement=False, nullable=True),
sa.Column("agency_email_address", sa.TEXT(), autoincrement=False, nullable=True),
sa.Column(
"agency_email_address_description", sa.TEXT(), autoincrement=False, nullable=True
),
sa.Column("can_send_mail", sa.BOOLEAN(), autoincrement=False, nullable=True),
sa.Column("publisher_profile_id", sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column("publisher_user_id", sa.TEXT(), autoincrement=False, nullable=True),
sa.Column("updated_by", sa.TEXT(), autoincrement=False, nullable=True),
sa.Column("created_by", sa.TEXT(), autoincrement=False, nullable=True),
sa.Column(
"created_at",
postgresql.TIMESTAMP(timezone=True),
server_default=sa.text("now()"),
autoincrement=False,
nullable=False,
),
sa.Column(
"updated_at",
postgresql.TIMESTAMP(timezone=True),
server_default=sa.text("now()"),
autoincrement=False,
nullable=False,
),
sa.ForeignKeyConstraint(
["opportunity_id"],
["opportunity.opportunity_id"],
name="opportunity_summary_opportunity_id_opportunity_fkey",
),
sa.ForeignKeyConstraint(
["opportunity_status_id"],
["lk_opportunity_status.opportunity_status_id"],
name="opportunity_summary_opportunity_status_id_lk_opportunit_ea00",
),
sa.PrimaryKeyConstraint("opportunity_id", name="opportunity_summary_pkey"),
)
# ### end Alembic commands ###
Loading

0 comments on commit 86ee26d

Please sign in to comment.