jasquat ab5b041086
Ht user on group update (#2012)
* some basics to update human task users when a group is updated w/ burnettk

* do not delete groups that were specified from open id groups w/ burnettk

* some updates to remove old user task assignments w/ burnettk

* still need additional tests but pyl is passing w/ burnettk

* added a test to ensure user is assigned and unassigned a task when using open id as source for groups w/ burnettk

* set added_by in missing places w/ burnettk

---------

Co-authored-by: jasquat <jasquat@users.noreply.github.com>
2024-07-30 14:54:45 -04:00

43 lines
1.4 KiB
Python

"""empty message
Revision ID: f318f9f1b110
Revises: ac125644907a
Create Date: 2024-07-29 15:36:43.230973
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f318f9f1b110'
down_revision = 'ac125644907a'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('group', schema=None) as batch_op:
batch_op.add_column(sa.Column('source_is_open_id', sa.Boolean(), nullable=False))
batch_op.create_index(batch_op.f('ix_group_source_is_open_id'), ['source_is_open_id'], unique=False)
with op.batch_alter_table('human_task_user', schema=None) as batch_op:
batch_op.add_column(sa.Column('added_by', sa.String(length=50), nullable=True))
batch_op.create_index(batch_op.f('ix_human_task_user_added_by'), ['added_by'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('human_task_user', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_human_task_user_added_by'))
batch_op.drop_column('added_by')
with op.batch_alter_table('group', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_group_source_is_open_id'))
batch_op.drop_column('source_is_open_id')
# ### end Alembic commands ###