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
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('associate_images', function (Blueprint $table) {
|
|
|
|
$table->integer('id', true);
|
|
|
|
$table->integer('image_id');
|
|
|
|
$table->string('relation_type');
|
|
|
|
$table->integer('relation_id');
|
|
|
|
$table->integer('position')->nullable();
|
|
|
|
|
2017-10-30 02:42:36 +01:00
|
|
|
$table->foreign('image_id')->references('id')->on('images')->onDelete('cascade');
|
2017-10-03 17:05:46 +02:00
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::drop('associate_images');
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|