bigIncrements('id'); $table->string('tarikh_lelong')->nullable(); $table->time('masatamat_lelong')->nullable(); $table->dateTime('masakemaskini_data')->nullable(); $table->string('kali')->nullable(); $table->string('harga_emas_asas')->nullable(); $table->string('jbg')->nullable(); $table->integer('cajlelong')->nullable(); $table->integer('fasa')->default(0); $table->integer('success_import')->default(0); $table->timestamps(); }); Schema::create('cawangan_simulasi', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedBigInteger('simulasi_id')->unsigned(); $table->unsignedBigInteger('caw_id')->unsigned(); $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->timestamps(); $table->foreign('caw_id') ->references('id')->on('cawangan') ->onDelete('cascade'); $table->foreign('simulasi_id') ->references('id')->on('simulasi') ->onDelete('cascade'); }); Schema::create('simulasibid', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedBigInteger('simulasi_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)->nullable(); $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('pinjaman', $precision = 9, $scale = 2)->nullable(); $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->integer('status_jual'); $table->integer('status_payment'); $table->integer('mora_upah'); $table->integer('fasa')->default(0); $table->timestamps(); $table->foreign('caw_id') ->references('id')->on('cawangan') ->onDelete('cascade'); $table->foreign('simulasi_id') ->references('id')->on('simulasi') ->onDelete('cascade'); }); Schema::create('simulasibidmarhun', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedBigInteger('simulasibid_id')->unsigned(); $table->decimal('bil', $precision = 3, $scale = 0); $table->string('marhun'); $table->string('nota'); $table->string('karat'); $table->decimal('berat', $precision = 7, $scale = 2); $table->decimal('harga', $precision = 5, $scale = 2)->nullable(); $table->decimal('n_marhun', $precision = 9, $scale = 2); $table->decimal('hargaasas', $precision = 11, $scale = 2)->nullable(); $table->timestamps(); $table->foreign('simulasibid_id') ->references('id')->on('simulasibid') ->onDelete('cascade'); }); Schema::create('simkarat', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedBigInteger('simulasi_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('simulasi_id') ->references('id')->on('simulasi') ->onDelete('cascade'); }); Schema::create('simkarat_temp', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedBigInteger('simulasi_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('simulasi_id') ->references('id')->on('simulasi') ->onDelete('cascade'); }); Schema::create('cawangan_temp', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('caw_name'); $table->string('caw_code'); $table->string('lokasi'); $table->timestamps(); }); Schema::create('gadai_temp', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('kodcaw'); $table->string('norujukan'); $table->decimal('tempoh'); $table->decimal('kadarupah'); $table->decimal('nilaimarhun'); $table->decimal('bakipjm'); $table->decimal('bakiupah'); $table->decimal('cajlain')->nullable(); $table->decimal('berat')->nullable(); $table->string('marhun')->nullable(); $table->decimal('percentpinj')->nullable(); $table->timestamps(); }); Schema::create('marhun_temp', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('norujukan'); $table->string('karat'); $table->decimal('berat'); $table->integer('bil'); $table->string('marhun'); $table->string('nota'); $table->decimal('n_marhun'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('simulasi'); Schema::dropIfExists('cawangan_simulasi'); Schema::dropIfExists('simulasibid'); Schema::dropIfExists('simulasibidmarhun'); Schema::dropIfExists('simkarat'); Schema::dropIfExists('simkarat_temp'); Schema::dropIfExists('gadai_temp'); Schema::dropIfExists('marhun_temp'); } }