Files
izyim/database/migrations/2018_11_30_085832_create_packages.php
Omair Saleh 0e5f2939e3 large commit
2019-10-05 13:09:26 +08:00

42 lines
1.0 KiB
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePackages extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('packages', function (Blueprint $table) {
$table->increments('id');
$table->integer('order_id')->unsigned()->index();
$table->integer('type')->default(0);
$table->string('description')->nullable();
$table->decimal('width', 7, 2);
$table->decimal('length', 7, 2);
$table->decimal('height', 7, 2);
$table->integer('weight')->default(0);
$table->integer('quantity');
$table->timestamps();
$table->foreign('order_id')->references('id')->on('orders');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('packages');
}
}