Add API
This commit is contained in:
@@ -15,11 +15,13 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('organizations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('code')->unique();
|
||||
$table->string('name');
|
||||
$table->string('type')->nullable();
|
||||
$table->string('status')->nullable()->default('active');
|
||||
$table->text('description')->nullable();
|
||||
$table->foreignId('part_of')->nullable();
|
||||
$table->foreignId('main_address_id')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
@@ -27,7 +27,16 @@ return new class extends Migration
|
||||
$table->string('postal_code')->nullable();
|
||||
$table->string('rt')->nullable();
|
||||
$table->string('rw')->nullable();
|
||||
$table->string('lat')->nullable();
|
||||
$table->string('lng')->nullable();
|
||||
$table->dateTime('period_start')->nullable();
|
||||
$table->dateTime('period_end')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->foreignId('created_by')->nullable();
|
||||
$table->foreignId('updated_by')->nullable();
|
||||
$table->foreignId('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
41
database/migrations/2022_09_16_045129_create_metas_table.php
Normal file
41
database/migrations/2022_09_16_045129_create_metas_table.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?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('metas', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->morphs('metaable');
|
||||
$table->string('system')->nullable()->index();
|
||||
$table->string('type')->index();
|
||||
$table->text('value')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->foreignId('created_by')->nullable();
|
||||
$table->foreignId('updated_by')->nullable();
|
||||
$table->foreignId('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('metas');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
<?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('practitioners', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('person_id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->foreignId('created_by')->nullable();
|
||||
$table->foreignId('updated_by')->nullable();
|
||||
$table->foreignId('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('practitioners');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,47 @@
|
||||
<?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('persons', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('nik')->nullable();
|
||||
$table->string('name_prefix')->nullable();
|
||||
$table->string('name')->nullable();
|
||||
$table->string('name_suffix')->nullable();
|
||||
$table->string('gender')->nullable();
|
||||
$table->dateTime('birth_date')->nullable();
|
||||
$table->boolean('is_deceased')->default(0);
|
||||
$table->dateTime('deceased_at')->nullable();
|
||||
$table->string('marital_status')->nullable();
|
||||
$table->foreignId('main_address_id')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->foreignId('created_by')->nullable();
|
||||
$table->foreignId('updated_by')->nullable();
|
||||
$table->foreignId('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('persons');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
<?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('practitioner_roles', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('practitioner_id')->index();
|
||||
$table->foreignId('organization_id')->index();
|
||||
$table->foreignId('speciality_id')->nullable()->index();
|
||||
$table->foreignId('identifier_id')->nullable()->index();
|
||||
$table->dateTime('period_start')->nullable();
|
||||
$table->dateTime('period_end')->nullable();
|
||||
$table->boolean('active')->default(true);
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->foreignId('created_by')->nullable()->index();
|
||||
$table->foreignId('updated_by')->nullable()->index();
|
||||
$table->foreignId('deleted_by')->nullable()->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('practitioner_roles');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user