2022-10-20 05:48:41 -05:00
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
|
|
#
|
2024-01-01 02:43:48 -06:00
|
|
|
# Copyright (C) 2013 - 2024, The pgAdmin Development Team
|
2022-10-20 05:48:41 -05:00
|
|
|
# This software is released under the PostgreSQL Licence
|
|
|
|
#
|
|
|
|
##########################################################################
|
|
|
|
"""
|
2021-06-06 03:28:06 -05:00
|
|
|
|
|
|
|
Revision ID: c465fee44968
|
|
|
|
Revises: d0bc9f32b2b9
|
|
|
|
Create Date: 2021-06-04 14:42:12.843116
|
|
|
|
|
|
|
|
"""
|
2022-10-20 05:48:41 -05:00
|
|
|
from alembic import op
|
|
|
|
import sqlalchemy as sa
|
2021-06-06 03:28:06 -05:00
|
|
|
import uuid
|
|
|
|
|
|
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
|
|
revision = 'c465fee44968'
|
|
|
|
down_revision = 'd0bc9f32b2b9'
|
|
|
|
branch_labels = None
|
|
|
|
depends_on = None
|
|
|
|
|
|
|
|
|
|
|
|
def upgrade():
|
2022-10-20 05:48:41 -05:00
|
|
|
op.add_column('user', sa.Column('fs_uniquifier', sa.String(),
|
|
|
|
nullable=True))
|
2021-12-01 05:51:28 -06:00
|
|
|
|
Update SQLAlchemy, Flask, Flask-SQLAlchemy, and other packages to current versions. #5901
- Update Flask, Flask-SQLAlchemy, Flask-Babel, Flask-Security-Too, Flask-SocketIO, pytz, psutil, SQLAlchemy, bcrypt, cryptography, eventlet, Authlib, requests python packages
- Remove pinned dnspython, Werkzeug packages from requirements.txt
2023-03-15 01:27:16 -05:00
|
|
|
meta = sa.MetaData()
|
2022-10-20 05:48:41 -05:00
|
|
|
# define table representation
|
Update SQLAlchemy, Flask, Flask-SQLAlchemy, and other packages to current versions. #5901
- Update Flask, Flask-SQLAlchemy, Flask-Babel, Flask-Security-Too, Flask-SocketIO, pytz, psutil, SQLAlchemy, bcrypt, cryptography, eventlet, Authlib, requests python packages
- Remove pinned dnspython, Werkzeug packages from requirements.txt
2023-03-15 01:27:16 -05:00
|
|
|
meta.reflect(op.get_bind(), only=('user',))
|
2022-10-20 05:48:41 -05:00
|
|
|
user_table = sa.Table('user', meta)
|
2021-06-06 03:28:06 -05:00
|
|
|
|
2022-10-20 05:48:41 -05:00
|
|
|
op.execute(
|
|
|
|
user_table.update().values(fs_uniquifier=uuid.uuid4().hex)
|
|
|
|
)
|
|
|
|
with op.batch_alter_table("user") as batch_op:
|
|
|
|
batch_op.alter_column('fs_uniquifier', nullable=False)
|
2021-06-06 03:28:06 -05:00
|
|
|
|
|
|
|
|
|
|
|
def downgrade():
|
|
|
|
# pgAdmin only upgrades, downgrade not implemented.
|
|
|
|
pass
|