| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
function object_driver_install() {
|
| 5 |
return;
|
| 6 |
}
|
| 7 |
|
| 8 |
/**
|
| 9 |
* Fix mis-named rows in {sequences}.
|
| 10 |
*/
|
| 11 |
|
| 12 |
function object_driver_update_5000() {
|
| 13 |
$ret = array();
|
| 14 |
|
| 15 |
switch ($GLOBALS['db_type']) {
|
| 16 |
case 'mysql':
|
| 17 |
case 'mysqli':
|
| 18 |
$class_list = object_driver_class_list();
|
| 19 |
foreach ($class_list as $class) {
|
| 20 |
$id_name = $class .'_id';
|
| 21 |
$obj_def = call_user_func($class .'_class_define');
|
| 22 |
$table = isset($obj_def['table']) ? $obj_def['table'] : $class;
|
| 23 |
|
| 24 |
$max = db_result(db_query("SELECT MAX(". $id_name .") FROM {". $table ."}"));
|
| 25 |
db_next_id("{". $table ."}_id");
|
| 26 |
$name = db_prefix_tables("{". $table ."}_id");
|
| 27 |
|
| 28 |
$ret[] = update_sql("REPLACE INTO {sequences} VALUES ('". $name ."', ". $max .")");
|
| 29 |
}
|
| 30 |
}
|
| 31 |
|
| 32 |
return $ret;
|
| 33 |
}
|