Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue #1363] Update the Opportunity summary database models based on updated database schema plan #1402

Merged
merged 10 commits into from
Mar 7, 2024
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
Loading