feat: complete GSB construction ERP implementation with dual-mode MR, capitalization cap engine, single PM rule, and system sign-off documentation

This commit is contained in:
GSB Construction Engineering
2026-08-25 17:08:03 +08:00
parent 778f27e0a5
commit d4e2b468ff
114 changed files with 3923 additions and 10031 deletions

View File

@@ -0,0 +1,48 @@
<?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('project_classifications')) {
Schema::create('project_classifications', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('code')->nullable();
$table->text('description')->nullable();
$table->timestamps();
});
}
if (!Schema::hasTable('project_classification_pivot')) {
Schema::create('project_classification_pivot', function (Blueprint $table) {
$table->id();
$table->foreignId('project_id')->constrained('projects')->cascadeOnDelete();
$table->foreignId('project_classification_id')->constrained('project_classifications')->cascadeOnDelete();
$table->timestamps();
});
}
Schema::table('projects', function (Blueprint $table) {
if (!Schema::hasColumn('projects', 'classifications')) {
$table->json('classifications')->nullable()->after('project_type');
}
});
}
public function down(): void
{
Schema::table('projects', function (Blueprint $table) {
if (Schema::hasColumn('projects', 'classifications')) {
$table->dropColumn('classifications');
}
});
Schema::dropIfExists('project_classification_pivot');
Schema::dropIfExists('project_classifications');
}
};