clean migration files to resolve conflict

This commit is contained in:
Omair Saleh
2019-01-23 22:50:00 +08:00
parent ee69a1c7de
commit f04eb88a86
8 changed files with 44 additions and 108 deletions
@@ -19,8 +19,8 @@ class CreateUserBankSlipsTable extends Migration
$table->string('bankslip_url')->nullable();
$table->double('transfer_amount')->nullable();
$table->string('cust_marking')->nullable();
$table->integer('book_id')->unsigned();
$table->foreign('book_id')->references('id')->on('bookings');
$table->integer('booking_id')->unsigned();
$table->foreign('booking_id')->references('id')->on('bookings');
$table->timestamps();
});
@@ -35,7 +35,7 @@ class CreateUserBankSlipsTable extends Migration
{
Schema::table('user_bank_slips', function(Blueprint $table)
{
$table->dropForeign('user_bank_slips_book_id_foreign');
$table->dropForeign('user_bank_slips_id_foreign');
});
Schema::dropIfExists('user_bank_slips');
@@ -17,8 +17,8 @@ class CreatePurchaseOrdersTable extends Migration
$table->increments('id');
$table->string('image_url');
$table->double('amount');
$table->integer('book_id')->unsigned()->nullable;
$table->foreign('book_id')->references('id')->on('bookings');
$table->integer('booking_id')->unsigned()->nullable;
$table->foreign('booking_id')->references('id')->on('bookings');
$table->timestamps();
});
}
@@ -1,31 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RenameBookIdToBookingIdInUserbankslipTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('user_bank_slips', function($table)
{
$table->renameColumn('book_id', 'booking_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
@@ -22,8 +22,8 @@ class SupplierBookingTable extends Migration
$table->double('amountInRMB');
$table->double('rmbBankAmount');
$table->integer('book_id')->unsigned();
$table->foreign('book_id')->references('id')->on('bookings');
$table->integer('booking_id')->unsigned();
$table->foreign('booking_id')->references('id')->on('bookings');
$table->integer('supplier_id')->unsigned();
$table->foreign('supplier_id')->references('id')->on('setting_suppliers');
@@ -16,8 +16,8 @@ class CreateSupplierBookingItemsTable extends Migration
Schema::create('supplier_booking_items', function (Blueprint $table) {
$table->increments('id');
$table->string('china_bankslip_url');
$table->integer('book_id')->unsigned();
$table->foreign('book_id')->references('id')->on('bookings');
$table->integer('booking_id')->unsigned();
$table->foreign('booking_id')->references('id')->on('bookings');
$table->double('bank_in_amount');
$table->integer('supplierbooking_id')->unsigned();
$table->foreign('supplierbooking_id')->references('id')->on('supplier_bookings');
@@ -1,34 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RenameBookingForeignkeyInPoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('purchase_orders', function($table)
{
$table->dropForeign(['book_id']);
$table->dropColumn('book_id');
$table->integer('booking_id')->unsigned()->nullable();
$table->foreign('booking_id')->references('id')->on('bookings');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
@@ -1,34 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RenameBookingForeignkeyFromSupplierbookingTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('supplier_bookings', function($table)
{
$table->dropForeign(['book_id']);
$table->dropColumn('book_id');
$table->integer('booking_id')->unsigned()->nullable();
$table->foreign('booking_id')->references('id')->on('bookings');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
@@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class SupplierPayments extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('supplier_bookings', function($table) {
$table->double('paid_amount_myr')->default(0);
$table->integer('complete')->default(0);
});
DB::table('supplier_bookings')->update(['complete' => 1]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('supplier_bookings', function($table) {
$table->dropColumn('paid_amount_myr');
$table->dropColumn('complete');
});
}
}