-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DB migrations, fix factories, adjust tests temporarily
- Loading branch information
Showing
7 changed files
with
574 additions
and
64 deletions.
There are no files selected for viewing
91 changes: 91 additions & 0 deletions
91
api/src/db/migrations/versions/2024_03_05_drop_summary_table.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ### |
Oops, something went wrong.