Initial Switch to V2. Completely Overhauled Backend, Frontend and General Structure.
This commit is contained in:
22
backend/manufacturing/orm.py
Normal file
22
backend/manufacturing/orm.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from datetime import datetime, timezone
|
||||
from sqlalchemy import BigInteger, Column, DateTime, Index, String, Text
|
||||
from database.postgres import Base
|
||||
|
||||
|
||||
def _now():
|
||||
return datetime.now(timezone.utc)
|
||||
|
||||
|
||||
class MfgAuditLog(Base):
|
||||
__tablename__ = "mfg_audit_log"
|
||||
__table_args__ = (
|
||||
Index("idx_mfg_audit_time", "timestamp"),
|
||||
Index("idx_mfg_audit_action", "action"),
|
||||
)
|
||||
|
||||
id = Column(BigInteger, primary_key=True, autoincrement=True)
|
||||
timestamp = Column(DateTime(timezone=True), nullable=False, default=_now)
|
||||
admin_user = Column(String(256), nullable=False)
|
||||
action = Column(String(128), nullable=False)
|
||||
serial_number = Column(String(128))
|
||||
detail = Column(Text)
|
||||
Reference in New Issue
Block a user