updated migrations

This commit is contained in:
denisdulici
2019-12-16 12:04:27 +03:00
parent bfa445c322
commit 1e2b5a3621
61 changed files with 130 additions and 68 deletions

View File

@ -1,6 +1,8 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddParentColumn extends Migration
{
@ -11,19 +13,19 @@ class AddParentColumn extends Migration
*/
public function up()
{
Schema::table('invoices', function ($table) {
Schema::table('invoices', function (Blueprint $table) {
$table->integer('parent_id')->default(0);
});
Schema::table('revenues', function ($table) {
Schema::table('revenues', function (Blueprint $table) {
$table->integer('parent_id')->default(0);
});
Schema::table('bills', function ($table) {
Schema::table('bills', function (Blueprint $table) {
$table->integer('parent_id')->default(0);
});
Schema::table('payments', function ($table) {
Schema::table('payments', function (Blueprint $table) {
$table->integer('parent_id')->default(0);
});
}
@ -35,19 +37,19 @@ class AddParentColumn extends Migration
*/
public function down()
{
Schema::table('invoices', function ($table) {
Schema::table('invoices', function (Blueprint $table) {
$table->dropColumn('parent_id');
});
Schema::table('revenues', function ($table) {
Schema::table('revenues', function (Blueprint $table) {
$table->dropColumn('parent_id');
});
Schema::table('bills', function ($table) {
Schema::table('bills', function (Blueprint $table) {
$table->dropColumn('parent_id');
});
Schema::table('payments', function ($table) {
Schema::table('payments', function (Blueprint $table) {
$table->dropColumn('parent_id');
});
}