refac
This commit is contained in:
1 parent
5cc1eb5170
commit
f0e88dadc8
2 files changed
+181
-123
No files matched your search
@@ -19,50 +19,63 @@ depends_on: Union[str, Sequence[str], None] = None
|
|||||||
|
|
||||||
|
|
||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
# Ensure 'id' column in 'user' table is unique and primary key (ForeignKey constraint)
|
|
||||||
inspector = sa.inspect(op.get_bind())
|
inspector = sa.inspect(op.get_bind())
|
||||||
columns = inspector.get_columns('user')
|
existing_tables = set(inspector.get_table_names())
|
||||||
|
|
||||||
|
# ── Fix user.id PK only when it is genuinely wrong ────────────────
|
||||||
|
# On databases migrated from the old Peewee layer the PK may have
|
||||||
|
# drifted. Fresh installs (init migration 7e5b5dc7342b) already
|
||||||
|
# have a correct PK on 'id', so we must NOT attempt to re-create it
|
||||||
|
# — PostgreSQL will reject a duplicate PRIMARY KEY constraint.
|
||||||
pk_columns = inspector.get_pk_constraint('user')['constrained_columns']
|
pk_columns = inspector.get_pk_constraint('user')['constrained_columns']
|
||||||
id_column = next((col for col in columns if col['name'] == 'id'), None)
|
|
||||||
|
|
||||||
if id_column and not id_column.get('unique', False):
|
if pk_columns != ['id']:
|
||||||
|
columns = inspector.get_columns('user')
|
||||||
|
id_column = next((col for col in columns if col['name'] == 'id'), None)
|
||||||
unique_constraints = inspector.get_unique_constraints('user')
|
unique_constraints = inspector.get_unique_constraints('user')
|
||||||
unique_columns = {tuple(u['column_names']) for u in unique_constraints}
|
unique_columns = {tuple(u['column_names']) for u in unique_constraints}
|
||||||
|
|
||||||
with op.batch_alter_table('user') as batch_op:
|
if id_column:
|
||||||
# If primary key is wrong, drop it
|
with op.batch_alter_table('user') as batch_op:
|
||||||
if pk_columns and pk_columns != ['id']:
|
if pk_columns:
|
||||||
batch_op.drop_constraint(inspector.get_pk_constraint('user')['name'], type_='primary')
|
batch_op.drop_constraint(
|
||||||
|
inspector.get_pk_constraint('user')['name'],
|
||||||
|
type_='primary',
|
||||||
|
)
|
||||||
|
if ('id',) not in unique_columns:
|
||||||
|
batch_op.create_unique_constraint('uq_user_id', ['id'])
|
||||||
|
batch_op.create_primary_key('pk_user_id', ['id'])
|
||||||
|
|
||||||
# Add unique constraint if missing
|
# ── Create oauth_session table (idempotent) ───────────────────────
|
||||||
if ('id',) not in unique_columns:
|
if 'oauth_session' not in existing_tables:
|
||||||
batch_op.create_unique_constraint('uq_user_id', ['id'])
|
op.create_table(
|
||||||
|
'oauth_session',
|
||||||
|
sa.Column('id', sa.Text(), primary_key=True, nullable=False, unique=True),
|
||||||
|
sa.Column(
|
||||||
|
'user_id',
|
||||||
|
sa.Text(),
|
||||||
|
sa.ForeignKey('user.id', ondelete='CASCADE'),
|
||||||
|
nullable=False,
|
||||||
|
),
|
||||||
|
sa.Column('provider', sa.Text(), nullable=False),
|
||||||
|
sa.Column('token', sa.Text(), nullable=False),
|
||||||
|
sa.Column('expires_at', sa.BigInteger(), nullable=False),
|
||||||
|
sa.Column('created_at', sa.BigInteger(), nullable=False),
|
||||||
|
sa.Column('updated_at', sa.BigInteger(), nullable=False),
|
||||||
|
)
|
||||||
|
|
||||||
# Re-create correct primary key
|
# Create indexes (idempotent — no-ops when table was just created
|
||||||
batch_op.create_primary_key('pk_user_id', ['id'])
|
# with the columns above, and safe to call if indexes already exist).
|
||||||
|
existing_indexes = {
|
||||||
|
idx['name'] for idx in inspector.get_indexes('oauth_session')
|
||||||
|
} if 'oauth_session' in existing_tables else set()
|
||||||
|
|
||||||
# Create oauth_session table
|
if 'idx_oauth_session_user_id' not in existing_indexes:
|
||||||
op.create_table(
|
op.create_index('idx_oauth_session_user_id', 'oauth_session', ['user_id'])
|
||||||
'oauth_session',
|
if 'idx_oauth_session_expires_at' not in existing_indexes:
|
||||||
sa.Column('id', sa.Text(), primary_key=True, nullable=False, unique=True),
|
op.create_index('idx_oauth_session_expires_at', 'oauth_session', ['expires_at'])
|
||||||
sa.Column(
|
if 'idx_oauth_session_user_provider' not in existing_indexes:
|
||||||
'user_id',
|
op.create_index('idx_oauth_session_user_provider', 'oauth_session', ['user_id', 'provider'])
|
||||||
sa.Text(),
|
|
||||||
sa.ForeignKey('user.id', ondelete='CASCADE'),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column('provider', sa.Text(), nullable=False),
|
|
||||||
sa.Column('token', sa.Text(), nullable=False),
|
|
||||||
sa.Column('expires_at', sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column('created_at', sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column('updated_at', sa.BigInteger(), nullable=False),
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create indexes for better performance
|
|
||||||
op.create_index('idx_oauth_session_user_id', 'oauth_session', ['user_id'])
|
|
||||||
op.create_index('idx_oauth_session_expires_at', 'oauth_session', ['expires_at'])
|
|
||||||
op.create_index('idx_oauth_session_user_provider', 'oauth_session', ['user_id', 'provider'])
|
|
||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
def downgrade() -> None:
|
||||||
|
|||||||
@@ -20,20 +20,49 @@ down_revision: Union[str, None] = '2f1211949ecc'
|
|||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
|
|
||||||
|
# ── Ad-hoc table references for Core DML ─────────────────────────────────
|
||||||
|
# These are lightweight table() / column() references used only inside this
|
||||||
|
# migration for SELECT / UPDATE / INSERT — they do NOT create or alter
|
||||||
|
# anything on disk.
|
||||||
|
|
||||||
|
_user = sa.table(
|
||||||
|
'user',
|
||||||
|
sa.column('id', sa.Text),
|
||||||
|
sa.column('oauth_sub', sa.Text),
|
||||||
|
sa.column('oauth', sa.JSON),
|
||||||
|
sa.column('api_key', sa.Text),
|
||||||
|
sa.column('info', sa.Text),
|
||||||
|
sa.column('settings', sa.Text),
|
||||||
|
)
|
||||||
|
|
||||||
|
_api_key = sa.table(
|
||||||
|
'api_key',
|
||||||
|
sa.column('id', sa.Text),
|
||||||
|
sa.column('user_id', sa.Text),
|
||||||
|
sa.column('key', sa.Text),
|
||||||
|
sa.column('created_at', sa.BigInteger),
|
||||||
|
sa.column('updated_at', sa.BigInteger),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def _drop_sqlite_indexes_for_column(table_name, column_name, conn):
|
def _drop_sqlite_indexes_for_column(table_name, column_name, conn):
|
||||||
"""
|
"""
|
||||||
SQLite requires manual removal of any indexes referencing a column
|
SQLite requires manual removal of any user-created indexes referencing
|
||||||
before ALTER TABLE ... DROP COLUMN can succeed.
|
a column before ALTER TABLE ... DROP COLUMN can succeed.
|
||||||
|
|
||||||
|
NOTE: PRAGMAs have no Core equivalent — raw text is unavoidable here.
|
||||||
"""
|
"""
|
||||||
indexes = conn.execute(sa.text(f"PRAGMA index_list('{table_name}')")).fetchall()
|
indexes = conn.execute(sa.text(f"PRAGMA index_list('{table_name}')")).fetchall()
|
||||||
|
|
||||||
for idx in indexes:
|
for idx in indexes:
|
||||||
index_name = idx[1] # index name
|
index_name = idx[1] # index name
|
||||||
# Get indexed columns
|
# Skip system-managed autoindexes (PK / UNIQUE constraints) — they
|
||||||
|
# cannot be dropped directly and will disappear when the column is
|
||||||
|
# removed via batch_alter_table.
|
||||||
|
if index_name.startswith('sqlite_autoindex_'):
|
||||||
|
continue
|
||||||
idx_info = conn.execute(sa.text(f"PRAGMA index_info('{index_name}')")).fetchall()
|
idx_info = conn.execute(sa.text(f"PRAGMA index_info('{index_name}')")).fetchall()
|
||||||
|
indexed_cols = [row[2] for row in idx_info]
|
||||||
indexed_cols = [row[2] for row in idx_info] # col names
|
|
||||||
if column_name in indexed_cols:
|
if column_name in indexed_cols:
|
||||||
conn.execute(sa.text(f'DROP INDEX IF EXISTS {index_name}'))
|
conn.execute(sa.text(f'DROP INDEX IF EXISTS {index_name}'))
|
||||||
|
|
||||||
@@ -42,33 +71,31 @@ def _convert_column_to_json(table: str, column: str):
|
|||||||
conn = op.get_bind()
|
conn = op.get_bind()
|
||||||
dialect = conn.dialect.name
|
dialect = conn.dialect.name
|
||||||
|
|
||||||
|
t = sa.table(table, sa.column('id', sa.Text), sa.column(column, sa.Text))
|
||||||
|
t_json = sa.column(f'{column}_json', sa.JSON)
|
||||||
|
|
||||||
# SQLite cannot ALTER COLUMN → must recreate column
|
# SQLite cannot ALTER COLUMN → must recreate column
|
||||||
if dialect == 'sqlite':
|
if dialect == 'sqlite':
|
||||||
# 1. Add temporary column
|
|
||||||
op.add_column(table, sa.Column(f'{column}_json', sa.JSON(), nullable=True))
|
op.add_column(table, sa.Column(f'{column}_json', sa.JSON(), nullable=True))
|
||||||
|
|
||||||
# 2. Load old data
|
rows = conn.execute(sa.select(t.c.id, t.c[column])).fetchall()
|
||||||
rows = conn.execute(sa.text(f'SELECT id, {column} FROM "{table}"')).fetchall()
|
|
||||||
|
|
||||||
for row in rows:
|
for uid, raw in rows:
|
||||||
uid, raw = row
|
|
||||||
if raw is None:
|
if raw is None:
|
||||||
parsed = None
|
parsed = None
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
parsed = json.loads(raw)
|
parsed = json.loads(raw)
|
||||||
except Exception:
|
except Exception:
|
||||||
parsed = None # fallback safe behavior
|
parsed = None
|
||||||
|
|
||||||
conn.execute(
|
conn.execute(
|
||||||
sa.text(f'UPDATE "{table}" SET {column}_json = :val WHERE id = :id'),
|
sa.update(sa.table(table, sa.column('id'), t_json))
|
||||||
{'val': json.dumps(parsed) if parsed else None, 'id': uid},
|
.where(sa.column('id') == uid)
|
||||||
|
.values({f'{column}_json': json.dumps(parsed) if parsed else None})
|
||||||
)
|
)
|
||||||
|
|
||||||
# 3. Drop old TEXT column
|
|
||||||
op.drop_column(table, column)
|
op.drop_column(table, column)
|
||||||
|
|
||||||
# 4. Rename new JSON column → original name
|
|
||||||
op.alter_column(table, f'{column}_json', new_column_name=column)
|
op.alter_column(table, f'{column}_json', new_column_name=column)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@@ -85,15 +112,19 @@ def _convert_column_to_text(table: str, column: str):
|
|||||||
conn = op.get_bind()
|
conn = op.get_bind()
|
||||||
dialect = conn.dialect.name
|
dialect = conn.dialect.name
|
||||||
|
|
||||||
|
t = sa.table(table, sa.column('id', sa.Text), sa.column(column))
|
||||||
|
t_text = sa.column(f'{column}_text', sa.Text)
|
||||||
|
|
||||||
if dialect == 'sqlite':
|
if dialect == 'sqlite':
|
||||||
op.add_column(table, sa.Column(f'{column}_text', sa.Text(), nullable=True))
|
op.add_column(table, sa.Column(f'{column}_text', sa.Text(), nullable=True))
|
||||||
|
|
||||||
rows = conn.execute(sa.text(f'SELECT id, {column} FROM "{table}"')).fetchall()
|
rows = conn.execute(sa.select(t.c.id, t.c[column])).fetchall()
|
||||||
|
|
||||||
for uid, raw in rows:
|
for uid, raw in rows:
|
||||||
conn.execute(
|
conn.execute(
|
||||||
sa.text(f'UPDATE "{table}" SET {column}_text = :val WHERE id = :id'),
|
sa.update(sa.table(table, sa.column('id'), t_text))
|
||||||
{'val': json.dumps(raw) if raw else None, 'id': uid},
|
.where(sa.column('id') == uid)
|
||||||
|
.values({f'{column}_text': json.dumps(raw) if raw else None})
|
||||||
)
|
)
|
||||||
|
|
||||||
op.drop_column(table, column)
|
op.drop_column(table, column)
|
||||||
@@ -109,88 +140,102 @@ def _convert_column_to_text(table: str, column: str):
|
|||||||
|
|
||||||
|
|
||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
op.add_column('user', sa.Column('profile_banner_image_url', sa.Text(), nullable=True))
|
conn = op.get_bind()
|
||||||
op.add_column('user', sa.Column('timezone', sa.String(), nullable=True))
|
inspector = sa.inspect(conn)
|
||||||
|
existing_tables = set(inspector.get_table_names())
|
||||||
|
user_columns = {c['name'] for c in inspector.get_columns('user')}
|
||||||
|
|
||||||
op.add_column('user', sa.Column('presence_state', sa.String(), nullable=True))
|
# ── Add new columns (idempotent) ──────────────────────────────────
|
||||||
op.add_column('user', sa.Column('status_emoji', sa.String(), nullable=True))
|
for col_name, col_type in [
|
||||||
op.add_column('user', sa.Column('status_message', sa.Text(), nullable=True))
|
('profile_banner_image_url', sa.Text()),
|
||||||
op.add_column('user', sa.Column('status_expires_at', sa.BigInteger(), nullable=True))
|
('timezone', sa.String()),
|
||||||
|
('presence_state', sa.String()),
|
||||||
op.add_column('user', sa.Column('oauth', sa.JSON(), nullable=True))
|
('status_emoji', sa.String()),
|
||||||
|
('status_message', sa.Text()),
|
||||||
|
('status_expires_at', sa.BigInteger()),
|
||||||
|
('oauth', sa.JSON()),
|
||||||
|
]:
|
||||||
|
if col_name not in user_columns:
|
||||||
|
op.add_column('user', sa.Column(col_name, col_type, nullable=True))
|
||||||
|
|
||||||
# Convert info (TEXT/JSONField) → JSON
|
# Convert info (TEXT/JSONField) → JSON
|
||||||
_convert_column_to_json('user', 'info')
|
_convert_column_to_json('user', 'info')
|
||||||
# Convert settings (TEXT/JSONField) → JSON
|
# Convert settings (TEXT/JSONField) → JSON
|
||||||
_convert_column_to_json('user', 'settings')
|
_convert_column_to_json('user', 'settings')
|
||||||
|
|
||||||
op.create_table(
|
# ── Create api_key table (idempotent) ─────────────────────────────
|
||||||
'api_key',
|
if 'api_key' not in existing_tables:
|
||||||
sa.Column('id', sa.Text(), primary_key=True, unique=True),
|
op.create_table(
|
||||||
sa.Column('user_id', sa.Text(), sa.ForeignKey('user.id', ondelete='CASCADE')),
|
'api_key',
|
||||||
sa.Column('key', sa.Text(), unique=True, nullable=False),
|
sa.Column('id', sa.Text(), primary_key=True, unique=True),
|
||||||
sa.Column('data', sa.JSON(), nullable=True),
|
sa.Column('user_id', sa.Text(), sa.ForeignKey('user.id', ondelete='CASCADE')),
|
||||||
sa.Column('expires_at', sa.BigInteger(), nullable=True),
|
sa.Column('key', sa.Text(), unique=True, nullable=False),
|
||||||
sa.Column('last_used_at', sa.BigInteger(), nullable=True),
|
sa.Column('data', sa.JSON(), nullable=True),
|
||||||
sa.Column('created_at', sa.BigInteger(), nullable=False),
|
sa.Column('expires_at', sa.BigInteger(), nullable=True),
|
||||||
sa.Column('updated_at', sa.BigInteger(), nullable=False),
|
sa.Column('last_used_at', sa.BigInteger(), nullable=True),
|
||||||
)
|
sa.Column('created_at', sa.BigInteger(), nullable=False),
|
||||||
|
sa.Column('updated_at', sa.BigInteger(), nullable=False),
|
||||||
|
)
|
||||||
|
|
||||||
conn = op.get_bind()
|
# ── Migrate oauth_sub → oauth JSON (only if old column still exists)
|
||||||
users = conn.execute(sa.text('SELECT id, oauth_sub FROM "user" WHERE oauth_sub IS NOT NULL')).fetchall()
|
if 'oauth_sub' in user_columns:
|
||||||
|
rows = conn.execute(
|
||||||
|
sa.select(_user.c.id, _user.c.oauth_sub)
|
||||||
|
.where(_user.c.oauth_sub.is_not(None))
|
||||||
|
).fetchall()
|
||||||
|
|
||||||
for uid, oauth_sub in users:
|
for uid, oauth_sub in rows:
|
||||||
if oauth_sub:
|
if oauth_sub:
|
||||||
# Example formats supported:
|
provider, sub = (oauth_sub.split('@', 1) if '@' in oauth_sub
|
||||||
# provider@sub
|
else ('oidc', oauth_sub))
|
||||||
# plain sub (stored as {"oidc": {"sub": sub}})
|
conn.execute(
|
||||||
if '@' in oauth_sub:
|
sa.update(_user)
|
||||||
provider, sub = oauth_sub.split('@', 1)
|
.where(_user.c.id == uid)
|
||||||
else:
|
.values(oauth=json.dumps({provider: {'sub': sub}}))
|
||||||
provider, sub = 'oidc', oauth_sub
|
)
|
||||||
|
|
||||||
oauth_json = json.dumps({provider: {'sub': sub}})
|
# ── Migrate api_key column → api_key table (only if old column still exists)
|
||||||
conn.execute(
|
if 'api_key' in user_columns:
|
||||||
sa.text('UPDATE "user" SET oauth = :oauth WHERE id = :id'),
|
rows = conn.execute(
|
||||||
{'oauth': oauth_json, 'id': uid},
|
sa.select(_user.c.id, _user.c.api_key)
|
||||||
)
|
.where(_user.c.api_key.is_not(None))
|
||||||
|
).fetchall()
|
||||||
|
now = int(time.time())
|
||||||
|
|
||||||
users_with_keys = conn.execute(sa.text('SELECT id, api_key FROM "user" WHERE api_key IS NOT NULL')).fetchall()
|
for uid, key_val in rows:
|
||||||
now = int(time.time())
|
if key_val:
|
||||||
|
conn.execute(
|
||||||
|
sa.insert(_api_key).values(
|
||||||
|
id=f'key_{uid}',
|
||||||
|
user_id=uid,
|
||||||
|
key=key_val,
|
||||||
|
created_at=now,
|
||||||
|
updated_at=now,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
for uid, api_key in users_with_keys:
|
# ── Drop legacy columns (idempotent) ──────────────────────────────
|
||||||
if api_key:
|
cols_to_drop = {'api_key', 'oauth_sub'} & user_columns
|
||||||
conn.execute(
|
if cols_to_drop:
|
||||||
sa.text("""
|
if conn.dialect.name == 'sqlite':
|
||||||
INSERT INTO api_key (id, user_id, key, created_at, updated_at)
|
for col in cols_to_drop:
|
||||||
VALUES (:id, :user_id, :key, :created_at, :updated_at)
|
_drop_sqlite_indexes_for_column('user', col, conn)
|
||||||
"""),
|
|
||||||
{
|
|
||||||
'id': f'key_{uid}',
|
|
||||||
'user_id': uid,
|
|
||||||
'key': api_key,
|
|
||||||
'created_at': now,
|
|
||||||
'updated_at': now,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
if conn.dialect.name == 'sqlite':
|
with op.batch_alter_table('user') as batch_op:
|
||||||
_drop_sqlite_indexes_for_column('user', 'api_key', conn)
|
for col in cols_to_drop:
|
||||||
_drop_sqlite_indexes_for_column('user', 'oauth_sub', conn)
|
batch_op.drop_column(col)
|
||||||
|
|
||||||
with op.batch_alter_table('user') as batch_op:
|
|
||||||
batch_op.drop_column('api_key')
|
|
||||||
batch_op.drop_column('oauth_sub')
|
|
||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
def downgrade() -> None:
|
||||||
# --- 1. Restore old oauth_sub column ---
|
|
||||||
op.add_column('user', sa.Column('oauth_sub', sa.Text(), nullable=True))
|
op.add_column('user', sa.Column('oauth_sub', sa.Text(), nullable=True))
|
||||||
|
|
||||||
conn = op.get_bind()
|
conn = op.get_bind()
|
||||||
users = conn.execute(sa.text('SELECT id, oauth FROM "user" WHERE oauth IS NOT NULL')).fetchall()
|
rows = conn.execute(
|
||||||
|
sa.select(_user.c.id, _user.c.oauth)
|
||||||
|
.where(_user.c.oauth.is_not(None))
|
||||||
|
).fetchall()
|
||||||
|
|
||||||
for uid, oauth in users:
|
for uid, oauth in rows:
|
||||||
try:
|
try:
|
||||||
data = json.loads(oauth)
|
data = json.loads(oauth)
|
||||||
provider = list(data.keys())[0]
|
provider = list(data.keys())[0]
|
||||||
@@ -200,24 +245,24 @@ def downgrade() -> None:
|
|||||||
oauth_sub = None
|
oauth_sub = None
|
||||||
|
|
||||||
conn.execute(
|
conn.execute(
|
||||||
sa.text('UPDATE "user" SET oauth_sub = :oauth_sub WHERE id = :id'),
|
sa.update(_user)
|
||||||
{'oauth_sub': oauth_sub, 'id': uid},
|
.where(_user.c.id == uid)
|
||||||
|
.values(oauth_sub=oauth_sub)
|
||||||
)
|
)
|
||||||
|
|
||||||
op.drop_column('user', 'oauth')
|
op.drop_column('user', 'oauth')
|
||||||
|
|
||||||
# --- 2. Restore api_key field ---
|
# --- Restore api_key field ---
|
||||||
op.add_column('user', sa.Column('api_key', sa.String(), nullable=True))
|
op.add_column('user', sa.Column('api_key', sa.String(), nullable=True))
|
||||||
|
|
||||||
# Restore values from api_key
|
keys = conn.execute(sa.select(_api_key.c.user_id, _api_key.c.key)).fetchall()
|
||||||
keys = conn.execute(sa.text('SELECT user_id, key FROM api_key')).fetchall()
|
|
||||||
for uid, key in keys:
|
for uid, key in keys:
|
||||||
conn.execute(
|
conn.execute(
|
||||||
sa.text('UPDATE "user" SET api_key = :key WHERE id = :id'),
|
sa.update(_user)
|
||||||
{'key': key, 'id': uid},
|
.where(_user.c.id == uid)
|
||||||
|
.values(api_key=key)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Drop new table
|
|
||||||
op.drop_table('api_key')
|
op.drop_table('api_key')
|
||||||
|
|
||||||
with op.batch_alter_table('user') as batch_op:
|
with op.batch_alter_table('user') as batch_op:
|
||||||
|
|||||||
Reference in new issue
Block a user