-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement model from config media and enable uuid for migration relat…
…ed and id from uuid config file
- Loading branch information
1 parent
107e7bd
commit 0b1d3e9
Showing
5 changed files
with
56 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreateMediaTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('media', function (Blueprint $table) { | ||
$table->uuid('id')->primary(); | ||
$table->uuidMorphs('model'); | ||
$table->string('base_name'); | ||
$table->string('file_name')->nullable(); | ||
$table->string('path')->nullable(); | ||
$table->integer('index')->default(1); | ||
$table->string('label')->nullable(); | ||
$table->string('disk')->nullable(); | ||
$table->string('directory')->nullable(); | ||
$table->string('mime_type')->nullable(); | ||
$table->unsignedBigInteger('file_size')->default(0); | ||
$table->boolean('approved')->default(config('media.default_approved', true)); | ||
$table->nullableUuidMorphs('user'); | ||
$table->timestamps(); | ||
$table->softDeletes(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('media'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters