first commit
This commit is contained in:
45
database/migrations/2017_09_01_000000_create_items_table.php
Normal file
45
database/migrations/2017_09_01_000000_create_items_table.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateItemsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('items', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('company_id');
|
||||
$table->string('name');
|
||||
$table->string('sku');
|
||||
$table->text('description')->nullable();
|
||||
$table->float('sale_price', 15, 4);
|
||||
$table->float('purchase_price', 15, 4);
|
||||
$table->integer('quantity');
|
||||
$table->integer('category_id')->nullable();
|
||||
$table->integer('tax_id')->nullable();
|
||||
$table->string('picture')->nullable();
|
||||
$table->boolean('enabled');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->index('company_id');
|
||||
$table->unique(['company_id', 'sku', 'deleted_at']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('items');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user