Merge remote-tracking branch 'origin/staging' into origin/production

This commit is contained in:
Linksehat Staging Server
2024-01-06 09:59:46 +07:00
45 changed files with 785 additions and 319 deletions

View File

@@ -0,0 +1,32 @@
<?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::table('users', function (Blueprint $table) {
$table->foreignId('role_id')->after('person_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('role_id');
});
}
};

View File

@@ -0,0 +1,35 @@
<?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('fiture_has_permissions', function (Blueprint $table) {
$table->id();
$table->string('fitur_name');
$table->timestamps();
$table->unsignedBigInteger('created_by')->nullable()->index();
$table->unsignedBigInteger('updated_by')->nullable()->index();
$table->unsignedBigInteger('deleted_by')->nullable()->index();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('fiture_has_permissions');
}
};

View File

@@ -0,0 +1,100 @@
<?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::table('request_log_benefits', function (Blueprint $table) {
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreign('created_by')->references('id')->on('users')->onDelete('set null');
$table->foreign('updated_by')->references('id')->on('users')->onDelete('set null');
$table->foreign('deleted_by')->references('id')->on('users')->onDelete('set null');
});
Schema::table('request_log_daily_monitorings', function (Blueprint $table) {
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreign('created_by')->references('id')->on('users')->onDelete('set null');
$table->foreign('updated_by')->references('id')->on('users')->onDelete('set null');
$table->foreign('deleted_by')->references('id')->on('users')->onDelete('set null');
});
Schema::table('request_log_medical_plan', function (Blueprint $table) {
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreign('created_by')->references('id')->on('users')->onDelete('set null');
$table->foreign('updated_by')->references('id')->on('users')->onDelete('set null');
$table->foreign('deleted_by')->references('id')->on('users')->onDelete('set null');
});
Schema::table('request_log_medicines', function (Blueprint $table) {
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreign('created_by')->references('id')->on('users')->onDelete('set null');
$table->foreign('updated_by')->references('id')->on('users')->onDelete('set null');
$table->foreign('deleted_by')->references('id')->on('users')->onDelete('set null');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('request_log_benefits', function (Blueprint $table) {
$table->dropForeign(['created_by']);
$table->dropForeign(['updated_by']);
$table->dropForeign(['deleted_by']);
$table->dropColumn(['created_by', 'updated_by', 'deleted_by']);
});
Schema::table('request_log_daily_monitorings', function (Blueprint $table) {
$table->dropForeign(['created_by']);
$table->dropForeign(['updated_by']);
$table->dropForeign(['deleted_by']);
$table->dropColumn(['created_by', 'updated_by', 'deleted_by']);
});
Schema::table('request_log_medical_plan', function (Blueprint $table) {
$table->dropForeign(['created_by']);
$table->dropForeign(['updated_by']);
$table->dropForeign(['deleted_by']);
$table->dropColumn(['created_by', 'updated_by', 'deleted_by']);
});
Schema::table('request_log_medicines', function (Blueprint $table) {
$table->dropForeign(['created_by']);
$table->dropForeign(['updated_by']);
$table->dropForeign(['deleted_by']);
$table->dropColumn(['created_by', 'updated_by', 'deleted_by']);
});
}
};

View File

@@ -0,0 +1,32 @@
<?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::table('users', function (Blueprint $table) {
$table->string('username')->after('email')->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('username');
});
}
};

View File

@@ -0,0 +1,36 @@
<?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::table('request_logs', function (Blueprint $table) {
$table->integer('approved_by')->nullable()->after('created_by');
$table->dateTime('approved_at')->nullable()->after('approved_by');
$table->integer('approved_final_log_by')->nullable()->after('approved_at');
$table->dateTime('approved_final_log_at')->nullable()->after('approved_final_log_by');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('request_logs', function (Blueprint $table) {
$table->dropColumn(['approved_by', 'invoice_date', 'approved_final_log_by', 'approved_final_log_at']);
});
}
};

View File

@@ -0,0 +1,32 @@
<?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::table('members', function (Blueprint $table) {
$table->string('employee_status')->after('terminated_date')->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('members', function (Blueprint $table) {
$table->dropColumn('employee_status');
});
}
};