card pin order

This commit is contained in:
2024-03-07 17:30:04 +05:00
parent 20db738536
commit fbd5d94b2f
8 changed files with 478 additions and 14 deletions

View File

@@ -0,0 +1,59 @@
<?php
use App\Repos\Order\OrderRepo;
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('card_pins', function (Blueprint $table) {
$table->id();
$table->string('unique_id')->nullable()->unique();
$table->foreignId('card_type_id')->constrained()->restrictOnDelete();
$table->string('card_number');
$table->string('region', 2)->index();
$table->foreignId('branch_id')->constrained('branches')->restrictOnDelete();
$table->string('customer_name')->index();
$table->string('customer_surname')->index();
$table->string('customer_patronic_name')->nullable();
$table->date('born_at')->nullable();
$table->string('phone')->nullable()->index();
$table->string('passport_serie')->index();
$table->string('passport_id')->index();
$table->string('status')->nullable()->default(OrderRepo::defaultStatus())->index();
$table->text('passport_one')->nullable();
$table->text('passport_two')->nullable();
$table->text('passport_three')->nullable();
$table->text('passport_four')->nullable();
$table->text('notes')->nullable();
$table->foreignId('user_id')->constrained('users')->restrictOnDelete();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('card_pins');
}
};