Commit 0847a500 by Daniel Ruf Committed by Scott

check if table eventlog exists

parent 56179a8b
......@@ -1470,8 +1470,11 @@
case 63:
// convert IP addresses to new binary format
qa_db_upgrade_query('ALTER TABLE ^eventlog MODIFY ipaddress VARBINARY(16) NULL DEFAULT NULL');
qa_db_upgrade_query('UPDATE ^eventlog SET ipaddress = UNHEX(HEX(CAST(ipaddress AS UNSIGNED)))');
$eventlog_exists = (bool)qa_db_read_one_value(qa_db_query_sub("SELECT 1 FROM ^eventlog LIMIT 1"));
if($eventlog_exists){
qa_db_upgrade_query('ALTER TABLE ^eventlog MODIFY ipaddress VARBINARY(16) NULL DEFAULT NULL');
qa_db_upgrade_query('UPDATE ^eventlog SET ipaddress = UNHEX(HEX(CAST(ipaddress AS UNSIGNED)))');
}
qa_db_upgrade_query('ALTER TABLE ^cookies MODIFY writeip VARBINARY(16) NULL DEFAULT NULL, MODIFY createip VARBINARY(16) NULL DEFAULT NULL');
qa_db_upgrade_query('UPDATE ^cookies SET writeip = UNHEX(HEX(CAST(writeip AS UNSIGNED))), createip = UNHEX(HEX(CAST(createip AS UNSIGNED)))');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment