Skip to content

Commit ef756b9

Browse files
committed
Merge pull request #55 from uyab/patch-migration
Use built in morphs() function to generate polymorphic columns
2 parents dd79b28 + 1ffc98b commit ef756b9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

resources/migrations/create_media_table.php.stub

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ class CreateMediaTable extends Migration
1313
{
1414
Schema::create('media', function (Blueprint $table) {
1515
$table->increments('id');
16-
$table->string('model_type')->nullable();
17-
$table->integer('model_id')->nullable();
16+
$table->morphs('model');
1817
$table->string('collection_name');
1918
$table->string('name');
2019
$table->string('file_name');

0 commit comments

Comments
 (0)