siakad-itm/database/migrations/2026_08_25_000002_create_announcements_table.php
Yoga Pangestu e268153971
Some checks failed
tests / ci (pull_request) Has been cancelled
feat: add announcement management functionality with CRUD operations
2026-08-25 01:03:20 +07:00

28 lines
813 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('announcements', function (Blueprint $table) {
$table->id();
$table->string('title', 200);
$table->text('content');
$table->foreignId('department_id')->nullable()->constrained()->nullOnDelete();
$table->integer('enrollment_year')->nullable();
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamps();
$table->softDeletes();
});
}
public function down(): void
{
Schema::dropIfExists('announcements');
}
};