<reponame>arthurcadren/Projet-gestion-des-infrastructures-de-la-faculte-des-sciences<filename>database/migrations/2023_01_11_143928_create_administrateurs_table.php<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdministrateursTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('administrateurs', function (Blueprint $table) {
            //$table->id();
            $table->timestamps();
            $table->integer('idAdmin')->primary();
            $table->string('nomAdmin');
            $table->string('prenomAdmin');
            
            $table->integer('idEnseignant');
            $table->foreign('idEnseignant')->references('idEnseignant')->on('enseignants');
        });
    }

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