Build: Database setup

This commit is contained in:
Sallu9007
2025-01-26 00:46:53 +05:30
parent a79095624e
commit 54647b58f4
6 changed files with 157 additions and 3 deletions

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::create('departments', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->timestamps();
});
// Insert predefined departments
// DB::table('departments')->insert([
// ['name' => 'Computer Engineering'],
// ['name' => 'Information Technology'],
// ['name' => 'Mechanical Engineering'],
// ['name' => 'Electrical Engineering'],
// ['name' => 'Civil Engineering']
// ]);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('departments');
}
};