Backend for file uploads attached to any generic model, initially on aircraft and airports #226

This commit is contained in:
Nabeel Shahzad
2018-04-01 18:02:12 -05:00
parent 793b3e7134
commit e358b8706f
19 changed files with 437 additions and 38 deletions

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFilesTable extends Migration
{
/**
* Create the files table. Acts as a morphable
* @return void
*/
public function up()
{
Schema::create('files', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('description')->nullable();
$table->string('path');
$table->boolean('public')->default(true);
$table->string('ref_model', 50)->nullable();
$table->string('ref_model_id', 36)->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('files');
}
}