| Total Complexity | 2 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class CreateProductsTable extends Migration |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Run the migrations. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | Schema::create('products', function (Blueprint $table) { |
||
| 17 | $table->id(); |
||
| 18 | $table->string('name'); |
||
| 19 | $table->text('description'); |
||
| 20 | $table->longText('long_description')->nullable(); |
||
| 21 | $table->decimal('price'); |
||
| 22 | $table->text('image_path'); |
||
| 23 | $table->text('big_image_path'); |
||
| 24 | $table->integer('ml')->nullable(); |
||
| 25 | $table->decimal('alcholic')->nullable(); |
||
| 26 | $table->integer('quantity'); |
||
| 27 | $table->decimal('weight')->nullable(); |
||
| 28 | $table->boolean('in_home')->default(false); |
||
| 29 | $table->unsignedBigInteger('category_id'); |
||
| 30 | $table->timestamps(); |
||
| 31 | |||
| 32 | //foreign |
||
| 33 | $table->foreign('category_id')->references('id')->on('categories'); |
||
| 34 | }); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Reverse the migrations. |
||
| 39 | * |
||
| 40 | * @return void |
||
| 41 | */ |
||
| 42 | public function down() |
||
| 45 | } |
||
| 46 | } |
||
| 47 |