2023_03_31_121853_create_goods_table.php
1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('goods', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('category_id')->nullable(false);
$table->string('title', 255);
$table->integer('price')->default(0);
$table->integer('price_old')->default(0);
$table->string('image', 255)->nullable();
$table->string('manufacturer', 255)->nullable();
$table->string('country', 255)->nullable();
$table->string('size', 255)->nullable();
$table->integer('power')->default(0);
$table->text('description')->nullable();
$table->text('feature')->nullable();
$table->text('equipment')->nullable();
$table->unsignedBigInteger('accessory_id')->nullable()->default(0);
$table->unsignedBigInteger('tooling_id')->nullable()->default(0);
$table->string('weight', 100)->nullable();
$table->boolean('new')->default(1);
$table->integer('stock_count')->default(1);
$table->boolean('demo')->default(0);
$table->boolean('way')->default(0);
$table->string('type_good', 100)->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('goods');
}
};