Skip to content

Commit

Permalink
Change schema change_log.user_id -> change_log.ack_by.
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-unwin committed Mar 18, 2024
1 parent 9c9a000 commit bce6a59
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions app/Models/db_upgrades/db_5.2.0.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
<?php
$output .= "Upgrade database to 5.2.0 commenced.\n\n";

if ($db->fieldExists('user_id', 'change_log')) {
$sql = "ALTER TABLE `change_log` DROP `user_id`";
$db->query($sql);
$output .= str_replace("\n", " ", (string)$db->getLastQuery()) . "\n\n";
log_message('info', (string)$db->getLastQuery());
}

if (!$db->fieldExists('ack_by', 'change_log')) {
$sql = "ALTER TABLE `change_log` ADD `ack_by` varchar(200) NOT NULL DEFAULT ''";
$db->query($sql);
$output .= str_replace("\n", " ", (string)$db->getLastQuery()) . "\n\n";
log_message('info', (string)$db->getLastQuery());
}

$sql = "DELETE FROM `configuration` WHERE `name` IN ('product', 'oae_product')";
$db->query($sql);
$output .= str_replace("\n", " ", (string)$db->getLastQuery()) . "\n\n";
Expand Down
2 changes: 1 addition & 1 deletion other/open-audit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ CREATE TABLE `change_log` (
`db_row` int(10) unsigned NOT NULL DEFAULT '0',
`db_action` enum('','create','update','delete') NOT NULL DEFAULT '',
`details` text NOT NULL,
`user_id` int(10) unsigned DEFAULT NULL,
`ack_by` varchar(200) NOT NULL DEFAULT '',
`ack_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00',
`external_link` varchar(200) NOT NULL DEFAULT '',
`external_ident` varchar(200) NOT NULL DEFAULT '',
Expand Down

0 comments on commit bce6a59

Please sign in to comment.