increments('id'); $table->string('payref', 50); $table->datetime('transdate'); $table->integer('client_id')->unsigned(); $table->integer('service_prov_id')->unsigned(); $table->string('firs_tin', 100); $table->string('new_tin', 100); $table->string('taxpayer_name', 100); $table->string('taxoffice_id', 50); $table->decimal('amount', 20, 2); $table->integer('currency_id')->unsigned(); $table->integer('tax_type_id')->unsigned(); $table->integer('payment_channel_id')->unsigned(); $table->string('assessment_no', 50); $table->string('assessment_period', 50); $table->date('payperiod_from')->default('1001-01-01'); $table->date('payperiod_to')->default('1001-01-01'); $table->integer('bank_id')->unsigned(); $table->integer('switching_platform_id')->unsigned(); $table->integer('settlement_id')->unsigned()->nullable(); $table->enum('bankhassettled', ['0', '1'])->default('0'); $table->enum('sent2firs', ['0', '1'])->default('0'); $table->enum('sent2cbn', ['0', '1'])->default('0'); $table->date('datesent2firs')->default('1001-01-01'); $table->date('datesent2cbn')->default('1001-01-01'); $table->timestamps(); //Foreign keys $table->foreign('client_id')->references('id')->on('api_clients'); $table->foreign('service_prov_id')->references('id')->on('service_provs'); $table->foreign('currency_id')->references('id')->on('currencies'); $table->foreign('tax_type_id')->references('id')->on('tax_types'); $table->foreign('payment_channel_id')->references('id')->on('payment_channels'); $table->foreign('bank_id')->references('id')->on('banks'); $table->foreign('switching_platform_id')->references('id')->on('switching_platforms'); $table->foreign('settlement_id')->references('id')->on('settlements'); //Indexes $table->unique(['payref', 'service_prov_id']); $table->index('transdate'); $table->index('firs_tin'); $table->index('currency_id'); $table->index('tax_type_id'); $table->index('payment_channel_id'); $table->index('bank_id'); $table->index('switching_platform_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('transactions'); } }