Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 46dc4eb

Browse files
committed
BUG: refs #1001. Remove on update clause of mysql date_update columns
1 parent 1aa518a commit 46dc4eb

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

core/database/upgrade/3.2.14.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
/**
4+
* Upgrade 3.2.14 fixes bug #1001: folder modified time changed incorrectly
5+
*/
6+
class Upgrade_3_2_14 extends MIDASUpgrade
7+
{
8+
9+
public function preUpgrade()
10+
{
11+
}
12+
13+
public function mysql()
14+
{
15+
// Remove "on update current timestamp" qualifier from the date_update column
16+
$this->db->query("ALTER TABLE `folder`
17+
CHANGE `date_update` `date_update` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP");
18+
$this->db->query("ALTER TABLE `item`
19+
CHANGE `date_update` `date_update` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP");
20+
$this->db->query("ALTER TABLE `itemrevision`
21+
CHANGE `date` `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP");
22+
$this->db->query("ALTER TABLE `bitstream`
23+
CHANGE `date` `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP");
24+
}
25+
26+
public function pgsql()
27+
{
28+
// bug only existed in our mysql table defs, NOP for pgsql
29+
}
30+
31+
public function postUpgrade()
32+
{
33+
}
34+
}
35+
?>

0 commit comments

Comments
 (0)