Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 64 additions & 21 deletions migrations/versions/7793881905c5_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,85 @@
Create Date: 2025-07-24 09:51:55.814649

"""
from alembic import op

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = '7793881905c5'
down_revision = 'b3ed927671bd'
revision = "7793881905c5"
down_revision = "b3ed927671bd"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('regression_test', schema=None) as batch_op:
batch_op.add_column(sa.Column('last_passed_on_windows', sa.Integer(), nullable=True))
batch_op.add_column(sa.Column('last_passed_on_linux', sa.Integer(), nullable=True))
batch_op.drop_constraint('regression_test_ibfk_2', type_='foreignkey')
batch_op.drop_constraint('regression_test_ibfk_1', type_='foreignkey')
batch_op.create_foreign_key(None, 'test', ['last_passed_on_windows'], ['id'], onupdate='CASCADE', ondelete='SET NULL')
batch_op.create_foreign_key(None, 'test', ['last_passed_on_linux'], ['id'], onupdate='CASCADE', ondelete='SET NULL')
batch_op.create_foreign_key(None, 'sample', ['sample_id'], ['id'], onupdate='CASCADE', ondelete='CASCADE')
batch_op.drop_column('last_passed_on')
with op.batch_alter_table("regression_test", schema=None) as batch_op:
batch_op.add_column(
sa.Column("last_passed_on_windows", sa.Integer(), nullable=True)
)
batch_op.add_column(
sa.Column("last_passed_on_linux", sa.Integer(), nullable=True)
)
batch_op.drop_constraint("regression_test_ibfk_2", type_="foreignkey")
batch_op.drop_constraint("regression_test_ibfk_1", type_="foreignkey")
batch_op.create_foreign_key(
None,
"test",
["last_passed_on_windows"],
["id"],
onupdate="CASCADE",
ondelete="SET NULL",
)
batch_op.create_foreign_key(
None,
"test",
["last_passed_on_linux"],
["id"],
onupdate="CASCADE",
ondelete="SET NULL",
)
batch_op.create_foreign_key(
None,
"sample",
["sample_id"],
["id"],
onupdate="CASCADE",
ondelete="CASCADE",
)
batch_op.drop_column("last_passed_on")

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('regression_test', schema=None) as batch_op:
batch_op.add_column(sa.Column('last_passed_on', mysql.INTEGER(), autoincrement=False, nullable=True))
batch_op.drop_constraint(None, type_='foreignkey')
batch_op.drop_constraint(None, type_='foreignkey')
batch_op.drop_constraint(None, type_='foreignkey')
batch_op.create_foreign_key('regression_test_ibfk_1', 'sample', ['sample_id'], ['id'], onupdate='CASCADE')
batch_op.create_foreign_key('regression_test_ibfk_2', 'test', ['last_passed_on'], ['id'], onupdate='CASCADE', ondelete='SET NULL')
batch_op.drop_column('last_passed_on_linux')
batch_op.drop_column('last_passed_on_windows')
with op.batch_alter_table("regression_test", schema=None) as batch_op:
batch_op.add_column(
sa.Column(
"last_passed_on", mysql.INTEGER(), autoincrement=False, nullable=True
)
)
batch_op.drop_constraint(None, type_="foreignkey")
batch_op.drop_constraint(None, type_="foreignkey")
batch_op.drop_constraint(None, type_="foreignkey")
batch_op.create_foreign_key(
"regression_test_ibfk_1",
"sample",
["sample_id"],
["id"],
onupdate="CASCADE",
)
batch_op.create_foreign_key(
"regression_test_ibfk_2",
"test",
["last_passed_on"],
["id"],
onupdate="CASCADE",
ondelete="SET NULL",
)
batch_op.drop_column("last_passed_on_linux")
batch_op.drop_column("last_passed_on_windows")

# ### end Alembic commands ###
4 changes: 2 additions & 2 deletions templates/ci/pr_comment.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ NOTE: The following tests have been failing on the master branch as well as the
<li> ccextractor {{ test.command }} <a href="{{ url_for('sample.sample_by_id', sample_id=test.sample.id, _external=True) }}">{{ test.sample.sha[:10] }}...</a>, Last passed:
{% set last_passed_id = test.last_passed_on_windows if platform.lower() == 'windows' else test.last_passed_on_linux %}
{% if last_passed_id %}
<a href="{{ url_for('test.by_id', test_id=last_passed_id, _external=True) }}">Test {{ last_passed_id }}</a>
<a href="{{ url_for('test.by_id', test_id=last_passed_id, _external=True) }}">Test {{ last_passed_id }}</a>
{% else %}
<span>Never</span>
<span>Never</span>
{% endif %}
</li>
{% endfor %}
Expand Down
Loading