Modifs
This commit is contained in:
38
database/migrations/2017_10_03_140902_create_associate_images.php
Executable file
38
database/migrations/2017_10_03_140902_create_associate_images.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?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');
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user