Files
BarangaySystem/database/migrations/2026_03_26_000001_create_couriers_table.php
2026-06-06 18:43:00 +08:00

38 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
use Hyperf\Database\Schema\Blueprint;
use Hypervel\Database\Migrations\Migration;
use Hypervel\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('couriers', function (Blueprint $table) {
$table->id();
$table->string('hashkey', 300)->unique();
$table->string('name');
$table->string('contact_number')->nullable();
$table->string('type', 50)->default('INTERNAL'); // INTERNAL, EXTERNAL
$table->boolean('is_active')->default(true);
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->foreign('created_by')->references('id')->on('users')->onDelete('set null');
$table->foreign('updated_by')->references('id')->on('users')->onDelete('set null');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('couriers');
}
};