Add branch & province model

This commit is contained in:
2023-11-23 15:34:04 +05:00
parent 0309e8f7d8
commit fe68420bab
11 changed files with 490 additions and 5 deletions

View File

@@ -0,0 +1,30 @@
<?php
use App\Repos\System\Settings\Location\RegionRepo;
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('provinces', function (Blueprint $table) {
$table->id();
$table->string('region', 2)->index();
$table->jsonb('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('provinces');
}
};

View File

@@ -0,0 +1,37 @@
<?php
use App\Repos\System\Settings\Location\RegionRepo;
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('branches', function (Blueprint $table) {
$table->id();
$table->jsonb('name');
$table->jsonb('address')->nullable();
$table->string('unique_code')->index()->nullable();
$table->string('region', 2)->index();
$table->foreignId('province_id')->constrained()->nullOnDelete();
$table->string('billing_username')->nullable();
$table->string('billing_password')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('branches');
}
};