Initial commit of the Asset Management System, including project structure, Docker configuration, database migrations, and core application files. Added user authentication, asset management features, and basic UI components.
This commit is contained in:
16
database/migrations/011_create_audit_log_table.sql
Normal file
16
database/migrations/011_create_audit_log_table.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
CREATE TABLE audit_log (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
user_id INT,
|
||||
action VARCHAR(50) NOT NULL,
|
||||
table_name VARCHAR(100) NOT NULL,
|
||||
record_id INT NOT NULL,
|
||||
old_value JSON,
|
||||
new_value JSON,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL,
|
||||
INDEX idx_user_id (user_id),
|
||||
INDEX idx_action (action),
|
||||
INDEX idx_table_name (table_name),
|
||||
INDEX idx_record_id (record_id),
|
||||
INDEX idx_created_at (created_at)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
Reference in New Issue
Block a user