Browse Source

Fixed a bug in custom tables where if skip creation was selected it still tried to create the foreign key constraints

spficklin 12 years ago
parent
commit
92ad0ca514
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tripal_core/includes/custom_tables.php

+ 1 - 1
tripal_core/includes/custom_tables.php

@@ -155,7 +155,7 @@ function tripal_core_create_custom_table(&$ret, $table, $schema, $skip_creation
   }
   
   // now add any foreign key constraints
-  if(array_key_exists('foreign keys', $schema)){
+  if(!$skip_creation and array_key_exists('foreign keys', $schema)){
   	$fkeys = $schema['foreign keys'];
   	foreach ($fkeys as $fktable => $fkdetails) {
   		$relations = $fkdetails['columns'];