akaunting/database/migrations/2018_04_30_000000_add_parent_column.php

55 lines
1.2 KiB
PHP
Raw Normal View History

2018-05-01 19:00:33 +03:00
<?php
use Illuminate\Database\Migrations\Migration;
class AddParentColumn extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('invoices', function ($table) {
$table->integer('parent_id')->default(0);
});
Schema::table('revenues', function ($table) {
$table->integer('parent_id')->default(0);
});
Schema::table('bills', function ($table) {
$table->integer('parent_id')->default(0);
});
Schema::table('payments', function ($table) {
$table->integer('parent_id')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('invoices', function ($table) {
$table->dropColumn('parent_id');
});
Schema::table('revenues', function ($table) {
$table->dropColumn('parent_id');
});
Schema::table('bills', function ($table) {
$table->dropColumn('parent_id');
});
Schema::table('payments', function ($table) {
$table->dropColumn('parent_id');
});
}
}