Skip to content

Commit

Permalink
Move discount columns migration to a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
burakcakirel committed Mar 23, 2020
1 parent a1ccfc8 commit e2148ef
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 deletions.
5 changes: 0 additions & 5 deletions database/migrations/2020_01_08_000000_core_v200.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,6 @@ public function up()
Schema::table('users', function (Blueprint $table) {
$table->string('landing_page', 70)->nullable()->default('dashboard');
});

Schema::table('invoice_items', function (Blueprint $table) {
$table->double('discount_rate', 15, 4)->default('0.0000');
$table->string('discount_type')->default('normal');
});
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddDiscountColumnsInvoiceItemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table(
'invoice_items',
function (Blueprint $table) {
$table->double('discount_rate', 15, 4)->default('0.0000')->after('tax');
$table->string('discount_type')->default('normal')->after('discount_rate');
}
);
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table(
'invoice_items',
function (Blueprint $table) {
$table->dropColumn('discount_rate');
$table->dropColumn('discount_type');
}
);
}
}

0 comments on commit e2148ef

Please sign in to comment.