fix log
This commit is contained in:
19
database.sql
19
database.sql
@@ -100,3 +100,22 @@ WHERE t.id NOT IN (
|
||||
)
|
||||
GROUP BY t.id, t.numero, t.zona, t.tipologia, t.image_path
|
||||
ORDER BY last_returned_date ASC NULLS FIRST;
|
||||
|
||||
-- Tabella log attività
|
||||
CREATE TABLE IF NOT EXISTS activity_logs (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
user_id INT NOT NULL,
|
||||
username VARCHAR(50) NOT NULL,
|
||||
action_type VARCHAR(50) NOT NULL,
|
||||
action_description TEXT NOT NULL,
|
||||
entity_type VARCHAR(50),
|
||||
entity_id INT,
|
||||
ip_address VARCHAR(45),
|
||||
user_agent TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
|
||||
INDEX idx_user (user_id),
|
||||
INDEX idx_action_type (action_type),
|
||||
INDEX idx_created_at (created_at),
|
||||
INDEX idx_entity (entity_type, entity_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
Reference in New Issue
Block a user