Merge branch 'new'
# Conflicts: # app/Http/Controllers/PrintStatementController.php # app/Jobs/GenerateBiayaKartuCsvJob.php # app/Jobs/SendStatementEmailJob.php # app/Mail/StatementEmail.php # resources/views/statements/email.blade.php # resources/views/statements/index.blade.php
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Menjalankan migration untuk menambahkan field product_code pada tabel atmcards
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Log::info('Memulai migration: menambahkan field product_code ke tabel atmcards');
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
try {
|
||||
Schema::table('atmcards', function (Blueprint $table) {
|
||||
// Menambahkan field product_code setelah field ctdesc
|
||||
$table->string('product_code')->nullable()->after('ctdesc')->comment('Kode produk kartu ATM');
|
||||
});
|
||||
|
||||
DB::commit();
|
||||
Log::info('Migration berhasil: field product_code telah ditambahkan ke tabel atmcards');
|
||||
|
||||
} catch (Exception $e) {
|
||||
DB::rollback();
|
||||
Log::error('Migration gagal: ' . $e->getMessage());
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Membalikkan migration dengan menghapus field product_code dari tabel atmcards
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Log::info('Memulai rollback migration: menghapus field product_code dari tabel atmcards');
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
try {
|
||||
Schema::table('atmcards', function (Blueprint $table) {
|
||||
$table->dropColumn('product_code');
|
||||
});
|
||||
|
||||
DB::commit();
|
||||
Log::info('Rollback migration berhasil: field product_code telah dihapus dari tabel atmcards');
|
||||
|
||||
} catch (Exception $e) {
|
||||
DB::rollback();
|
||||
Log::error('Rollback migration gagal: ' . $e->getMessage());
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user