Skip to content

Commit

Permalink
2018_05_23_145242_edit_body_column_nullable.php
Browse files Browse the repository at this point in the history
Make migration for set column body nullable, to fix the problem when create a page with no body field.
  • Loading branch information
kamekun authored May 23, 2018
1 parent b8d8486 commit d872a58
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

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

class EditContentColumnNulleable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('page__page_translations', function (Blueprint $table) {
$table->string('body')->nullable()->change();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('page__page_translations', function (Blueprint $table) {
$table->string('body')->nullable(false)->change();
});
}
}

0 comments on commit d872a58

Please sign in to comment.