36 lines
774 B
PHP
36 lines
774 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateResource extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('resources', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string("filename")->unique();
|
|
$table->unsignedInteger("extension_id");
|
|
$table->timestamps();
|
|
|
|
$table->foreign("extension_id")->references("id")->on("resource_extensions");
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('resources');
|
|
}
|
|
}
|