Add TuxiNet branding and document templates
This commit is contained in:
19
database/migrations/2024_01_01_000011_create_audit_table.php
Normal file
19
database/migrations/2024_01_01_000011_create_audit_table.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use PDO;
|
||||
|
||||
return function (PDO $pdo): void {
|
||||
$pdo->exec(<<<SQL
|
||||
CREATE TABLE audit (
|
||||
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
||||
user_id INT UNSIGNED NULL,
|
||||
entity VARCHAR(100) NOT NULL,
|
||||
entity_id INT UNSIGNED NULL,
|
||||
action VARCHAR(100) NOT NULL,
|
||||
meta_json JSON NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
CONSTRAINT fk_audit_user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL,
|
||||
INDEX idx_audit_entity (entity, entity_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
SQL);
|
||||
};
|
||||
Reference in New Issue
Block a user