Add a user field in the audit table

master
Daniel Berteaud 10 years ago
parent bcbe2e1f32
commit c57936bb0c
  1. 4
      docs/database/schema.mysql
  2. 4
      scripts/db_upgrade.pl

@ -93,9 +93,11 @@ CREATE TABLE `audit` (
`date` DATETIME NOT NULL, `date` DATETIME NOT NULL,
`event` VARCHAR(255) NOT NULL, `event` VARCHAR(255) NOT NULL,
`from_ip` VARCHAR(45) DEFAULT NULL, `from_ip` VARCHAR(45) DEFAULT NULL,
`user` VARCHAR(255) DEFAULT NULL,
`message` TEXT NOT NULL, `message` TEXT NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX (`date`), INDEX (`date`),
INDEX (`event`), INDEX (`event`),
INDEX (`from_ip`) INDEX (`from_ip`),
INDEX (`user`),
) ENGINE INNODB DEFAULT CHARSET=utf8; ) ENGINE INNODB DEFAULT CHARSET=utf8;

@ -175,11 +175,13 @@ if ($cur_ver < 8){
`date` DATETIME NOT NULL, `date` DATETIME NOT NULL,
`event` VARCHAR(255) NOT NULL, `event` VARCHAR(255) NOT NULL,
`from_ip` VARCHAR(45) DEFAULT NULL, `from_ip` VARCHAR(45) DEFAULT NULL,
`user` VARCHAR(255) DEFAULT NULL,
`message` TEXT NOT NULL, `message` TEXT NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX (`date`), INDEX (`date`),
INDEX (`event`), INDEX (`event`),
INDEX (`from_ip`)) INDEX (`from_ip`),
INDEX (`user`))
ENGINE INNODB DEFAULT CHARSET=utf8; }); ENGINE INNODB DEFAULT CHARSET=utf8; });
$dbh->do(qq{ UPDATE `config` SET `value`='8' WHERE `key`='schema_version' }); $dbh->do(qq{ UPDATE `config` SET `value`='8' WHERE `key`='schema_version' });
$dbh->commit; $dbh->commit;

Loading…
Cancel
Save