migration for penyata anggota

This commit is contained in:
nurafrinaalimi16
2026-02-24 15:30:32 +08:00
parent 0d3b602c31
commit 70266735fe
3 changed files with 84 additions and 1 deletions
+1 -1
View File
@@ -10,5 +10,5 @@ class Voter extends Authenticatable
use HasApiTokens;
protected $table = 'voter';
protected $fillable = ['name', 'no_kp', 'no_anggota','unit', 'election_id', 'alamat', 'telefon', 'saham', 'yuran', 'kehadiran'];
protected $fillable = ['name', 'no_kp', 'no_anggota','unit', 'election_id', 'alamat', 'telefon', 'saham', 'yuran', 'kehadiran','status_penyata','persetujuan','tarikh_sah','cadangan','pelaburan','tergempar','barangan','peribadi','berjamin_yuran','roadtax','pelbagai'];
}
@@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddPenyataColumnsToVoterTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('voter', function (Blueprint $table) {
$table->enum('persetujuan', ['Bersetuju', 'Tidak Bersetuju'])->nullable()->after('kehadiran');
$table->enum('status_penyata', ['DRAF', 'DISAHKAN', 'PERLU_SEMAK'])->default('DRAF')->after('persetujuan');
$table->dateTime('tarikh_sah')->nullable()->after('status_penyata');
$table->json('cadangan')->nullable()->after('tarikh_sah');
});
}
public function down()
{
Schema::table('voter', function (Blueprint $table) {
$table->dropColumn([
'persetujuan',
'status_penyata',
'tarikh_sah',
'cadangan'
]);
});
}
}
@@ -0,0 +1,48 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddPelaburanToVoterTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('voter', function (Blueprint $table) {
$table->decimal('pelaburan', 12, 2)->default(0)->after('yuran');
$table->decimal('tergempar', 12, 2)->default(0)->after('pelaburan');
$table->decimal('barangan', 12, 2)->default(0)->after('tergempar');
$table->decimal('peribadi', 12, 2)->default(0)->after('barangan');
$table->decimal('berjamin_yuran', 12, 2)->default(0)->after('peribadi');
$table->decimal('roadtax', 12, 2)->default(0)->after('berjamin_yuran');
$table->decimal('pelbagai', 12, 2)->default(0)->after('roadtax');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('voter', function (Blueprint $table) {
//
$table->dropColumn([
'pelaburan',
'tergempar',
'barangan',
'peribadi',
'berjamin_yuran',
'roadtax',
'pelbagai'
]);
});
}
}