Rewrote audit log to be OOP.

This commit is contained in:
flash 2020-05-21 15:05:30 +00:00
parent fe58673890
commit bfe69276b8
22 changed files with 316 additions and 275 deletions

View 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`);
");
}