Skip to content

Commit d872a58

Browse files
authored
2018_05_23_145242_edit_body_column_nullable.php
Make migration for set column body nullable, to fix the problem when create a page with no body field.
1 parent b8d8486 commit d872a58

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class EditContentColumnNulleable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::table('page__page_translations', function (Blueprint $table) {
17+
$table->string('body')->nullable()->change();
18+
});
19+
}
20+
21+
/**
22+
* Reverse the migrations.
23+
*
24+
* @return void
25+
*/
26+
public function down()
27+
{
28+
Schema::table('page__page_translations', function (Blueprint $table) {
29+
$table->string('body')->nullable(false)->change();
30+
});
31+
}
32+
}

0 commit comments

Comments
 (0)