Skip to content

Commit 1f0fdb3

Browse files
authored
[FIX] Change boolean type from bit to tinyint (#847)
1 parent 7de11ae commit 1f0fdb3

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

migrations/versions/a5183973c3e9_.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""Change SQLAlchemy Boolean bit(1) to bool
2+
3+
Revision ID: a5183973c3e9
4+
Revises: 2e0d2e02a721
5+
Create Date: 2023-08-10 15:51:13.537000
6+
7+
"""
8+
import sqlalchemy as sa
9+
from alembic import op
10+
11+
# revision identifiers, used by Alembic.
12+
revision = 'a5183973c3e9'
13+
down_revision = '2e0d2e02a721'
14+
branch_labels = None
15+
depends_on = None
16+
17+
18+
def upgrade():
19+
op.alter_column('regression_test', 'active', existing_type=sa.dialects.mysql.BIT(1), type_=sa.Boolean(), nullable=False)
20+
21+
22+
def downgrade():
23+
op.alter_column('regression_test', 'active', existing_type=sa.Boolean(), type_=sa.dialects.mysql.BIT(1), nullable=False)

templates/regression/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h1>Regression tests</h1>
4747
<tr data-category="[{{ test.categories|join(', ', attribute='id') }}]">
4848
<td>{{ test.id }}</td>
4949
<td>{{ test.command }}</td>
50-
<td id="status-toggle-{{test.id}}">{{ true if test.active == 1 else false}}</td>
50+
<td id="status-toggle-{{test.id}}">{{ test.active }}</td>
5151
<td>
5252
<a href="{{ url_for('.test_view', regression_id=test.id) }}" title="View details"><i class="fa fa-info-circle"></i></a>&nbsp;
5353
{% if user is not none and user.has_role('contributor') %}

0 commit comments

Comments
 (0)