<?php

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

class CreateTableBanque extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('Banque', function(Blueprint $table) {
			$table->increments('id_Banque');
			$table->string('label',100);
			$table->text('situation_Clinique');
            $table->text('instruction_Etudiant');
            $table->integer('id_Domaine')->unsigned();
            $table->foreign('id_Domaine')->references('id_Domaine')->on('Domaine')
                        ->onDelete('cascade')
                        ->onUpdate('cascade');
             $table->integer('id_Critere')->unsigned();
            $table->foreign('id_Critere')->references('id_Critere')->on('Critere')
                        ->onDelete('cascade')
                        ->onUpdate('cascade');
             $table->integer('id_Systeme')->unsigned();
            $table->foreign('id_Systeme')->references('id_Systeme')->on('Systeme')
                        ->onDelete('cascade')
                        ->onUpdate('cascade');
             $table->integer('id_Contexte')->unsigned();
            $table->foreign('id_Contexte')->references('id_Contexte')->on('Contexte')
                        ->onDelete('cascade')
                        ->onUpdate('cascade');
           



		});
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('Banque', function(Blueprint $table) {
            $table->dropForeign('Banque_id_Domaine_foreign');
            $table->dropForeign('Banque_id_Critere_foreign');
            $table->dropForeign('Banque_id_Systeme_foreign');
            $table->dropForeign('Banque_id_Contexte_foreign');
            
          
        });
        Schema::drop('Banque');
    }
}
