1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
use Illuminate\Database\Migrations\Migration; |
4
|
|
|
use Illuminate\Database\Schema\Blueprint; |
5
|
|
|
use Illuminate\Support\Facades\Schema; |
6
|
|
|
|
7
|
|
|
class CreateInventoryObjectTable extends Migration |
|
|
|
|
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* Run the migrations. |
11
|
|
|
* |
12
|
|
|
* @return void |
13
|
|
|
*/ |
14
|
|
|
public function up() |
15
|
|
|
{ |
16
|
|
|
Schema::create('inventory', function (Blueprint $table) { |
17
|
|
|
$table->increments('id'); |
18
|
|
|
$table->integer('public_id'); |
19
|
|
|
$table->string('name', 80); |
20
|
|
|
$table->string('description', 120); |
21
|
|
|
$table->integer('material_type_id'); |
22
|
|
|
$table->integer('brand_id'); |
23
|
|
|
$table->integer('model_id'); |
24
|
|
|
$table->integer('location_id'); |
25
|
|
|
|
26
|
|
|
//$table->foreign('material_type_id')->references('id')->on('material_type'); |
|
|
|
|
27
|
|
|
|
28
|
|
|
//$table->foreign('brand_id')->references('id')->on('brand_type'); |
|
|
|
|
29
|
|
|
|
30
|
|
|
//$table->foreign('model_id')->references('id')->on('brand_model'); |
|
|
|
|
31
|
|
|
|
32
|
|
|
//$table->foreign('location_id')->references('id')->on('brand'); |
|
|
|
|
33
|
|
|
$table->integer('quantity'); |
34
|
|
|
$table->double('price'); |
35
|
|
|
$table->integer('moneysourceId'); |
36
|
|
|
$table->integer('provider_id'); |
37
|
|
|
|
38
|
|
|
//$table->foreign('moneySourceId')->references('id')->on('brand'); |
|
|
|
|
39
|
|
|
|
40
|
|
|
//$table->foreign('provider_id')->references('id')->on('providers'); |
|
|
|
|
41
|
|
|
$table->date('date_entrance'); |
42
|
|
|
$table->date('last_update'); |
43
|
|
|
$table->string('picture', 60); |
44
|
|
|
$table->timestamps(); |
45
|
|
|
$table->softDeletes(); |
46
|
|
|
}); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Reverse the migrations. |
51
|
|
|
* |
52
|
|
|
* @return void |
53
|
|
|
*/ |
54
|
|
|
public function down() |
55
|
|
|
{ |
56
|
|
|
Schema::dropIfExists('inventory'); |
57
|
|
|
} |
58
|
|
|
} |
59
|
|
|
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.