Skip to content
This repository was archived by the owner on Dec 4, 2020. It is now read-only.

Commit e9812f6

Browse files
authored
Merge pull request #1398 from Kreidos/fix/timestamp-maria
Adjust char timestamp migration for older Mariadb
2 parents a3e7213 + 9e82e75 commit e9812f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sql/chars.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ CREATE TABLE `chars` (
4949
`isstylelocked` tinyint(1) NOT NULL DEFAULT '0',
5050
`nnameflags` int(10) UNSIGNED NOT NULL DEFAULT '0',
5151
`moghancement` smallint(4) unsigned NOT NULL DEFAULT '0',
52-
`lastupdate` timestamp ON UPDATE CURRENT_TIMESTAMP,
52+
`lastupdate` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
5353
PRIMARY KEY (`charid`),
5454
FULLTEXT KEY `charname` (`charname`)
5555
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

tools/migrations/char_timestamp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ def needs_to_run(cur):
1818
return True
1919

2020
def migrate(cur, db):
21-
cur.execute("ALTER TABLE `chars` ADD COLUMN lastupdate TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;")
21+
cur.execute("ALTER TABLE `chars` ADD COLUMN lastupdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;")
2222
db.commit()
2323

0 commit comments

Comments
 (0)