/[drupal]/contributions/modules/dbscripts/dbscripts.module
ViewVC logotype

Diff of /contributions/modules/dbscripts/dbscripts.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.5.4.74, Sat May 30 17:06:18 2009 UTC revision 1.5.4.75, Sat May 30 17:06:22 2009 UTC
# Line 110  function dbscripts_dump($branch = 'devel Line 110  function dbscripts_dump($branch = 'devel
110      return "\nImproper database connection settings.\n\n";      return "\nImproper database connection settings.\n\n";
111    }    }
112    
113      // Define paths
114    $dump_location = "$dump_path/$branch";    $dump_location = "$dump_path/$branch";
115    $lastmerge_location = "$dump_path/$lastmerge_branch";    $lastmerge_location = "$dump_path/$lastmerge_branch";
116    $temp_branch = "tmp";    $temp_branch = "tmp";
# Line 354  function dbscripts_dump($branch = 'devel Line 355  function dbscripts_dump($branch = 'devel
355        exec("echo \"$line\" >> $rewritten_version");        exec("echo \"$line\" >> $rewritten_version");
356      }      }
357    
358      // Convert the file to SQL      // Convert the file back to SQL
359    
360        // Get an array of the last-merge sql file
361      $sql = file("$lastmerge_version", FILE_IGNORE_NEW_LINES);      $sql = file("$lastmerge_version", FILE_IGNORE_NEW_LINES);
362    
363      // Get the top sql comments      // Get the top sql comments
# Line 1410  function dbscripts_get_table_references( Line 1413  function dbscripts_get_table_references(
1413    
1414    
1415  /**  /**
1416   * Raise the increments of the given table within the given branch   * Raise the increments, and its foreign keys, of the given table within the
1417     * given branch
1418   *   *
1419   * @param $table   * @param $table
1420   *   Table to raise the increments of   *   Table to raise the increments of
# Line 1599  function dbscripts_raise_table_increment Line 1603  function dbscripts_raise_table_increment
1603    exec("sed 's/ AUTO_INCREMENT={$current_inc['num']} / AUTO_INCREMENT={$increment_change} /g' $branch_location/tables/$table.sql > $temp_location/$table.sql");    exec("sed 's/ AUTO_INCREMENT={$current_inc['num']} / AUTO_INCREMENT={$increment_change} /g' $branch_location/tables/$table.sql > $temp_location/$table.sql");
1604    exec("mv $temp_location/$table.sql $branch_location/tables/$table.sql");    exec("mv $temp_location/$table.sql $branch_location/tables/$table.sql");
1605    
1606    // For all references, raise the increment    // Raise the increment for all foreign keys of the given table
1607    foreach ($table_references['references'] as $table_to_modify => $columns_referenced) {    foreach ($table_references['references'] as $table_to_modify => $columns_referenced) {
1608    
1609      // Check if this table exists and has any data stored      // Check if this table exists and has any data stored

Legend:
Removed from v.1.5.4.74  
changed lines
  Added in v.1.5.4.75

  ViewVC Help
Powered by ViewVC 1.1.2