Cetaklabel/Database/Migrations/2023_04_10_024809_create_jobs_table.php

41 lines
1.3 KiB
PHP
Raw Normal View History

2023-05-15 10:03:46 +00:00
<?php
2023-05-15 14:14:52 +00:00
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
2023-05-15 10:03:46 +00:00
2023-05-15 14:14:52 +00:00
return new class extends Migration {
/**
* Run the migrations.
*/
public function up()
: void
{
Schema::create('jobs', function (Blueprint $table) {
$table->id();
$table->foreignId('directorat_id')->constrained('directorats')->onDelete('cascade');
$table->foreignId('sub_directorat_id')->constrained('sub_directorats')->onDelete('cascade');
$table->string('kode', 2);
$table->string('name', 50);
2023-06-12 09:59:37 +00:00
$table->string('status', 1)->default(0);
2023-05-15 14:14:52 +00:00
$table->timestamps();
2023-06-12 09:59:37 +00:00
$table->timestamp('authorized_at')->nullable();
2023-05-15 14:14:52 +00:00
$table->softDeletes();
2023-05-15 10:03:46 +00:00
2023-05-15 14:14:52 +00:00
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
2023-06-12 09:59:37 +00:00
$table->unsignedBigInteger('authorized_by')->nullable();
2023-05-15 14:14:52 +00:00
});
}
2023-05-15 10:03:46 +00:00
2023-05-15 14:14:52 +00:00
/**
* Reverse the migrations.
*/
public function down()
: void
{
Schema::dropIfExists('jobs');
}
};