<?php

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

class CreateAllTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        DB::unprepared(file_get_contents(database_path('database.sql')));
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('fichiers_has_projets');
        Schema::dropIfExists('fichiers');
        Schema::dropIfExists('projets_unites_resp_soc_env');
        Schema::dropIfExists('projets_actions_resp_soc_env');
        Schema::dropIfExists('achats_complexes_projets');
        Schema::dropIfExists('alertes_envoyees');
        Schema::dropIfExists('etapes_projets');
        Schema::dropIfExists('gains_achats_complexes_projets');
        Schema::dropIfExists('montants_achats_complexes_projets');
        Schema::dropIfExists('projets_statuts');
        Schema::dropIfExists('membres_projets');
        Schema::dropIfExists('leviers_projets');
        Schema::dropIfExists('projets');
        Schema::dropIfExists('alertes');
        Schema::dropIfExists('imputations_budgetaires');
        Schema::dropIfExists('operateurs_mutualisations');
        Schema::dropIfExists('niveaux_mutualisations');
        Schema::dropIfExists('portefeuilles_acheteurs');
        Schema::dropIfExists('portefeuilles_responsables_achats');
        Schema::dropIfExists('users');
        Schema::dropIfExists('services');
        Schema::dropIfExists('directions');
        Schema::dropIfExists('leviers');
        Schema::dropIfExists('segments');
        Schema::dropIfExists('categories');
        Schema::dropIfExists('domaines');
        Schema::dropIfExists('familles');
        Schema::dropIfExists('unites');
        Schema::dropIfExists('actions');
        Schema::dropIfExists('thematiques');
        Schema::dropIfExists('paats');
        Schema::dropIfExists('structure');
        Schema::dropIfExists('statuts');
        Schema::dropIfExists('consolidations');
    }
}
