|
@@ -32,7 +32,22 @@ abstract class Grammar extends \Laravel\Database\Grammar {
|
|
|
|
|
|
$sql = "ALTER TABLE $table ADD CONSTRAINT $name ";
|
|
|
|
|
|
- return $sql .= "FOREIGN KEY ($foreign) REFERENCES $on ($referenced)";
|
|
|
+ $sql .= "FOREIGN KEY ($foreign) REFERENCES $on ($referenced)";
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if ( ! is_null($command->on_delete))
|
|
|
+ {
|
|
|
+ $sql .= " ON DELETE {$command->on_delete}";
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( ! is_null($command->on_update))
|
|
|
+ {
|
|
|
+ $sql .= " ON UPDATE {$command->on_update}";
|
|
|
+ }
|
|
|
+
|
|
|
+ return $sql;
|
|
|
}
|
|
|
|
|
|
|