public static function diff_indexes_table($ofs, $old_schema, $old_table, $new_schema, $new_table) { // Drop indexes that do not exist in new schema or are modified foreach (self::get_drop_indexes($old_schema, $old_table, $new_schema, $new_table) as $index) { $ofs->write(pgsql8_index::get_drop_sql($new_schema, $new_table, $index)); } // Add new indexes if ($old_schema == null) { foreach (format_index::get_table_indexes($new_schema, $new_table) as $index) { $ofs->write(pgsql8_index::get_creation_sql($new_schema, $new_table, $index) . "\n"); } } else { foreach (self::get_new_indexes($old_schema, $old_table, $new_schema, $new_table) as $index) { $ofs->write(pgsql8_index::get_creation_sql($new_schema, $new_table, $index) . "\n"); } } }