mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-21 13:34:08 +00:00
Migration file for orders
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Order extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OrderRole extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OrderStep extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOrdersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('orders', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('company_module_id')->unsigned()->index()->comment('Entity responsible to create this order');
|
||||
$table->string('reference')->comment('Reference no for user ');
|
||||
$table->string('reference_contract')->comment('Reference no from Unity platform');
|
||||
$table->integer('type')->default(0)->comment('Order packages can be shipped in shared or dedicated container');
|
||||
$table->integer('status')->default(0)->comment('Status of this order, e.g. processing, shipping etc.');
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
|
||||
//Uncomment when foreign key table ready
|
||||
//$table->foreign('company_module_id')->references('id')->on('company_modules');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('orders');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOrderStepsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('order_steps', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('order_id')->unsigned()->index();
|
||||
$table->integer('appointee_id')->unsigned()->index()->comment('');
|
||||
$table->string('reference')->comment('Reference no for user ');
|
||||
$table->integer('primary')->default(0);
|
||||
$table->decimal('sequence', 4, 2);
|
||||
$table->integer('status')->default(0)->comment('Status of this order, e.g. processing, shipping etc.');
|
||||
$table->integer('contract_status')->default(0)->comment('Status of this order, e.g. processing, shipping etc.');
|
||||
$table->date('complete_date')->nullable();
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
|
||||
//Uncomment when foreign key table ready
|
||||
//$table->foreign('appointee_id')->references('id')->on('company_modules');
|
||||
$table->foreign('order_id')->references('id')->on('orders');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('order_steps');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOrderRolesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('order_roles', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('order_id')->unsigned()->index()->comment('Order id');
|
||||
$table->integer('company_module_id')->unsigned()->index()->comment('Entity plays a role in this order, e.g. Freight Forwarder');
|
||||
$table->integer('role')->default(0)->comment('Describe role participate in processing order');
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
|
||||
//Uncomment when foreign key table ready
|
||||
//$table->foreign('company_module_id')->references('id')->on('company_modules');
|
||||
$table->foreign('order_id')->references('id')->on('orders');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('order_roles');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user