-
Notifications
You must be signed in to change notification settings - Fork 9
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 #355 from HSF/dev
Dev
- Loading branch information
Showing
8 changed files
with
123 additions
and
6 deletions.
There are no files selected for viewing
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
67 changes: 67 additions & 0 deletions
67
...lib/idds/orm/base/alembic/versions/a844dae57021_add_process_thread_locking_information.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,67 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# You may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0OA | ||
# | ||
# Authors: | ||
# - Wen Guan, <[email protected]>, 2024 | ||
|
||
"""add process thread locking information | ||
Revision ID: a844dae57021 | ||
Revises: 3073c5de8f73 | ||
Create Date: 2024-10-15 13:55:49.485737+00:00 | ||
""" | ||
from alembic import op | ||
from alembic import context | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'a844dae57021' | ||
down_revision = '3073c5de8f73' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
if context.get_context().dialect.name in ['oracle', 'mysql', 'postgresql']: | ||
schema = context.get_context().version_table_schema if context.get_context().version_table_schema else '' | ||
|
||
op.add_column('requests', sa.Column('locking_hostname', sa.String(50)), schema=schema) | ||
op.add_column('requests', sa.Column('locking_pid', sa.BigInteger()), schema=schema) | ||
op.add_column('requests', sa.Column('locking_thread_id', sa.BigInteger()), schema=schema) | ||
op.add_column('requests', sa.Column('locking_thread_name', sa.String(50)), schema=schema) | ||
|
||
op.add_column('transforms', sa.Column('locking_hostname', sa.String(50)), schema=schema) | ||
op.add_column('transforms', sa.Column('locking_pid', sa.BigInteger()), schema=schema) | ||
op.add_column('transforms', sa.Column('locking_thread_id', sa.BigInteger()), schema=schema) | ||
op.add_column('transforms', sa.Column('locking_thread_name', sa.String(50)), schema=schema) | ||
|
||
op.add_column('processings', sa.Column('locking_hostname', sa.String(50)), schema=schema) | ||
op.add_column('processings', sa.Column('locking_pid', sa.BigInteger()), schema=schema) | ||
op.add_column('processings', sa.Column('locking_thread_id', sa.BigInteger()), schema=schema) | ||
op.add_column('processings', sa.Column('locking_thread_name', sa.String(50)), schema=schema) | ||
|
||
|
||
def downgrade() -> None: | ||
if context.get_context().dialect.name in ['oracle', 'mysql', 'postgresql']: | ||
schema = context.get_context().version_table_schema if context.get_context().version_table_schema else '' | ||
|
||
op.drop_column('requests', 'locking_hostname', schema=schema) | ||
op.drop_column('requests', 'locking_pid', schema=schema) | ||
op.drop_column('requests', 'locking_thread_id', schema=schema) | ||
op.drop_column('requests', 'locking_thread_name', schema=schema) | ||
|
||
op.drop_column('transforms', 'locking_hostname', schema=schema) | ||
op.drop_column('transforms', 'locking_pid', schema=schema) | ||
op.drop_column('transforms', 'locking_thread_id', schema=schema) | ||
op.drop_column('transforms', 'locking_thread_name', schema=schema) | ||
|
||
op.drop_column('processings', 'locking_hostname', schema=schema) | ||
op.drop_column('processings', 'locking_pid', schema=schema) | ||
op.drop_column('processings', 'locking_thread_id', schema=schema) | ||
op.drop_column('processings', 'locking_thread_name', schema=schema) |
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