Rewrote audit log to be OOP.
This commit is contained in:
parent
fe58673890
commit
bfe69276b8
22 changed files with 316 additions and 275 deletions
21
database/2020_05_21_145756_audit_log_table_fixes.php
Normal file
21
database/2020_05_21_145756_audit_log_table_fixes.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
namespace Misuzu\DatabaseMigrations\AuditLogTableFixes;
|
||||
|
||||
use PDO;
|
||||
|
||||
function migrate_up(PDO $conn): void {
|
||||
$conn->exec('
|
||||
ALTER TABLE `msz_audit_log`
|
||||
DROP COLUMN `log_id`,
|
||||
ADD INDEX `audit_log_created_index` (`log_created`);
|
||||
');
|
||||
}
|
||||
|
||||
function migrate_down(PDO $conn): void {
|
||||
$conn->exec("
|
||||
ALTER TABLE `msz_audit_log`
|
||||
ADD COLUMN `log_id` INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST,
|
||||
DROP INDEX `audit_log_created_index`,
|
||||
ADD PRIMARY KEY (`log_id`);
|
||||
");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue