mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-19 04:24:01 +00:00
added migration, controller, model
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Decision extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'wa_id',
|
||||
'decision_type',
|
||||
'description',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Decisionitem extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'decision_id',
|
||||
'wi_id',
|
||||
'num_of_item',
|
||||
];
|
||||
}
|
||||
@@ -16,6 +16,7 @@ class Warehouseitem extends Model
|
||||
'nominal_weight',
|
||||
'actual_weight',
|
||||
'balance',
|
||||
'isDamaged',
|
||||
'status',
|
||||
'image',
|
||||
];
|
||||
|
||||
+6
-1
@@ -16,7 +16,12 @@ class CreateWarehousearrsTable extends Migration
|
||||
Schema::create('warehousearrs', function (Blueprint $table) {
|
||||
|
||||
$table->increments('id');
|
||||
$table->integer('so_id');
|
||||
|
||||
$table->unsignedInteger('so_id');//FK shipping order id
|
||||
$table->foreign('so_id')
|
||||
->references('id')->on('sos')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->date('receive_on');
|
||||
$table->string('transport_company_name');
|
||||
$table->integer('consignment_note_no');
|
||||
+1
-1
@@ -24,7 +24,7 @@ class CreateWarehouseitemsTable extends Migration
|
||||
$table->integer('nominal_weight');
|
||||
$table->integer('actual_weight');
|
||||
$table->string('balance');
|
||||
$table->string('isDamaged');
|
||||
$table->boolean('isDamaged');
|
||||
$table->string('status');
|
||||
$table->string('image');
|
||||
$table->timestamps();
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateDecisionsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('decisions', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
$table->unsignedInteger('wa_id');//FK warehouse arrangement
|
||||
$table->foreign('wa_id')
|
||||
->references('id')->on('warehousearrs')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->string('decision_type');
|
||||
$table->string('description');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('decisions');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateDecisionitemsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('decisionitems', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
$table->unsignedInteger('decision_id');//fk decison id
|
||||
$table->foreign('decision_id')
|
||||
->references('id')->on('decisions')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->unsignedInteger('wi_id');//fk warehouse item id
|
||||
$table->foreign('wi_id')
|
||||
->references('id')->on('warehouseitems')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->integer('num_of_item');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('decisionitems');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user