From c57936bb0c79ca3b3efd1945c6cb8bd564ac72d8 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 7 Jul 2015 18:19:44 +0200 Subject: [PATCH] Add a user field in the audit table --- docs/database/schema.mysql | 4 +++- scripts/db_upgrade.pl | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/database/schema.mysql b/docs/database/schema.mysql index 6dfff3f..c83c2bf 100644 --- a/docs/database/schema.mysql +++ b/docs/database/schema.mysql @@ -93,9 +93,11 @@ CREATE TABLE `audit` ( `date` DATETIME NOT NULL, `event` VARCHAR(255) NOT NULL, `from_ip` VARCHAR(45) DEFAULT NULL, + `user` VARCHAR(255) DEFAULT NULL, `message` TEXT NOT NULL, PRIMARY KEY (`id`), INDEX (`date`), INDEX (`event`), - INDEX (`from_ip`) + INDEX (`from_ip`), + INDEX (`user`), ) ENGINE INNODB DEFAULT CHARSET=utf8; diff --git a/scripts/db_upgrade.pl b/scripts/db_upgrade.pl index 4b50fc4..3fa5811 100644 --- a/scripts/db_upgrade.pl +++ b/scripts/db_upgrade.pl @@ -175,11 +175,13 @@ if ($cur_ver < 8){ `date` DATETIME NOT NULL, `event` VARCHAR(255) NOT NULL, `from_ip` VARCHAR(45) DEFAULT NULL, + `user` VARCHAR(255) DEFAULT NULL, `message` TEXT NOT NULL, PRIMARY KEY (`id`), INDEX (`date`), INDEX (`event`), - INDEX (`from_ip`)) + INDEX (`from_ip`), + INDEX (`user`)) ENGINE INNODB DEFAULT CHARSET=utf8; }); $dbh->do(qq{ UPDATE `config` SET `value`='8' WHERE `key`='schema_version' }); $dbh->commit;