- Segment Company Relationship Service Class

- Update Standard Segment Constant Logic Class
- List Standard Segment Constant Logic Class
- List Standard Segment Logic Class
This commit is contained in:
CheeSiong
2020-11-13 14:15:34 +08:00
parent 6b394420dc
commit 1fbdc795ff
50 changed files with 1956 additions and 19 deletions
@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSegmentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('segments', function (Blueprint $table) {
$table->id();
$table->string('name')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('segments');
}
}
@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSegmentConstantsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('segment_constants', function (Blueprint $table) {
$table->id();
$table->bigInteger('segment_id')->unsigned()->nullable();
$table->foreign('segment_id')->references('id')->on('segments')->onDelete('cascade');
$table->string('name')->nullable();
$table->string('reference')->nullable();
$table->text('detail')->nullable();
$table->timestamps();
$table->integer('type')->nullable();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('segment_constants');
}
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSegmentCompaniesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('segment_company', function (Blueprint $table) {
$table->bigInteger('segment_id')->unsigned();
$table->foreign('segment_id')->references('id')->on('segments')->onDelete('cascade');
$table->bigInteger('company_id')->unsigned();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->primary(['segment_id', 'company_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('segment_company');
}
}