This commit is contained in:
Mekan1206
2026-04-29 22:26:04 +05:00
parent 9b95087b94
commit dd633ef7da
19 changed files with 314 additions and 35 deletions

View File

@@ -0,0 +1,32 @@
<?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::create('order_shipping_methods', function (Blueprint $table) {
$table->id();
$table->json('name');
$table->string('slug')->unique();
$table->json('description')->nullable();
$table->string('price')->default(0);
$table->boolean('is_active')->default(true);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('order_shipping_methods');
}
};

View File

@@ -0,0 +1,29 @@
<?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('orders', function (Blueprint $table) {
$table->foreignId('shipping_method_id')->nullable()->constrained('order_shipping_methods')->nullOnDelete();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('orders', function (Blueprint $table) {
$table->dropForeign(['shipping_method_id']);
$table->dropColumn('shipping_method_id');
});
}
};