36 lines
872 B
PHP
36 lines
872 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateMultimediaTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('multimedia', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->unsignedBigInteger('multimedia_category_id')->unsigned();
|
|
$table->foreign('multimedia_category_id')->references('id')->on('multimedia_categories')->onDelete('cascade');
|
|
$table->text('title')->nullable();
|
|
$table->text('media');
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('multimedia');
|
|
}
|
|
}
|