Skip to content

Commit

Permalink
Merge pull request #2610 from HHS/OPS-441-disable-user-accounts-refac…
Browse files Browse the repository at this point in the history
…toring

Ops 441 disable user accounts refactoring
  • Loading branch information
johndeange authored Jul 29, 2024
2 parents e4f7306 + 846c287 commit ba135c0
Show file tree
Hide file tree
Showing 27 changed files with 1,440 additions and 376 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# revision identifiers, used by Alembic.
revision: str = "151465a54d91"
down_revision: Union[str, None] = "5438ff1a9b3b"
down_revision: Union[str, None] = "728fdb666cb2"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,64 @@
Create Date: 2024-07-17 19:33:39.134098+00:00
"""

from typing import Sequence, Union

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision: str = 'a4a04f1f868e'
down_revision: Union[str, None] = '728fdb666cb2'
revision: str = "a4a04f1f868e"
down_revision: Union[str, None] = "151465a54d91"
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! ###
sa.Enum('ADMIN', 'AMOUNT_TBD', 'AS_IS', 'REPLACEMENT_AMOUNT_FINAL', name='modtype').create(op.get_bind())
op.add_column('budget_line_item', sa.Column('mod_type', postgresql.ENUM('ADMIN', 'AMOUNT_TBD', 'AS_IS', 'REPLACEMENT_AMOUNT_FINAL', name='modtype', create_type=False), nullable=True))
op.add_column('budget_line_item_version', sa.Column('mod_type', postgresql.ENUM('ADMIN', 'AMOUNT_TBD', 'AS_IS', 'REPLACEMENT_AMOUNT_FINAL', name='modtype', create_type=False), autoincrement=False, nullable=True))
sa.Enum(
"ADMIN", "AMOUNT_TBD", "AS_IS", "REPLACEMENT_AMOUNT_FINAL", name="modtype"
).create(op.get_bind())
op.add_column(
"budget_line_item",
sa.Column(
"mod_type",
postgresql.ENUM(
"ADMIN",
"AMOUNT_TBD",
"AS_IS",
"REPLACEMENT_AMOUNT_FINAL",
name="modtype",
create_type=False,
),
nullable=True,
),
)
op.add_column(
"budget_line_item_version",
sa.Column(
"mod_type",
postgresql.ENUM(
"ADMIN",
"AMOUNT_TBD",
"AS_IS",
"REPLACEMENT_AMOUNT_FINAL",
name="modtype",
create_type=False,
),
autoincrement=False,
nullable=True,
),
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('budget_line_item_version', 'mod_type')
op.drop_column('budget_line_item', 'mod_type')
sa.Enum('ADMIN', 'AMOUNT_TBD', 'AS_IS', 'REPLACEMENT_AMOUNT_FINAL', name='modtype').drop(op.get_bind())
op.drop_column("budget_line_item_version", "mod_type")
op.drop_column("budget_line_item", "mod_type")
sa.Enum(
"ADMIN", "AMOUNT_TBD", "AS_IS", "REPLACEMENT_AMOUNT_FINAL", name="modtype"
).drop(op.get_bind())
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
"""add GET_USER_DETAILS event
Revision ID: 3b569cc657d2
Revises: d411fa4a071b
Create Date: 2024-07-18 20:32:28.653497+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 = "3b569cc657d2"
down_revision: Union[str, None] = "f8ef3a3d90d7"
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.sync_enum_values(
"ops",
"opseventtype",
[
"CREATE_BLI",
"UPDATE_BLI",
"DELETE_BLI",
"SEND_BLI_FOR_APPROVAL",
"CREATE_PROJECT",
"CREATE_NEW_AGREEMENT",
"UPDATE_AGREEMENT",
"DELETE_AGREEMENT",
"ACKNOWLEDGE_NOTIFICATION",
"CREATE_BLI_PACKAGE",
"UPDATE_BLI_PACKAGE",
"CREATE_SERVICES_COMPONENT",
"UPDATE_SERVICES_COMPONENT",
"DELETE_SERVICES_COMPONENT",
"CREATE_PROCUREMENT_ACQUISITION_PLANNING",
"UPDATE_PROCUREMENT_ACQUISITION_PLANNING",
"DELETE_PROCUREMENT_ACQUISITION_PLANNING",
"LOGIN_ATTEMPT",
"LOGOUT",
"GET_USER_DETAILS",
"CREATE_USER",
"UPDATE_USER",
"DEACTIVATE_USER",
],
[
TableReference(
table_schema="ops", table_name="ops_event", column_name="event_type"
),
TableReference(
table_schema="ops",
table_name="ops_event_version",
column_name="event_type",
),
],
enum_values_to_rename=[],
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.sync_enum_values(
"ops",
"opseventtype",
[
"LOGIN_ATTEMPT",
"CREATE_BLI",
"UPDATE_BLI",
"DELETE_BLI",
"CREATE_PROJECT",
"CREATE_NEW_AGREEMENT",
"UPDATE_AGREEMENT",
"SEND_BLI_FOR_APPROVAL",
"DELETE_AGREEMENT",
"ACKNOWLEDGE_NOTIFICATION",
"LOGOUT",
"CREATE_USER",
"UPDATE_USER",
"DEACTIVATE_USER",
"CREATE_BLI_PACKAGE",
"UPDATE_BLI_PACKAGE",
"CREATE_SERVICES_COMPONENT",
"UPDATE_SERVICES_COMPONENT",
"DELETE_SERVICES_COMPONENT",
"CREATE_PROCUREMENT_ACQUISITION_PLANNING",
"UPDATE_PROCUREMENT_ACQUISITION_PLANNING",
"DELETE_PROCUREMENT_ACQUISITION_PLANNING",
],
[
TableReference(
table_schema="ops", table_name="ops_event", column_name="event_type"
),
TableReference(
table_schema="ops",
table_name="ops_event_version",
column_name="event_type",
),
],
enum_values_to_rename=[],
)
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,126 @@
Create Date: 2024-07-19 15:05:23.462440+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 = '046c78099374'
down_revision: Union[str, None] = 'f8ef3a3d90d7'
revision: str = "046c78099374"
down_revision: Union[str, None] = "3b569cc657d2"
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('budget_line_item', sa.Column('requisition_number', sa.Integer(), nullable=True))
op.add_column('budget_line_item', sa.Column('requisition_date', sa.Date(), nullable=True))
op.add_column('budget_line_item_version', sa.Column('requisition_number', sa.Integer(), autoincrement=False, nullable=True))
op.add_column('budget_line_item_version', sa.Column('requisition_date', sa.Date(), autoincrement=False, nullable=True))
op.sync_enum_values('ops', 'opseventtype', ['LOGIN_ATTEMPT', 'CREATE_BLI', 'UPDATE_BLI', 'DELETE_BLI', 'CREATE_PROJECT', 'CREATE_NEW_AGREEMENT', 'UPDATE_AGREEMENT', 'SEND_BLI_FOR_APPROVAL', 'DELETE_AGREEMENT', 'ACKNOWLEDGE_NOTIFICATION', 'LOGOUT', 'CREATE_USER', 'UPDATE_USER', 'DEACTIVATE_USER', 'CREATE_BLI_PACKAGE', 'UPDATE_BLI_PACKAGE', 'CREATE_SERVICES_COMPONENT', 'UPDATE_SERVICES_COMPONENT', 'DELETE_SERVICES_COMPONENT', 'CREATE_PROCUREMENT_ACQUISITION_PLANNING', 'UPDATE_PROCUREMENT_ACQUISITION_PLANNING', 'DELETE_PROCUREMENT_ACQUISITION_PLANNING', 'CREATE_DOCUMENT'],
[TableReference(table_schema='ops', table_name='ops_event', column_name='event_type'), TableReference(table_schema='ops', table_name='ops_event_version', column_name='event_type')],
enum_values_to_rename=[])
op.add_column(
"budget_line_item", sa.Column("requisition_number", sa.Integer(), nullable=True)
)
op.add_column(
"budget_line_item", sa.Column("requisition_date", sa.Date(), nullable=True)
)
op.add_column(
"budget_line_item_version",
sa.Column(
"requisition_number", sa.Integer(), autoincrement=False, nullable=True
),
)
op.add_column(
"budget_line_item_version",
sa.Column("requisition_date", sa.Date(), autoincrement=False, nullable=True),
)
op.sync_enum_values(
"ops",
"opseventtype",
[
"LOGIN_ATTEMPT",
"CREATE_BLI",
"UPDATE_BLI",
"DELETE_BLI",
"CREATE_PROJECT",
"CREATE_NEW_AGREEMENT",
"UPDATE_AGREEMENT",
"SEND_BLI_FOR_APPROVAL",
"DELETE_AGREEMENT",
"ACKNOWLEDGE_NOTIFICATION",
"LOGOUT",
"GET_USER_DETAILS",
"CREATE_USER",
"UPDATE_USER",
"DEACTIVATE_USER",
"CREATE_BLI_PACKAGE",
"UPDATE_BLI_PACKAGE",
"CREATE_SERVICES_COMPONENT",
"UPDATE_SERVICES_COMPONENT",
"DELETE_SERVICES_COMPONENT",
"CREATE_PROCUREMENT_ACQUISITION_PLANNING",
"UPDATE_PROCUREMENT_ACQUISITION_PLANNING",
"DELETE_PROCUREMENT_ACQUISITION_PLANNING",
"CREATE_DOCUMENT",
],
[
TableReference(
table_schema="ops", table_name="ops_event", column_name="event_type"
),
TableReference(
table_schema="ops",
table_name="ops_event_version",
column_name="event_type",
),
],
enum_values_to_rename=[],
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.sync_enum_values('ops', 'opseventtype', ['LOGIN_ATTEMPT', 'CREATE_BLI', 'UPDATE_BLI', 'DELETE_BLI', 'CREATE_PROJECT', 'CREATE_NEW_AGREEMENT', 'UPDATE_AGREEMENT', 'SEND_BLI_FOR_APPROVAL', 'DELETE_AGREEMENT', 'ACKNOWLEDGE_NOTIFICATION', 'LOGOUT', 'CREATE_USER', 'UPDATE_USER', 'DEACTIVATE_USER', 'CREATE_BLI_PACKAGE', 'UPDATE_BLI_PACKAGE', 'CREATE_SERVICES_COMPONENT', 'UPDATE_SERVICES_COMPONENT', 'DELETE_SERVICES_COMPONENT', 'CREATE_PROCUREMENT_ACQUISITION_PLANNING', 'UPDATE_PROCUREMENT_ACQUISITION_PLANNING', 'DELETE_PROCUREMENT_ACQUISITION_PLANNING'],
[TableReference(table_schema='ops', table_name='ops_event', column_name='event_type'), TableReference(table_schema='ops', table_name='ops_event_version', column_name='event_type')],
enum_values_to_rename=[])
op.drop_column('budget_line_item_version', 'requisition_date')
op.drop_column('budget_line_item_version', 'requisition_number')
op.drop_column('budget_line_item', 'requisition_date')
op.drop_column('budget_line_item', 'requisition_number')
op.sync_enum_values(
"ops",
"opseventtype",
[
"LOGIN_ATTEMPT",
"CREATE_BLI",
"UPDATE_BLI",
"DELETE_BLI",
"CREATE_PROJECT",
"CREATE_NEW_AGREEMENT",
"UPDATE_AGREEMENT",
"SEND_BLI_FOR_APPROVAL",
"DELETE_AGREEMENT",
"ACKNOWLEDGE_NOTIFICATION",
"LOGOUT",
"GET_USER_DETAILS",
"CREATE_USER",
"UPDATE_USER",
"DEACTIVATE_USER",
"CREATE_BLI_PACKAGE",
"UPDATE_BLI_PACKAGE",
"CREATE_SERVICES_COMPONENT",
"UPDATE_SERVICES_COMPONENT",
"DELETE_SERVICES_COMPONENT",
"CREATE_PROCUREMENT_ACQUISITION_PLANNING",
"UPDATE_PROCUREMENT_ACQUISITION_PLANNING",
"DELETE_PROCUREMENT_ACQUISITION_PLANNING",
],
[
TableReference(
table_schema="ops", table_name="ops_event", column_name="event_type"
),
TableReference(
table_schema="ops",
table_name="ops_event_version",
column_name="event_type",
),
],
enum_values_to_rename=[],
)
op.drop_column("budget_line_item_version", "requisition_date")
op.drop_column("budget_line_item_version", "requisition_number")
op.drop_column("budget_line_item", "requisition_date")
op.drop_column("budget_line_item", "requisition_number")
# ### end Alembic commands ###
Loading

0 comments on commit ba135c0

Please sign in to comment.