|
|
@ -1556,6 +1556,23 @@ function xmldb_game_upgrade($oldversion) { |
|
|
|
$dbman->change_field_type($table, $field); |
|
|
|
} |
|
|
|
|
|
|
|
if ($oldversion < ($ver = 2017061604)) { |
|
|
|
$table = new xmldb_table('game_cross'); |
|
|
|
$field = new xmldb_field('usedrows', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, null, null, '0', 'id'); |
|
|
|
if (!$dbman->field_exists($table, $field)) { |
|
|
|
$dbman->add_field($table, $field); |
|
|
|
} |
|
|
|
|
|
|
|
$field = new xmldb_field('rows', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, null, null, '0', 'id'); |
|
|
|
if ($dbman->field_exists($table, $field)) { |
|
|
|
$sql = "UPDATE {$CFG->prefix}game_cross SET usedrows=rows"; |
|
|
|
$DB->execute( $sql); |
|
|
|
$dbman->drop_field($table, $field); |
|
|
|
} else { |
|
|
|
$dbman->add_field($table, $field); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ($oldversion < ($ver = 2017061604)) { |
|
|
|
$table = new xmldb_table('game_cross'); |
|
|
|
$field = new xmldb_field('usedcols', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, null, null, '0', 'id'); |
|
|
@ -1573,8 +1590,8 @@ function xmldb_game_upgrade($oldversion) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ($oldversion < ($ver = 2017061604)) { |
|
|
|
$table = new xmldb_table('game_cross'); |
|
|
|
if ($oldversion < ($ver = 2017061901)) { |
|
|
|
$table = new xmldb_table('game_snakes_database'); |
|
|
|
$field = new xmldb_field('usedrows', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, null, null, '0', 'id'); |
|
|
|
if (!$dbman->field_exists($table, $field)) { |
|
|
|
$dbman->add_field($table, $field); |
|
|
@ -1582,7 +1599,7 @@ function xmldb_game_upgrade($oldversion) { |
|
|
|
|
|
|
|
$field = new xmldb_field('rows', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, null, null, '0', 'id'); |
|
|
|
if ($dbman->field_exists($table, $field)) { |
|
|
|
$sql = "UPDATE {$CFG->prefix}game_cross SET usedrows=rows"; |
|
|
|
$sql = "UPDATE {$CFG->prefix}game_snakes_database SET usedrows=rows"; |
|
|
|
$DB->execute( $sql); |
|
|
|
$dbman->drop_field($table, $field); |
|
|
|
} else { |
|
|
@ -1590,5 +1607,22 @@ function xmldb_game_upgrade($oldversion) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ($oldversion < ($ver = 2017061901)) { |
|
|
|
$table = new xmldb_table('game_snakes_database'); |
|
|
|
$field = new xmldb_field('usedcols', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, null, null, '0', 'id'); |
|
|
|
if (!$dbman->field_exists($table, $field)) { |
|
|
|
$dbman->add_field($table, $field); |
|
|
|
} |
|
|
|
|
|
|
|
$field = new xmldb_field('cols', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, null, null, '0', 'id'); |
|
|
|
if ($dbman->field_exists($table, $field)) { |
|
|
|
$sql = "UPDATE {$CFG->prefix}game_snakes_database SET usedcols=cols"; |
|
|
|
$DB->execute( $sql); |
|
|
|
$dbman->drop_field($table, $field); |
|
|
|
} else { |
|
|
|
$dbman->add_field($table, $field); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|