39 lines
833 B
PHP
Executable File
39 lines
833 B
PHP
Executable File
<?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();
|
|
|
|
$table->foreign('image_id')->references('id')->on('images');
|
|
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::drop('associate_images');
|
|
|
|
}
|
|
}
|