Gestions Projet: Migration
projets
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::create('projets', function (Blueprint $table) {
$table->id("idP");
$table->string("nomP");
$table->string("description");
$table->string("photoP");
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('projets');
}
};
developpeurs
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::create('developpeurs', function (Blueprint $table) {
$table->id("idD");
$table->string("nomD");
$table->string("prenomD");
$table->string("cv");
$table->string("photoD");
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('developpeurs');
}
};
taches
<?phpuse Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::create('taches', function (Blueprint $table) {
$table->id("idT");
$table->unsignedBigInteger("idP");
$table->foreign("idP")->references("idP")->on("projets")->onDelete("cascade");
$table->unsignedBigInteger("idD");
$table->foreign("idD")->references("idD")->on("developpeurs")->onDelete("cascade");
$table->float("dureeHeure");
$table->float("coutHeure");
$table->string("etat");
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('taches');
}
};