migration for penyata anggota
This commit is contained in:
+1
-1
@@ -10,5 +10,5 @@ class Voter extends Authenticatable
|
|||||||
use HasApiTokens;
|
use HasApiTokens;
|
||||||
|
|
||||||
protected $table = 'voter';
|
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'
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user