Update Master Data

This commit is contained in:
2026-02-20 00:06:06 +07:00
parent 21ad516dce
commit 66c8bb6810
99 changed files with 67783 additions and 306 deletions
@@ -6,11 +6,8 @@ use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
@@ -18,7 +15,22 @@ return new class extends Migration
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null');
$table->timestamps();
$table->softDeletes();
});
Schema::create('user_roles', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->unique()->constrained('users')->onDelete('cascade');
$table->enum('role_name', ['Super Admin', 'Admin', 'Koordinator', 'Penyuluh', 'Pendamping', 'Petani'])->default('Petani');
$table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null');
$table->timestamps();
$table->softDeletes();
});
Schema::create('password_reset_tokens', function (Blueprint $table) {
@@ -37,12 +49,10 @@ return new class extends Migration
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('users');
Schema::dropIfExists('user_roles');
Schema::dropIfExists('password_reset_tokens');
Schema::dropIfExists('sessions');
}