Add create migrations for giftcards and giftcard_codes so new installs get both tables.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,53 @@
|
|||||||
|
<?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
|
||||||
|
{
|
||||||
|
if (! Schema::hasTable('giftcards')) {
|
||||||
|
Schema::create('giftcards', function (Blueprint $table) {
|
||||||
|
$table->increments('id');
|
||||||
|
$table->integer('customer_id')->nullable();
|
||||||
|
$table->unsignedTinyInteger('use_once')->default(0);
|
||||||
|
$table->integer('count')->nullable();
|
||||||
|
$table->float('amount')->nullable();
|
||||||
|
$table->bigInteger('total')->nullable();
|
||||||
|
$table->integer('unit')->nullable();
|
||||||
|
$table->string('unique_code')->nullable();
|
||||||
|
$table->timestamp('created_at')->nullable();
|
||||||
|
$table->unsignedTinyInteger('sts')->nullable();
|
||||||
|
$table->timestamp('expiry_date')->nullable();
|
||||||
|
$table->integer('used_count')->nullable();
|
||||||
|
$table->timestamp('updated_at')->nullable();
|
||||||
|
$table->text('description')->nullable();
|
||||||
|
$table->string('name')->nullable();
|
||||||
|
$table->string('mobile')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! Schema::hasTable('giftcard_codes')) {
|
||||||
|
Schema::create('giftcard_codes', function (Blueprint $table) {
|
||||||
|
$table->increments('id');
|
||||||
|
$table->integer('giftcard_id')->nullable();
|
||||||
|
$table->unsignedTinyInteger('use_once')->default(0);
|
||||||
|
$table->string('code')->nullable();
|
||||||
|
$table->unsignedTinyInteger('sts')->nullable();
|
||||||
|
$table->unsignedTinyInteger('unit')->nullable();
|
||||||
|
$table->float('amount')->nullable();
|
||||||
|
$table->text('assigned_to')->nullable();
|
||||||
|
$table->timestamp('used_at')->nullable();
|
||||||
|
$table->timestamp('expiry_date')->nullable();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
// جدول ممکن است از قبل روی نصبهای قدیمی بوده باشد؛ drop نمیکنیم.
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user