This commit is contained in:
Gilles Soulier
2026-01-05 16:08:01 +01:00
parent dcba044cd6
commit c67befc549
2215 changed files with 26743 additions and 329 deletions
+34
View File
@@ -0,0 +1,34 @@
"""
Linux BenchTools - Peripheral History Models
"""
from sqlalchemy import Column, Integer, String, DateTime, Text
from sqlalchemy.sql import func
from app.db.base import BasePeripherals
class PeripheralLocationHistory(BasePeripherals):
"""
History of peripheral movements (location changes, assignments)
"""
__tablename__ = "peripheral_location_history"
id = Column(Integer, primary_key=True, index=True)
peripheral_id = Column(Integer, nullable=False, index=True)
# Location changes
from_location_id = Column(Integer)
to_location_id = Column(Integer)
# Device assignments
from_device_id = Column(Integer)
to_device_id = Column(Integer)
# Action details
action = Column(String(50), nullable=False) # moved, assigned, unassigned, stored
timestamp = Column(DateTime, server_default=func.now())
notes = Column(Text)
user = Column(String(100))
def __repr__(self):
return f"<PeripheralLocationHistory(id={self.id}, action='{self.action}')>"