feat(webstatement): tambahkan kolom baru sektor, tipe pelanggan, dan tanggal lahir/pendirian pada model Customer
- Memperbarui model `Customer` dengan menambahkan properti baru pada `$fillable`: - `sector` - `customer_type` - `birth_incorp_date` - Menambahkan migrasi baru `add_sector_customer_type_birth_incorp_date_to_customers_table`: - Menambahkan kolom `sector`, `customer_type`, dan `birth_incorp_date` pada tabel `customers`. - Semua kolom bersifat nullable untuk menjaga kompatibilitas data lama. - Menyediakan fungsi rollback dengan menghapus kolom yang ditambahkan. - Tujuan perubahan ini: - Mendukung penyimpanan data sektor, tipe pelanggan, dan tanggal lahir/pendirian pada entitas pelanggan. - Memfasilitasi validasi data tambahan dalam proses bisnis dan laporan. Signed-off-by: Daeng Deni Mardaeni <ddeni05@gmail.com>
This commit is contained in:
@@ -21,7 +21,10 @@ class Customer extends Model
|
|||||||
'postal_code',
|
'postal_code',
|
||||||
'branch_code',
|
'branch_code',
|
||||||
'date_of_birth',
|
'date_of_birth',
|
||||||
'email'
|
'email',
|
||||||
|
'sector',
|
||||||
|
'customer_type',
|
||||||
|
'birth_incorp_date'
|
||||||
];
|
];
|
||||||
|
|
||||||
public function accounts(){
|
public function accounts(){
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
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::table('customers', function (Blueprint $table) {
|
||||||
|
$table->string('sector')->nullable()->after('branch_code');
|
||||||
|
$table->string('customer_type')->nullable()->after('sector');
|
||||||
|
$table->string('birth_incorp_date')->nullable()->after('date_of_birth');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('customers', function (Blueprint $table) {
|
||||||
|
$table->dropColumn(['sector', 'customer_type', 'birth_incorp_date']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user