bega updates

This commit is contained in:
Mekan1206
2026-07-21 21:30:27 +05:00
parent 6093a45761
commit db94922e9a
22 changed files with 1033 additions and 26 deletions

View File

@@ -0,0 +1,31 @@
<?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('stories', function (Blueprint $table) {
$table->id();
$table->jsonb('title')->index();
$table->timestamp('expires_at')->index();
$table->integer('sort_order')->nullable();
$table->boolean('is_visible')->default(true)->index();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('stories');
}
};

View File

@@ -0,0 +1,41 @@
<?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('flash_sales', function (Blueprint $table) {
$table->id();
$table->jsonb('title')->index();
$table->timestamp('starts_at')->index();
$table->timestamp('ends_at')->index();
$table->boolean('is_visible')->default(true)->index();
$table->timestamps();
});
Schema::create('flash_sale_product', function (Blueprint $table) {
$table->id();
$table->foreignId('flash_sale_id')->constrained()->cascadeOnDelete();
$table->foreignId('product_id')->constrained()->cascadeOnDelete();
$table->timestamps();
$table->unique(['flash_sale_id', 'product_id']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('flash_sale_product');
Schema::dropIfExists('flash_sales');
}
};