remove deallocate
This commit is contained in:
parent
9f1564a533
commit
200974e8f6
|
@ -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()}')
|
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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
|
|
||||||
|
|
Reference in New Issue