bug fix change smallint for integer

This commit is contained in:
Cayo Puigdefabregas 2021-01-21 17:13:36 +01:00
parent 8820395211
commit 14a27a3d85
3 changed files with 39 additions and 3 deletions

View File

@ -0,0 +1,36 @@
"""change TestDataStorage SmallInt for Integer
Revision ID: 0cbd839b09ef
Revises: b4bd1538bad5
Create Date: 2021-01-21 12:53:21.996221
"""
from alembic import context
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
import citext
import teal
# revision identifiers, used by Alembic.
revision = '0cbd839b09ef'
down_revision = 'b4bd1538bad5'
branch_labels = None
depends_on = None
def get_inv():
INV = context.get_x_argument(as_dictionary=True).get('inventory')
if not INV:
raise ValueError("Inventory value is not specified")
return INV
def upgrade():
op.alter_column('test_data_storage', 'current_pending_sector_count', type_=sa.Integer(), schema=f'{get_inv()}')
op.alter_column('test_data_storage', 'offline_uncorrectable', type_=sa.Integer(), schema=f'{get_inv()}')
def downgrade():
op.alter_column('test_data_storage', 'current_pending_sector_count', type_=sa.SmallInteger(), schema=f'{get_inv()}')
op.alter_column('test_data_storage', 'offline_uncorrectable', type_=sa.SmallInteger(), schema=f'{get_inv()}')

View File

@ -742,8 +742,8 @@ class TestDataStorage(TestMixin, Test):
power_cycle_count = Column(SmallInteger)
_reported_uncorrectable_errors = Column('reported_uncorrectable_errors', Integer)
command_timeout = Column(Integer)
current_pending_sector_count = Column(SmallInteger)
offline_uncorrectable = Column(SmallInteger)
current_pending_sector_count = Column(Integer)
offline_uncorrectable = Column(Integer)
remaining_lifetime_percentage = Column(SmallInteger)
elapsed = Column(Interval, nullable=False)

View File

@ -21,7 +21,7 @@
],
"manufacturer": "ASUSTeK Computer INC."
},
"uuid": "d1b70cb8-8929-4f36-99b7-fe052cec0abd",
"uuid": "d1b70cb8-8929-4f36-99b7-fe052cec0ab1",
"components": [
{
"serialNumber": "00:24:8c:7f:cf:2d",