Skip to content

Instantly share code, notes, and snippets.

@mattaebersold
Created June 30, 2015 20:09
Show Gist options
  • Save mattaebersold/bd9011f0d830e29dddb3 to your computer and use it in GitHub Desktop.
Save mattaebersold/bd9011f0d830e29dddb3 to your computer and use it in GitHub Desktop.
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ProductImagesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
Schema::create('product_images', function($t){
$t->increments('id');
$t->string('title');
$t->string('image')->nullable();
$t->string('image_crops')->nullable();
$t->date('date');
$t->integer('position');
$t->boolean('visible')->nullable()->index();
$t->timestamps();
// relationship
$t->integer('product_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::drop('product_images');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment