update bugs fix medicine, user record update-delete, user login

This commit is contained in:
2024-01-05 12:22:56 +07:00
parent 7c820547c0
commit 87f2788cdd
30 changed files with 505 additions and 96 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']);
});
}
};