Merge pull request #703 from guillegiu/master

V 4.6.0 update file
This commit is contained in:
Ivan Diaz 2020-01-23 16:48:19 -03:00 committed by GitHub
commit 03d9127a8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,29 @@
<?php
require_once '../mysql_connect.php';
print 'Begin update v4.6.0...' . PHP_EOL;
// Update Ticket table
print '[1/3] Updating ticket table...' . PHP_EOL;
if ($mysql->query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ticket' AND COLUMN_NAME = 'edited_title'")->num_rows == 0) {
$mysql->query("ALTER TABLE ticket ADD edited_title tinyint(1)");
} else {
print 'edited_title column already exists' . PHP_EOL;
}
// Update APIkey table
print '[2/3] Updating APIkey table...' . PHP_EOL;
if ($mysql->query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'apikey' AND COLUMN_NAME = 'type'")->num_rows == 0) {
$mysql->query("ALTER TABLE apikey ADD type varchar(191)");
} else {
print 'type column already exists' . PHP_EOL;
}
// Update Log table
print '[3/3] Updating Log table...' . PHP_EOL;
if ($mysql->query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'log' AND COLUMN_NAME = 'author_name'")->num_rows == 0) {
$mysql->query("ALTER TABLE log ADD author_name varchar(191)");
} else {
print 'author_name column already exists' . PHP_EOL;
}
print 'Update Completed!' . PHP_EOL;