adding migration for live
This commit is contained in:
parent
8b4c27dfe2
commit
8999b6e9a5
|
@ -53,5 +53,17 @@ def upgrade():
|
||||||
# Receive action
|
# Receive action
|
||||||
op.drop_table('receive', schema=f'{get_inv()}')
|
op.drop_table('receive', schema=f'{get_inv()}')
|
||||||
|
|
||||||
|
# Live action
|
||||||
|
op.drop_table('live', schema=f'{get_inv()}')
|
||||||
|
op.create_table('live',
|
||||||
|
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
|
||||||
|
sa.Column('serial_number', sa.Unicode(), nullable=True,
|
||||||
|
comment='The serial number of the Hard Disk in lower case.'),
|
||||||
|
sa.Column('time', sa.Interval(), nullable=True),
|
||||||
|
sa.ForeignKeyConstraint(['id'], [f'{get_inv()}.action.id'], ),
|
||||||
|
sa.PrimaryKeyConstraint('id'),
|
||||||
|
schema=f'{get_inv()}'
|
||||||
|
)
|
||||||
|
|
||||||
def downgrade():
|
def downgrade():
|
||||||
op.drop_table('allocate', schema=f'{get_inv()}')
|
op.drop_table('allocate', schema=f'{get_inv()}')
|
||||||
|
|
|
@ -1296,8 +1296,8 @@ class Live(JoinedWithOneDeviceMixin, ActionWithOneDevice):
|
||||||
and usage statistics.
|
and usage statistics.
|
||||||
"""
|
"""
|
||||||
serial_number = Column(Unicode(), check_lower('serial_number'))
|
serial_number = Column(Unicode(), check_lower('serial_number'))
|
||||||
serial_number.comment = """The serial number of the HardDisk in lower case."""
|
serial_number.comment = """The serial number of the Hard Disk in lower case."""
|
||||||
time = Column(Interval)
|
time = Column(Interval, nullable=True)
|
||||||
|
|
||||||
|
|
||||||
class Organize(JoinedTableMixin, ActionWithMultipleDevices):
|
class Organize(JoinedTableMixin, ActionWithMultipleDevices):
|
||||||
|
|
Reference in New Issue