Skip to content

Commit

Permalink
add missing migration
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Apr 16, 2024
1 parent e97f1f2 commit 96e5a98
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class() extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('bazar_categories', static function (Blueprint $table): void {
$table->after('id', static function (Blueprint $table): void {
$table->foreignId('parent_id')->nullable()->constrained('bazar_categories')->nullOnDelete();
});
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('bazar_categories', static function (Blueprint $table): void {
$table->dropColumn('parent_id');
});
}
};

0 comments on commit 96e5a98

Please sign in to comment.