/** * Returns list of indexes that should be added. * * @param old_table original table * @param new_table new table * * @return list of indexes that should be added */ public static function get_new_indexes($old_schema, $old_table, $new_schema, $new_table) { $list = array(); if ($new_table != null) { if ($old_table == null) { foreach (format_index::get_table_indexes($new_schema, $new_table) as $index) { $list[] = $index; } } else { foreach (format_index::get_table_indexes($new_schema, $new_table) as $index) { $old_index = dbx::get_table_index($old_schema, $old_table, $index['name']); if (!pgsql8_table::contains_index($old_schema, $old_table, $index['name'])) { $list[] = $index; } else { if (!pgsql8_index::equals($old_index, $index)) { $list[] = $index; } } } } } return $list; }