1: <?php use Illuminate\Database\Schema\Blueprint;
2: use Illuminate\Database\Migrations\Migration;
3: class CreateProductsTable extends Migration {
4:
5: 6: 7: 8: 9:
10: public function up()
11: {
12: if (!Schema::hasTable('products'))
13: {
14: Schema::create('products', function(Blueprint $table)
15: {
16: $table->increments('id');
17: $table->string('name');
18: $table->string('description')->nullable();
19: $table->string('size')->nullable();
20: $table->string('model')->nullable();
21: $table->string('gallery_id')->nullable();
22: $table->string('media_id')->nullable();
23: $table->timestamps();
24: });
25: }
26: }
27:
28: 29: 30: 31: 32:
33: public function down()
34: {
35: Schema::dropIfExists('products');
36: }
37:
38: }