231 lines
9.6 KiB
PHP
231 lines
9.6 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateLelongsTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('taklaku', function (Blueprint $table) {
|
|
$table->bigIncrements('id');
|
|
$table->unsignedBigInteger('lelong_id')->unsigned();
|
|
$table->string('caw_id');
|
|
$table->string('kodcaw');
|
|
$table->string('norujukan');
|
|
$table->date('t_lelong');
|
|
$table->integer('status');
|
|
$table->integer('fasa')->default(0);
|
|
$table->timestamps();
|
|
|
|
// $table->foreign('caw_id')
|
|
// ->references('id')->on('cawangan')
|
|
// ->onDelete('cascade');
|
|
|
|
// $table->foreign('lelong_id')
|
|
// ->references('id')->on('lelong')
|
|
// ->onDelete('cascade');
|
|
});
|
|
|
|
Schema::create('lelong', function (Blueprint $table) {
|
|
$table->bigIncrements('id');
|
|
$table->date('tarikh_lelong');
|
|
$table->time('masamula_lelong')->nullable();
|
|
$table->time('masatamat_lelong')->nullable();
|
|
$table->dateTime('masakemaskini_data')->nullable();
|
|
$table->string('kali')->nullable();
|
|
$table->string('harga_emas_asas');
|
|
$table->string('jbg');
|
|
$table->integer('cajlelong');
|
|
$table->integer('sts_lelong')->default(0); //1= start, 2 = jana pemenang, 3 = senarai pemenang
|
|
$table->integer('fasa')->default(0);
|
|
$table->timestamps();
|
|
|
|
});
|
|
|
|
Schema::create('cawangan_lelong', function (Blueprint $table) {
|
|
$table->bigIncrements('id');
|
|
$table->integer('batchlel')->nullable();
|
|
$table->unsignedBigInteger('lelong_id')->unsigned();
|
|
$table->unsignedBigInteger('caw_id')->unsigned();
|
|
$table->integer('status_online')->default(0)->nullable();
|
|
$table->time('masamula_lelong')->nullable();
|
|
$table->time('masatamat_lelong')->nullable();
|
|
$table->string('online');
|
|
$table->string('export_data_sts')->nullable();
|
|
$table->string('import_data_sts')->nullable();
|
|
$table->date('export_data_stsdate')->nullable();
|
|
$table->date('import_data_sts_date')->nullable();
|
|
$table->string('lokasi')->nullable();
|
|
$table->integer('fasa')->default(0);
|
|
$table->integer('kali')->nullable();
|
|
$table->integer('bilblast')->nullable();
|
|
$table->integer('status')->nullable();
|
|
$table->timestamps();
|
|
|
|
$table->foreign('caw_id')
|
|
->references('id')->on('cawangan')
|
|
->onDelete('cascade');
|
|
|
|
$table->foreign('lelong_id')
|
|
->references('id')->on('lelong')
|
|
->onDelete('cascade');
|
|
});
|
|
|
|
Schema::create('lelongbid', function (Blueprint $table) {
|
|
$table->bigIncrements('id');
|
|
$table->unsignedBigInteger('lelong_id')->unsigned();
|
|
$table->unsignedBigInteger('caw_id')->unsigned();
|
|
$table->string('kodcaw');
|
|
$table->string('norujukan');
|
|
$table->date('t_lelong');
|
|
$table->decimal('hargaasas', $precision = 9, $scale = 2);
|
|
$table->decimal('hargajual', $precision = 9, $scale = 2);
|
|
$table->date('t_jual')->nullable();
|
|
$table->integer('nopembeli')->nullable();
|
|
$table->decimal('jbg', $precision = 7, $scale = 2);
|
|
$table->decimal('kadarupah', $precision = 5, $scale = 2);
|
|
$table->decimal('upahsimpan', $precision = 11, $scale = 2)->nullable();
|
|
$table->decimal('ansuran', $precision = 11, $scale = 2)->nullable();
|
|
$table->decimal('nilaimarhun', $precision = 9, $scale = 2);
|
|
$table->decimal('nmarhuns', $precision = 9, $scale = 2)->nullable();
|
|
$table->decimal('pinjaman', $precision = 9, $scale = 2);
|
|
$table->decimal('bakiupah', $precision = 7, $scale = 2);
|
|
$table->decimal('cajlain', $precision = 7, $scale = 2)->nullable();
|
|
$table->decimal('cajlelong', $precision = 7, $scale = 2);
|
|
$table->decimal('baki', $precision = 9, $scale = 2);
|
|
$table->decimal('berat', $precision = 7, $scale = 2);
|
|
$table->string('marhun');
|
|
$table->decimal('percent', $precision = 7, $scale = 2);
|
|
$table->string('status_jual');
|
|
$table->string('status_payment');
|
|
$table->integer('status_semak')->default(0);
|
|
$table->datetime('diserahkan_pada')->nullable();
|
|
$table->string('mora_upah');
|
|
$table->integer('fasa')->default(0);
|
|
$table->integer('opencash')->default(0);
|
|
$table->timestamps();
|
|
|
|
$table->foreign('caw_id')
|
|
->references('id')->on('cawangan')
|
|
->onDelete('cascade');
|
|
|
|
$table->foreign('lelong_id')
|
|
->references('id')->on('lelong')
|
|
->onDelete('cascade');
|
|
});
|
|
|
|
Schema::create('lelongbidmarhun', function (Blueprint $table) {
|
|
$table->bigIncrements('id');
|
|
$table->unsignedBigInteger('lelongbid_id')->unsigned();
|
|
$table->decimal('bil', $precision = 3, $scale = 0);
|
|
$table->string('old_marhun');
|
|
$table->string('marhun');
|
|
$table->string('nota')->nullable();
|
|
$table->string('old_karat');
|
|
$table->string('karat');
|
|
$table->decimal('old_berat', $precision = 7, $scale = 2);
|
|
$table->decimal('berat', $precision = 7, $scale = 2);
|
|
$table->decimal('old_harga', $precision = 5, $scale = 2);
|
|
$table->decimal('harga', $precision = 5, $scale = 2);
|
|
$table->decimal('old_nmarhun', $precision = 9, $scale = 2);
|
|
$table->decimal('n_marhun', $precision = 9, $scale = 2);
|
|
$table->decimal('old_hargaasas', $precision = 11, $scale = 2);
|
|
$table->decimal('hargaasas', $precision = 11, $scale = 2);
|
|
$table->integer('status_semak')->default(0)->nullable();
|
|
$table->timestamps();
|
|
|
|
$table->foreign('lelongbid_id')
|
|
->references('id')->on('lelongbid')
|
|
->onDelete('cascade');
|
|
});
|
|
|
|
Schema::create('lelkarat', function (Blueprint $table) {
|
|
$table->bigIncrements('id');
|
|
$table->unsignedBigInteger('lelong_id')->unsigned();
|
|
$table->string('karat');
|
|
$table->string('keterangan');
|
|
$table->decimal('harga', $precision = 5, $scale = 2)->nullable();
|
|
$table->decimal('harga2', $precision = 5, $scale = 2)->nullable();
|
|
$table->timestamps();
|
|
|
|
$table->foreign('lelong_id')
|
|
->references('id')->on('lelong')
|
|
->onDelete('cascade');
|
|
});
|
|
|
|
Schema::create('lelkarat_temp', function (Blueprint $table) {
|
|
$table->bigIncrements('id');
|
|
$table->unsignedBigInteger('lelong_id')->unsigned();
|
|
$table->string('karat');
|
|
$table->string('keterangan');
|
|
$table->decimal('harga', $precision = 5, $scale = 2);
|
|
$table->decimal('harga2', $precision = 5, $scale = 2);
|
|
$table->timestamps();
|
|
|
|
$table->foreign('lelong_id')
|
|
->references('id')->on('lelong')
|
|
->onDelete('cascade');
|
|
});
|
|
|
|
Schema::create('lelong_tebus', function (Blueprint $table) {
|
|
$table->bigIncrements('recno');
|
|
$table->datetime('tarikh')->nullable();
|
|
$table->string('kodcaw')->nullable();
|
|
$table->string('teller')->nullable();
|
|
$table->string('norujukan')->nullable();
|
|
$table->string('batch_no')->nullable();
|
|
$table->decimal('nilaimarhun', $precision = 11, $scale = 2);
|
|
$table->decimal('pinjaman', $precision = 11, $scale = 2);
|
|
$table->decimal('upah', $precision = 11, $scale = 2);
|
|
$table->decimal('jbg', $precision = 5, $scale = 2);
|
|
$table->string('jenis_tebus')->nullable();
|
|
$table->timestamps();
|
|
|
|
// $table->foreign('norujukan')
|
|
// ->references('norujukan')->on('gadai')
|
|
// ->onDelete('cascade');
|
|
});
|
|
|
|
Schema::create('tetapan', function (Blueprint $table) {
|
|
$table->bigIncrements('id');
|
|
$table->date('tetap_tarikh_lelong')->nullable();
|
|
$table->string('kali')->nullable();
|
|
$table->integer('cajlelong')->nullable();
|
|
$table->timestamps();
|
|
$table->longText('para2')->nullable();
|
|
$table->longText('para3')->nullable();
|
|
$table->longText('parabaki')->nullable();
|
|
$table->longText('parabaki2')->nullable();
|
|
$table->longText('para2blast')->nullable();
|
|
$table->longText('para3blast')->nullable();
|
|
|
|
// $table->foreign('norujukan')
|
|
// ->references('norujukan')->on('gadai')
|
|
// ->onDelete('cascade');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('lelong');
|
|
Schema::dropIfExists('cawangan_lelong');
|
|
Schema::dropIfExists('lelongbid');
|
|
Schema::dropIfExists('lelongbidmarhun');
|
|
Schema::dropIfExists('lelkarat');
|
|
Schema::dropIfExists('lelkarat_temp');
|
|
Schema::dropIfExists('tetapan');
|
|
}
|
|
}
|