images/database/migrations/0000_00_00_000002_create_as...

35 lines
803 B
PHP
Raw Normal View History

2017-10-03 17:05:46 +02:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAssociateImages extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
2020-11-28 00:05:00 +01:00
public function up(): void
2017-10-03 17:05:46 +02:00
{
Schema::create('associate_images', function (Blueprint $table) {
2020-11-28 00:05:00 +01:00
$table->id();
$table->foreignId('image_id')->constrained()->onDelete('cascade');
2017-10-03 17:05:46 +02:00
$table->string('relation_type');
2020-11-28 00:05:00 +01:00
$table->unsignedBigInteger('relation_id');
2017-10-03 17:05:46 +02:00
$table->integer('position')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
2020-11-28 00:05:00 +01:00
public function down(): void
2017-10-03 17:05:46 +02:00
{
Schema::drop('associate_images');
}
}