Issue 2 migrations Close #2
This commit is contained in:
parent
f47d3f6fd1
commit
f8eb6f481e
17 changed files with 659 additions and 0 deletions
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('commitments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->comment('Titre de l\'engagement');
|
||||
$table->string('picture')->comment('Path de l\'image de l\'engagement (185px * 185px)');
|
||||
$table->string('picture_alt')->comment('Attribut alt de l\'image de l\'engagement');
|
||||
$table->string('picture_title')->comment('Attribut title de l\'image de l\'engagement');
|
||||
$table->boolean('published')->comment('L\'engagement est-il visible ?');
|
||||
$table->unsignedInteger('order')->comment('Numéro permettant d\'ordonner les engagements');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('commitments');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('convictionpages', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->float('key_feed')->comment('Chiffre clé \'bien nourrir\'');
|
||||
$table->float('key_earth_1')->comment('Chiffre clé \'respecter la terre\' 1');
|
||||
$table->float('key_earth_2')->comment('Chiffre clé \'respecter la terre\' 2');
|
||||
$table->float('key_together_1')->comment('Chiffre clé \'vivre ensemble\' 1');
|
||||
$table->float('key_together_2')->comment('Chiffre clé \'vivre ensemble\' 2');
|
||||
$table->float('key_together_3')->comment('Chiffre clé \'vivre ensemble\' 3');
|
||||
$table->float('key_together_4')->comment('Chiffre clé \'vivre ensemble\' 4');
|
||||
$table->float('key_territory')->comment('Chiffre clé \'intégrer son territoire\'');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('convictionpages');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('explorerpage_commitment', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('explorerpage_id');
|
||||
$table->unsignedBigInteger('commitment_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('explorerpage_commitment');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('explorerpages', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('picture_1')->comment('Path de la première illustration');
|
||||
$table->string('picture_1_alt')->comment('Attribut alt de l\'image 1');
|
||||
$table->string('picture_1_title')->comment('Attribut title de l\'image 1');
|
||||
$table->string('picture_2')->comment('Path de la deuxième illustration');
|
||||
$table->string('picture_2_alt')->comment('Attribut alt de l\'image 2');
|
||||
$table->string('picture_2_title')->comment('Attribut title de l\'image 2');
|
||||
$table->string('picture_3')->comment('Path de la troisième illustration');
|
||||
$table->string('picture_3_alt')->comment('Attribut alt de l\'image 3');
|
||||
$table->string('picture_3_title')->comment('Attribut title de l\'image 3');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('explorerpages');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('homepages', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title_part1')->comment('Première partie du titre h1 de l\'accueil');
|
||||
$table->string('title_part2')->comment('Deuxième partie du titre h1 de l\'accueil');
|
||||
$table->string('title_part3')->comment('Dernière partie du titre h1 de l\'accueil');
|
||||
$table->string('picture')->comment('Path de l\'image de la page d\'accueil (640px * 390px)');
|
||||
$table->string('picture_alt')->comment('Attribut alt de l\'image de la page d\'accueil');
|
||||
$table->string('picture_title')->comment('Attribut title de l\'image de la page d\'accueil');
|
||||
$table->string('presentation_title')->comment('Titre de la partie \'présentation\' de la page d\'accueil');
|
||||
$table->text('presentation_content')
|
||||
->comment('WYSIWYG - Contenu de la partie présentation de la page d\'accueil');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('homepages');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('joinuspages', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('video_url')->comment('Lien de la vidéo youtube à afficher');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('joinuspages');
|
||||
}
|
||||
};
|
||||
52
database/migrations/2023_10_18_180112_create_news_table.php
Normal file
52
database/migrations/2023_10_18_180112_create_news_table.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('news', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('seo_title')->comment('Utilisé pour la balise title de la page');
|
||||
$table->string('seo_description')->comment('Utilisé pour la balise meta description de la page');
|
||||
$table->string('title')->comment('Balise h1 de la page');
|
||||
$table->string('slug')->unique()->comment('Slug à partir de title');
|
||||
$table->unsignedTinyInteger('category')
|
||||
->comment('Catégorie de la news (enum \\App\\Enums\\News\\CategoryEnum)');
|
||||
$table->string('picture_thumbnail')->nullable()
|
||||
->comment('Path de la vignette de l\'actualité (265px * 354px)');
|
||||
$table->string('picture_thumbnail_alt')->nullable()
|
||||
->comment('Attribut alt de la vignette de l\'actualité');
|
||||
$table->string('picture_thumbnail_title')->nullable()
|
||||
->comment('Attribut title de la vignette de l\'actualité');
|
||||
$table->string('picture')->comment('Path de l\'illustration de l\'actualité (1002px * 565 px)');
|
||||
$table->string('picture_alt')->comment('Attribut alt de l\'illustration de l\'actualité');
|
||||
$table->string('picture_title')->comment('Attribut title de l\'illustration de l\'actualité');
|
||||
$table->string('subtitle')->comment('Sous-titre de l\'actualité. Chaine vide possible');
|
||||
$table->text('content')->comment('WYSIWYG - Texte de l\'actualité');
|
||||
$table->boolean('published')->comment('L\'actualité est-elle visible ?');
|
||||
$table->timestamp('publish_at')->nullable()->comment('Date de publication de l\'actualité');
|
||||
$table->timestamp('unpublish_at')->nullable()->comment('Date de dépublication de l\'actualité');
|
||||
$table->unsignedInteger('order')->comment('Numéro permettant d\'ordonner les actualités');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('news');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('product_commitment', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('product_id');
|
||||
$table->unsignedBigInteger('commitment_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('product_commitment');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('products', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('seo_title')->comment('Utilisé pour la balise title de la page produit');
|
||||
$table->string('seo_description')->comment('Utilisé pour la balise meta description de la page produit');
|
||||
$table->string('title')->comment('Titre du produit');
|
||||
$table->string('slug')->unique()->comment('Slug à partir de title');
|
||||
$table->string('subtitle')->comment('Sous-titre du produit');
|
||||
$table->string('picture_thumbnail')->comment('Path de la vignette du produit (332px * 252px)');
|
||||
$table->string('picture_thumbnail_alt')->comment('Attribut alt de la vignette du produit');
|
||||
$table->string('picture_thumbnail_title')->comment('Attribut title de la vignette du produit');
|
||||
$table->string('picture_ambiance')->comment('Path du visuel d\'ambiance du produit (774px * 515px)');
|
||||
$table->string('picture_ambiance_alt')->comment('Attribut alt du visuel d\'ambiance');
|
||||
$table->string('picture_ambiance_title')->comment('Attribut title du visuel d\'ambiance');
|
||||
$table->string('picture_packshot')->comment('Path de l\'image du packshot (327px * 252px)');
|
||||
$table->string('picture_packshot_alt')->comment('Attribut alt de l\'image du packshot');
|
||||
$table->string('picture_packshot_title')->comment('Attribut title de l\'image du packshot');
|
||||
$table->text('description')->comment('WYSIWYG - Description du produit');
|
||||
$table->unsignedTinyInteger('cooking_mode')
|
||||
->comment('Mode de cuisson (enum \\App\\Enums\\Products\\CookingModeEnum)');
|
||||
$table->text('cooking_advice')->comment('WYSIWYG - Conseil de réchauffage');
|
||||
$table->text('ingredients')->comment('WYSIWYG - Ingrédients qui composent le produit');
|
||||
$table->json('nutrionnal_values')->comment('JSON des valeurs nutritionnelles pour 100g');
|
||||
$table->boolean('published')->comment('Le produit est-il visible ?');
|
||||
$table->unsignedInteger('order')->comment('Numéro permettant d\'ordonner les produits');
|
||||
$table->unsignedBigInteger('range_id');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('products');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('ranges', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('seo_title')->comment('Utilisé pour la balise title de la page');
|
||||
$table->string('seo_description')->comment('Utilisé pour la balise méta description de la page');
|
||||
$table->string('title')->comment('Balise h1 de la page');
|
||||
$table->string('slug')->unique()->comment('Slug à partir de title');
|
||||
$table->string('subtitle')->comment('Sous-titre de la gamme');
|
||||
$table->string('tagline')->comment('Titre d\'accroche de la gamme');
|
||||
$table->text('description')->comment('WYSIWYG - Description de la gamme');
|
||||
$table->string('picture')->comment('Path de l\'image de la gamme (466px * 440px)');
|
||||
$table->string('picture_alt')->comment('Attribut alt pour l\'image picture');
|
||||
$table->string('picture_title')->comment('Attribut title pour l\'image picture');
|
||||
$table->string('picture_productsheet')
|
||||
->comment('Path de l\'image à afficher sur les fiches produits de cette gamme (332px * 442px)');
|
||||
$table->string('picture_productsheet_alt')
|
||||
->comment('Attribut alt de l\'image à afficher sur les fiches produits');
|
||||
$table->string('picture_productsheet_title')
|
||||
->comment('Attribut title de l\'image à afficher sur les fiches produits');
|
||||
$table->string('picture_thumbnail')->comment('Path de la vignette de la gamme (246px * 337px)');
|
||||
$table->string('picture_thumbnail_alt')->comment('Attribut alt de la vignette de la gamme ');
|
||||
$table->string('picture_thumbnail_title')->comment('Attribut title de la vignette de la gamme ');
|
||||
$table->unsignedInteger('order')->comment('Numéro permettant d\'ordonner les gammes');
|
||||
$table->boolean('published')->comment('La gamme est-elle publiée ?');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('ranges');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('seasonal_section', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->comment('Titre de la section saisonnière');
|
||||
$table->text('text')->comment('WYSIWYG - Texte de la section saisonnière');
|
||||
$table->string('picture')->comment('Path de l\'image de la section saisonnière (362px * 542px)');
|
||||
$table->string('picture_alt')->comment('Attribut alt de l\'image');
|
||||
$table->string('picture_title')->comment('Attribut title de l\'image');
|
||||
$table->unsignedTinyInteger('background')
|
||||
->comment('Fond de la section saisonnière (enum \\App\\Enums\\SeasonalSection\\BackgroundEnum)');
|
||||
$table->boolean('published')->comment('La section est-elle visible ?');
|
||||
$table->timestamp('publish_at')->nullable()->comment('Date de publication de la section');
|
||||
$table->timestamp('unpublish_at')->nullable()->comment('Date de dépublication de la section');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('seasonal_section');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('stamps', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('picture')->comment('Path de l\'image du tampon (120px * 120px)');
|
||||
$table->string('picture_alt')->comment('Attribut alt de l\'image du tampon');
|
||||
$table->string('picture_title')->comment('Attribut title de l\'image du tampon');
|
||||
$table->boolean('published')->comment('Le tampon est-il visible ?');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('stamps');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('static_pages', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedTinyInteger('type')->unique()
|
||||
->comment('Type de la page (enum \\App\\Enums\\StaticPage\\PageTypeEnum)');
|
||||
$table->string('seo_title')->comment('Utilisé pour la balise title de la page');
|
||||
$table->string('seo_description')->comment('Utilisé pour la balise meta description de la page');
|
||||
$table->string('title')->comment('Utilisé pour la balise h1 de la page');
|
||||
$table->text('content')->comment('WYSIWYG - Contenu de la page. Peut être une chaîne vide selon le type');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('static_pages');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('testimonials', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('picture')->comment('Path de l\'illustration du témoignage (292px * 417px)');
|
||||
$table->string('picture_alt')->comment('Attribut alt de l\'illustration');
|
||||
$table->string('picture_title')->comment('Attribut title de l\'illustration');
|
||||
$table->string('description')->comment('Texte du témoignage');
|
||||
$table->string('job')->comment('Métier de la personne témoignant');
|
||||
$table->string('statut')->comment('Statut de la personne témoignant');
|
||||
$table->unsignedInteger('order')->comment('Numéro permettant d\'ordonner les témoignages');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('testimonials');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('explorerpage_commitment', function (Blueprint $table) {
|
||||
$table->foreign(['explorerpage_id'])->references(['id'])->on('explorerpages');
|
||||
$table->foreign(['commitment_id'])->references(['id'])->on('commitments');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('explorerpage_commitment', function (Blueprint $table) {
|
||||
$table->dropForeign('explorerpage_commitment_explorerpage_id_foreign');
|
||||
$table->dropForeign('explorerpage_commitment_commitment_id_foreign');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('product_commitment', function (Blueprint $table) {
|
||||
$table->foreign(['product_id'])->references(['id'])->on('products');
|
||||
$table->foreign(['commitment_id'])->references(['id'])->on('commitments');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('product_commitment', function (Blueprint $table) {
|
||||
$table->dropForeign('product_commitment_product_id_foreign');
|
||||
$table->dropForeign('product_commitment_commitment_id_foreign');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->foreign(['range_id'])->references(['id'])->on('ranges');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->dropForeign('products_range_id_foreign');
|
||||
});
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Reference in a new issue