remove deallocate

This commit is contained in:
Cayo Puigdefabregas 2020-11-19 11:36:09 +01:00
parent 9f1564a533
commit 200974e8f6
4 changed files with 2 additions and 22 deletions

View File

@ -38,15 +38,8 @@ def upgrade():
) )
op.drop_table('deallocate', schema=f'{get_inv()}') op.drop_table('deallocate', schema=f'{get_inv()}')
op.create_table('deallocate',
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
sa.ForeignKeyConstraint(['id'], [f'{get_inv()}.action.id'], ),
sa.PrimaryKeyConstraint('id'),
schema=f'{get_inv()}'
)
op.add_column('device', sa.Column('inuse', sa.Boolean(), nullable=True), schema=f'{get_inv()}') op.add_column('device', sa.Column('allocate', sa.Boolean(), nullable=True), schema=f'{get_inv()}')
def downgrade(): def downgrade():
op.drop_table('allocate', schema=f'{get_inv()}') op.drop_table('allocate', schema=f'{get_inv()}')
op.drop_table('deallocate', schema=f'{get_inv()}')

View File

@ -319,10 +319,6 @@ class Allocate(JoinedTableMixin, ActionWithMultipleDevices):
end_users = Column(Numeric(precision=4), check_range('end_users', 0), nullable=False) end_users = Column(Numeric(precision=4), check_range('end_users', 0), nullable=False)
class Deallocate(JoinedTableMixin, ActionWithMultipleDevices):
pass
class EraseBasic(JoinedWithOneDeviceMixin, ActionWithOneDevice): class EraseBasic(JoinedWithOneDeviceMixin, ActionWithOneDevice):
"""An erasure attempt to a ``DataStorage``. The action contains """An erasure attempt to a ``DataStorage``. The action contains
information about success and nature of the erasure. information about success and nature of the erasure.

View File

@ -75,11 +75,6 @@ class Allocate(ActionWithMultipleDevices):
required=True) required=True)
class Deallocate(ActionWithMultipleDevices):
__doc__ = m.Deallocate.__doc__
end_time = DateTime(data_key='end_time', description=m.Action.end_time.comment)
class EraseBasic(ActionWithOneDevice): class EraseBasic(ActionWithOneDevice):
__doc__ = m.EraseBasic.__doc__ __doc__ = m.EraseBasic.__doc__
steps = NestedOn('Step', many=True) steps = NestedOn('Step', many=True)

View File

@ -1,14 +1,10 @@
from typing import Callable, Iterable, Tuple from typing import Callable, Iterable, Tuple
from ereuse_devicehub.resources.action import schemas from ereuse_devicehub.resources.action import schemas
from teal.resource import Resource from teal.resource import Resource
from ereuse_devicehub.resources.allocate.views import AllocateView, DeAllocateView from ereuse_devicehub.resources.allocate.views import AllocateView
class AssignedDef(Resource): class AssignedDef(Resource):
VIEW = AllocateView VIEW = AllocateView
SCHEMA = schemas.Allocate SCHEMA = schemas.Allocate
class EndAssignedDef(Resource):
VIEW = DeAllocateView
SCHEMA = schemas.Deallocate