diff --git a/database/migrations/2026_03_12_140000_create_pmis_job_types_table.php b/database/migrations/2026_03_12_140000_create_pmis_job_types_table.php new file mode 100644 index 0000000..7fcaecd --- /dev/null +++ b/database/migrations/2026_03_12_140000_create_pmis_job_types_table.php @@ -0,0 +1,30 @@ +id(); + $table->unsignedBigInteger('tenant_id'); + $table->string('name', 100); + $table->integer('sort_order')->default(0); + $table->boolean('is_active')->default(true); + $table->json('options')->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->index('tenant_id'); + $table->index(['tenant_id', 'name']); + }); + } + + public function down(): void + { + Schema::dropIfExists('pmis_job_types'); + } +}; diff --git a/database/migrations/2026_03_12_140001_create_pmis_construction_workers_table.php b/database/migrations/2026_03_12_140001_create_pmis_construction_workers_table.php new file mode 100644 index 0000000..d2c021e --- /dev/null +++ b/database/migrations/2026_03_12_140001_create_pmis_construction_workers_table.php @@ -0,0 +1,39 @@ +id(); + $table->unsignedBigInteger('tenant_id'); + $table->string('company_name', 200); + $table->string('trade_name', 100); + $table->unsignedBigInteger('job_type_id')->nullable(); + $table->string('name', 50); + $table->string('phone', 20)->nullable(); + $table->string('birth_date', 6)->nullable()->comment('YYMMDD'); + $table->char('ssn_gender', 1)->nullable()->comment('주민번호 뒷자리 첫째'); + $table->unsignedInteger('wage')->default(0); + $table->string('blood_type', 5)->nullable(); + $table->text('remark')->nullable(); + $table->json('options')->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->index('tenant_id'); + $table->index(['tenant_id', 'company_name']); + $table->index(['tenant_id', 'name']); + $table->foreign('job_type_id')->references('id')->on('pmis_job_types')->nullOnDelete(); + }); + } + + public function down(): void + { + Schema::dropIfExists('pmis_construction_workers'); + } +};