Files
ntspi-app/database/migrations/2023_11_24_093810_create_departments_table.php
T
2026-03-20 21:47:02 +05:00

34 lines
850 B
PHP
Executable File

<?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(): void
{
Schema::create('departments', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->text('content')->nullable();
$table->string('slug');
$table->boolean('is_active')->default(true);
$table->unsignedBigInteger('faculty_id');
$table->foreign('faculty_id')->references('id')->on('faculties');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('departments');
}
};