@@ 53-57 (lines=5) @@ | ||
50 | $this->foreign('deleted_by', 'fk_' . $tableName . 'has_deleted_by')->references('id')->on($userModel)->onUpdate('NO ACTION')->onDelete('NO ACTION'); |
|
51 | }); |
|
52 | ||
53 | Blueprint::macro('creatorForeign', function ($name = 'created_by') use ($userModel) { |
|
54 | $tableName = $this->getTable(); |
|
55 | ||
56 | $this->foreign($name, 'fk_' . $tableName . 'has_' . $name)->references('id')->on($userModel)->onUpdate('NO ACTION')->onDelete('NO ACTION'); |
|
57 | }); |
|
58 | ||
59 | Blueprint::macro('editorForeign', function ($name = 'updated_by') use ($userModel) { |
|
60 | $tableName = $this->getTable(); |
|
@@ 59-63 (lines=5) @@ | ||
56 | $this->foreign($name, 'fk_' . $tableName . 'has_' . $name)->references('id')->on($userModel)->onUpdate('NO ACTION')->onDelete('NO ACTION'); |
|
57 | }); |
|
58 | ||
59 | Blueprint::macro('editorForeign', function ($name = 'updated_by') use ($userModel) { |
|
60 | $tableName = $this->getTable(); |
|
61 | ||
62 | $this->foreign($name, 'fk_' . $tableName . 'has_' . $name)->references('id')->on($userModel)->onUpdate('NO ACTION')->onDelete('NO ACTION'); |
|
63 | }); |
|
64 | ||
65 | Blueprint::macro('destroyerForeign', function ($name = 'deleted_by') use ($userModel) { |
|
66 | $tableName = $this->getTable(); |
|
@@ 65-69 (lines=5) @@ | ||
62 | $this->foreign($name, 'fk_' . $tableName . 'has_' . $name)->references('id')->on($userModel)->onUpdate('NO ACTION')->onDelete('NO ACTION'); |
|
63 | }); |
|
64 | ||
65 | Blueprint::macro('destroyerForeign', function ($name = 'deleted_by') use ($userModel) { |
|
66 | $tableName = $this->getTable(); |
|
67 | ||
68 | $this->foreign($name, 'fk_' . $tableName . 'has_' . $name)->references('id')->on($userModel)->onUpdate('NO ACTION')->onDelete('NO ACTION'); |
|
69 | }); |
|
70 | ||
71 | Blueprint::macro('dropCedForeign', function () use ($userModel) { |
|
72 | $tableName = $this->getTable(); |