06/03 Optimize app
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
from app.extensions import db
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class AuditLog(db.Model):
|
||||
__tablename__ = 'audit_logs'
|
||||
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
timestamp = db.Column(db.DateTime, default=datetime.utcnow, index=True)
|
||||
action = db.Column(db.String(64), nullable=False, index=True)
|
||||
description = db.Column(db.String(255), nullable=True)
|
||||
ip_address = db.Column(db.String(45), nullable=True) # IPv4 or IPv6
|
||||
|
||||
def __repr__(self):
|
||||
return f'<AuditLog {self.action} @ {self.timestamp}>'
|
||||
Reference in New Issue
Block a user