Modifying files table to allow for folders

parent 84ff7a4c
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddFoldersColumnsOnFilesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('media__files', function (Blueprint $table) {
$table->boolean('is_folder')->default(false)->after('id');
$table->string('path')->nullable()->change();
$table->string('extension')->nullable()->change();
$table->string('mimetype')->nullable()->change();
$table->string('filesize')->nullable()->change();
$table->string('folder_id')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('media__files', function (Blueprint $table) {
$table->dropColumn('is_folder');
$table->string('path')->nullable(false)->change();
$table->string('extension')->nullable(false)->change();
$table->string('mimetype')->nullable(false)->change();
$table->string('filesize')->nullable(false)->change();
$table->string('folder_id')->nullable(false)->change();
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment