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

39 lines
1.0 KiB
PHP

<?php
use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;
class CreateGroupsTable extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('groups', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('hashkey', 300)->unique();
$table->string('name');
$table->string('type'); // e.g., COOPERATIVE, ASSOCIATION, NGO
$table->text('description')->nullable();
$table->boolean('is_active')->default(true);
$table->bigInteger('created_by')->nullable();
$table->bigInteger('updated_by')->nullable();
$table->timestamps();
$table->index('created_by');
$table->index('updated_by');
$table->index('type');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('groups');
}
}