Skip to content

Commit

Permalink
Merge pull request #199 from HSF/dev
Browse files Browse the repository at this point in the history
alembic upgrade improvements
  • Loading branch information
wguanicedew authored Sep 13, 2023
2 parents cf90dbe + e3b682f commit b332ff9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ def upgrade() -> None:

op.add_column('messages', sa.Column('fetching_id', sa.Integer()), schema=schema)

try:
op.drop_constraint('THROTTLER_SITE_UQ', table_name='throttlers', schema=schema)
except:
pass
try:
op.drop_constraint('THROTTLER_PK', table_name='throttlers', schema=schema)
except:
pass
op.create_table('throttlers',
sa.Column('throttler_id', sa.BigInteger(), sa.Sequence('THROTTLER_ID_SEQ', schema=schema)),
sa.Column('site', sa.String(50), nullable=False),
Expand All @@ -61,6 +69,7 @@ def upgrade() -> None:
sa.Column("created_at", sa.DateTime, default=datetime.datetime.utcnow, nullable=False),
sa.Column("updated_at", sa.DateTime, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow, nullable=False),
sa.Column('others', JSON()),
replace_existing=True,
schema=schema)
op.create_primary_key('THROTTLER_PK', 'throttlers', ['throttler_id'], schema=schema)
op.create_unique_constraint('THROTTLER_SITE_UQ', 'throttlers', ['site'], schema=schema)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def upgrade() -> None:
schema = context.get_context().version_table_schema if context.get_context().version_table_schema else ''
op.add_column('contents', sa.Column('sub_map_id', sa.BigInteger()), schema=schema)
op.add_column('contents', sa.Column('dep_sub_map_id', sa.BigInteger()), schema=schema)
op.drop_constraint(constraint_name="CONTENT_ID_UQ", table_name="contents", schema=schema)
try:
op.drop_constraint(constraint_name="CONTENT_ID_UQ", table_name="contents", schema=schema)
except Exception as ex:
print(ex)
op.create_unique_constraint('CONTENT_ID_UQ', 'contents', ['transform_id', 'coll_id', 'map_id', 'sub_map_id', 'dep_sub_map_id', 'content_relation_type', 'name', 'min_id', 'max_id'], schema=schema)


Expand Down
8 changes: 6 additions & 2 deletions main/lib/idds/tests/panda_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
task_ids = []
for task_id in task_ids:
print("retry %s" % task_id)
ret = Client.retryTask(task_id, verbose=True)
print(ret)
# ret = Client.retryTask(task_id, verbose=True)
# print(ret)

# sys.exit(0)

Expand All @@ -27,6 +27,10 @@
task_ids = [161488, 154806, 154805, 153413]
task_ids = [i for i in range(191, 220)]
task_ids = [162763, 162753]
task_ids = [i for i in range(164147, 164384)]
task_ids += [162282, 162283, 162588]
task_ids = [i for i in range(163930, 164147)]
task_ids = [161142, 160648]
for task_id in task_ids:
print("Killing %s" % task_id)
ret = Client.killTask(task_id, verbose=True)
Expand Down

0 comments on commit b332ff9

Please sign in to comment.