Skip to content

Commit 5084bb0

Browse files
committed
removes onDeleteSetNull
1 parent f5ca3ad commit 5084bb0

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

config/files.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
'storageLimit' => 500000,
1818
'paginate' => (int) env('FILES_PAGINATION', 50),
1919
'testingFolder' => 'testing',
20-
'onDeleteSetNull' => ['avatars', 'webshop_brands'],
2120
'renameFolders' => [
2221
'dataImport' => 'import',
2322
'dataExport' => 'export',

src/Upgrades/DropMorphModels.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,11 @@ private function addForeignKey(string $model): self
4646
{
4747
$table = $this->table($model);
4848
$after = $this->afterColumn($table);
49-
$onDelete = in_array($table, Config::get('enso.files.onDeleteSetNull'))
50-
? 'SET NULL'
51-
: 'restrict';
5249

53-
Schema::table($table, function (Blueprint $table) use ($after, $onDelete) {
50+
Schema::table($table, function (Blueprint $table) use ($after) {
5451
$table->unsignedBigInteger('file_id')->nullable()->after($after);
5552
$table->foreign('file_id')->references('id')->on('files')
56-
->onUpdate('restrict')->onDelete($onDelete);
53+
->onUpdate('restrict')->onDelete('restrict');
5754
});
5855

5956
return $this;

0 commit comments

Comments
 (0)