Commit 39a358c2 by wenbin1989 Committed by Qiang Xue

oracle db doesn't support `ON UPDATE` in FOREIGN KEY. remove `ON UPDATE` section…

oracle db doesn't support `ON UPDATE` in FOREIGN KEY. remove `ON UPDATE` section in method `addForeignKey`.
parent b733a189
...@@ -138,4 +138,21 @@ EOD; ...@@ -138,4 +138,21 @@ EOD;
return "DROP SEQUENCE \"{$tableSchema->name}_SEQ\";" return "DROP SEQUENCE \"{$tableSchema->name}_SEQ\";"
. "CREATE SEQUENCE \"{$tableSchema->name}_SEQ\" START WITH {$value} INCREMENT BY 1 NOMAXVALUE NOCACHE"; . "CREATE SEQUENCE \"{$tableSchema->name}_SEQ\" START WITH {$value} INCREMENT BY 1 NOMAXVALUE NOCACHE";
} }
/**
* @inheritdoc
*/
public function addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete = null, $update = null)
{
$sql = 'ALTER TABLE ' . $this->db->quoteTableName($table)
. ' ADD CONSTRAINT ' . $this->db->quoteColumnName($name)
. ' FOREIGN KEY (' . $this->buildColumns($columns) . ')'
. ' REFERENCES ' . $this->db->quoteTableName($refTable)
. ' (' . $this->buildColumns($refColumns) . ')';
if ($delete !== null) {
$sql .= ' ON DELETE ' . $delete;
}
return $sql;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment