Commit 1b307f70 authored by Chanon.u's avatar Chanon.u
Browse files

Add migration file for manual response feature

parent 155c2612
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mr_master_messages', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('value');
$table->timestamps();
});
DB::table('mr_master_messages')->insert([
[
'name' => 'export',
'value' => 'EXPORT',
],
[
'name' => 'import',
'value' => 'IMPORT',
],
[
'name' => 'gcl',
'value' => 'GCL',
],
[
'name' => 'short',
'value' => 'SHORT',
]
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mr_master_messages');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mr_declaration_running', function (Blueprint $table) {
$table->id();
$table->string('document_type');
$table->integer('running_number')->default(0);
$table->date('last_updated_date');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mr_declaration_runnings');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mr_master_doc_types', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('mid');
$table->string('code');
$table->string('name');
$table->string('mode');
$table->timestamps();
$table->foreign('mid')->references('id')->on('master_messages')->onDelete('cascade');
});
DB::table('mr_master_doc_types')->insert([
['mid' => '2', 'code' => '0', 'name' => '0-ใบขนสินค้าขาเข้า', 'mode' => 'IMDECL'],
['mid' => '2', 'code' => '2', 'name' => '2-ใบขนสินค้าผ่านแดน (Transit)', 'mode' => 'IMDECL'],
['mid' => '2', 'code' => '3', 'name' => '3-คำร้องขอรับของไปก่อน', 'mode' => 'IMDECL'],
['mid' => '2', 'code' => '5', 'name' => '5-ใบขนสินค้าขาเข้าปากระวาง', 'mode' => 'IMDECL'],
['mid' => '2', 'code' => '8', 'name' => '8-ใบขนสินค้าถ่ายลำ (Transhipment)', 'mode' => 'IMDECL'],
['mid' => '2', 'code' => 'A', 'name' => 'A-ใบขนสินค้าขาเข้าโอนย้ายในประเทศ', 'mode' => 'IMDECL'],
['mid' => '2', 'code' => 'C', 'name' => 'C-ใบขนสินค้าขาเข้าโอนย้ายจากเขตปลอดอากร', 'mode' => 'IMDECL'],
['mid' => '1', 'code' => '1', 'name' => '1-ใบขนสินค้าขาออก', 'mode' => 'EXDECL'],
['mid' => '1', 'code' => '4', 'name' => '4-คำร้องขอออกของไปก่อน', 'mode' => 'EXDECL'],
['mid' => '1', 'code' => 'B', 'name' => 'B-ใบขนสินค้าขาออกโอนย้ายภายในประเทศ', 'mode' => 'EXDECL'],
['mid' => '1', 'code' => 'D', 'name' => 'D-ใบขนสินค้าขาออกโอนย้ายเข้าเขตปลอดอากร', 'mode' => 'EXDECL'],
['mid' => '1', 'code' => '6', 'name' => '6-ใบขนสินค้าพิเศษผ่านแดนขาออก', 'mode' => 'EXDECL'],
['mid' => '1', 'code' => 'H', 'name' => 'H-คำร้องขอนำออกนอกเขตอารักขาศุลกากร', 'mode' => 'EXDECL'],
['mid' => '1', 'code' => 'Y', 'name' => 'Y-ใบขนสินค้าขาออกเร่งด่วน', 'mode' => 'EXDECL'],
['mid' => '2', 'code' => 'X', 'name' => 'X-ใบขนสินค้าขาเข้าเร่งด่วน', 'mode' => 'IMDECL'],
['mid' => '2', 'code' => 'P', 'name' => 'P-ใบขนสินค้าขาเข้าโอนย้ายชำระค่าภาษีอากร', 'mode' => 'IMDECL'],
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mr_master_doc_types');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mr_users_connect_spn', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('uid');
$table->string('username');
$table->string('password');
$table->string('link');
$table->timestamps();
$table->foreign('uid')->references('id')->on('users')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mr_users_connect_spn');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mr_tab_manual_response_log', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('uid');
$table->string('title');
$table->string('detail');
$table->text('xml_content');
$table->string('reference_number');
$table->string('declaration_number');
$table->string('link');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mr_tab_manual_response_log');
}
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment