increments('id'); $table->string('loan_id', 50); $table->string('rps_type', 50); $table->date('as_on_date'); $table->integer('dpd')->default(0); $table->decimal('principal_outstanding', 15, 2)->default(0); $table->decimal('interest_due', 15, 2)->default(0); $table->decimal('interest_outstanding', 15, 2)->default(0); $table->decimal('total_bounce_due', 15, 2)->default(0); $table->decimal('total_penal_due', 15, 2)->default(0); $table->decimal('amount_overdue', 15, 2)->default(0); $table->decimal('total_outstanding', 15, 2)->default(0); $table->timestamps(); $table->softDeletes(); $table->unique(['loan_id', 'rps_type', 'as_on_date'], 'unique_snapshot'); $table->index(['loan_id', 'as_on_date']); $table->index('as_on_date'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('co_lending_daily_metrics'); } }