Move discount columns migration to a separate file
This commit is contained in:
parent
a1ccfc8b22
commit
e2148ef9a7
@ -240,11 +240,6 @@ class CoreV200 extends Migration
|
|||||||
Schema::table('users', function (Blueprint $table) {
|
Schema::table('users', function (Blueprint $table) {
|
||||||
$table->string('landing_page', 70)->nullable()->default('dashboard');
|
$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');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user