Ejemplo n.º 1
0
 /**
  * Sanity check table renaming pointers if they have been specified
  * 
  * @param object $old_schema
  * @param object $old_table
  * @param object $new_schema
  * @param object $new_table
  * @throws exception
  */
 public static function renamed_table_check_pointer(&$old_schema, &$old_table, $new_schema, $new_table)
 {
     if (!dbsteward::$ignore_oldnames) {
         if ($new_schema && $new_table && sql99_diff_tables::is_renamed_table($new_schema, $new_table)) {
             if (isset($new_table['oldSchemaName'])) {
                 if (!($old_schema = sql99_table::get_old_table_schema($new_schema, $new_table))) {
                     throw new exception("Sanity failure: " . $new_table['name'] . " has oldSchemaName attribute, but old_schema not found");
                 }
             } else {
                 if (!$old_schema) {
                     throw new exception("Sanity failure: " . $new_table['name'] . " has oldTableName attribute, but passed old_schema is not defined");
                 }
             }
             $old_table = sql99_table::get_old_table($new_schema, $new_table);
             if (!$old_table) {
                 throw new exception("Sanity failure: " . $new_table['name'] . " has oldTableName attribute, but table point not found");
             }
         }
     }
 }