File: /var/www/vaspayment.com/database/migrations/2024_02_11_232239_create_shops_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('shops', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('slug');
$table->text('description');
$table->string('short_description');
$table->string('specification');
$table->string('features');
$table->decimal('regular_price', 10, 2)->nullable();
$table->decimal('sales_price', 10, 2)->nullable();
$table->unsignedBigInteger('category_id');
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
$table->string('quantity');
$table->json('images');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('shops');
}
};