feat: mandatory IC scan upload on customer register and customer_info
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddScanIcToCustomerTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Master DB (mysql7) — stores arrahn_files.id for the scanned IC document.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (
|
||||
Schema::connection('mysql7')->hasTable('customer')
|
||||
&& !Schema::connection('mysql7')->hasColumn('customer', 'scan_ic')
|
||||
) {
|
||||
Schema::connection('mysql7')->table('customer', function (Blueprint $table) {
|
||||
if (Schema::connection('mysql7')->hasColumn('customer', 'gambar_mykad')) {
|
||||
$table->unsignedBigInteger('scan_ic')->nullable()->after('gambar_mykad');
|
||||
} else {
|
||||
$table->unsignedBigInteger('scan_ic')->nullable();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
if (
|
||||
Schema::connection('mysql7')->hasTable('customer')
|
||||
&& Schema::connection('mysql7')->hasColumn('customer', 'scan_ic')
|
||||
) {
|
||||
Schema::connection('mysql7')->table('customer', function (Blueprint $table) {
|
||||
$table->dropColumn('scan_ic');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user