<?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('services', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->string('name');
        });

        // Inserer les premières valeurs
        DB::table('services')->insert([
            ['name' => 'Recteur', 'created_at' => now(), 'updated_at' => now()],
            ['name' => 'Vice-Recteur chargé des Affaires Académiques', 'created_at' => now(), 'updated_at' => now()],
            ['name' => 'Vice-Recteur chargé de la Recherche Universitaire', 'created_at' => now(), 'updated_at' => now()],
            ['name' => 'Vice-Recteur chargé de la Coopération', 'created_at' => now(), 'updated_at' => now()],
        ]);
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('services');
    }
};
