-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3393 from HHS/OPS-3348/add-agreement-attributes
Ops 3348/add agreement attributes
- Loading branch information
Showing
8 changed files
with
150 additions
and
14 deletions.
There are no files selected for viewing
105 changes: 105 additions & 0 deletions
105
...alembic/versions/2025_01_30_2012-baeefc8305f1_add_start_end_date_to_agreement_add_psc_.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,105 @@ | ||
"""add start/end date to agreement;add psc_contract_specialist and cotr_id to contract;fix direct_obligation | ||
Revision ID: baeefc8305f1 | ||
Revises: 6e35b193a666 | ||
Create Date: 2025-01-30 20:12:00.747620+00:00 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
from alembic_postgresql_enum import TableReference | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "baeefc8305f1" | ||
down_revision: Union[str, None] = "6e35b193a666" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column("agreement", sa.Column("start_date", sa.Date(), nullable=True)) | ||
op.add_column("agreement", sa.Column("end_date", sa.Date(), nullable=True)) | ||
op.add_column( | ||
"agreement_version", | ||
sa.Column("start_date", sa.Date(), autoincrement=False, nullable=True), | ||
) | ||
op.add_column( | ||
"agreement_version", | ||
sa.Column("end_date", sa.Date(), autoincrement=False, nullable=True), | ||
) | ||
op.add_column( | ||
"contract_agreement", | ||
sa.Column("psc_contract_specialist", sa.String(), nullable=True), | ||
) | ||
op.add_column( | ||
"contract_agreement", sa.Column("cotr_id", sa.Integer(), nullable=True) | ||
) | ||
op.create_foreign_key(None, "contract_agreement", "ops_user", ["cotr_id"], ["id"]) | ||
op.add_column( | ||
"contract_agreement_version", | ||
sa.Column( | ||
"psc_contract_specialist", sa.String(), autoincrement=False, nullable=True | ||
), | ||
) | ||
op.add_column( | ||
"contract_agreement_version", | ||
sa.Column("cotr_id", sa.Integer(), autoincrement=False, nullable=True), | ||
) | ||
op.add_column("agreement", sa.Column("maps_sys_id", sa.Integer(), nullable=True)) | ||
op.add_column( | ||
"agreement_version", | ||
sa.Column("maps_sys_id", sa.Integer(), autoincrement=False, nullable=True), | ||
) | ||
op.sync_enum_values( | ||
"ops", | ||
"agreementtype", | ||
["CONTRACT", "GRANT", "DIRECT_OBLIGATION", "IAA", "IAA_AA", "MISCELLANEOUS"], | ||
[ | ||
TableReference( | ||
table_schema="ops", table_name="agreement", column_name="agreement_type" | ||
), | ||
TableReference( | ||
table_schema="ops", | ||
table_name="agreement_version", | ||
column_name="agreement_type", | ||
), | ||
], | ||
enum_values_to_rename=[], | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.sync_enum_values( | ||
"ops", | ||
"agreementtype", | ||
["CONTRACT", "GRANT", "DIRECT_ALLOCATION", "IAA", "IAA_AA", "MISCELLANEOUS"], | ||
[ | ||
TableReference( | ||
table_schema="ops", table_name="agreement", column_name="agreement_type" | ||
), | ||
TableReference( | ||
table_schema="ops", | ||
table_name="agreement_version", | ||
column_name="agreement_type", | ||
), | ||
], | ||
enum_values_to_rename=[], | ||
) | ||
op.drop_column("contract_agreement_version", "cotr_id") | ||
op.drop_column("contract_agreement_version", "psc_contract_specialist") | ||
op.drop_constraint(None, "contract_agreement", type_="foreignkey") | ||
op.drop_column("contract_agreement", "cotr_id") | ||
op.drop_column("contract_agreement", "psc_contract_specialist") | ||
op.drop_column("agreement_version", "end_date") | ||
op.drop_column("agreement_version", "start_date") | ||
op.drop_column("agreement", "end_date") | ||
op.drop_column("agreement", "start_date") | ||
op.drop_column("agreement_version", "maps_sys_id") | ||
op.drop_column("agreement", "maps_sys_id") | ||
# ### end Alembic commands ### |
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
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
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
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
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
2 changes: 1 addition & 1 deletion
2
frontend/src/components/ServicesComponents/ServicesComponents.constants.js
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
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