Created migrations from MCD with kitloong package

This commit is contained in:
Noah Lancien 2023-11-14 14:41:39 +01:00
parent 6aa5a3b301
commit 459bcce82c
15 changed files with 532 additions and 9 deletions

View file

@ -15,7 +15,7 @@
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"kitloong/laravel-migrations-generator": "^6.8",
"kitloong/laravel-migrations-generator": "^6.11",
"krlove/eloquent-model-generator": "dev-l10-compatibility",
"laravel-lang/common": "^4.0",
"laravel/pint": "^1.0",

16
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "8311b741696498db68ee35bdd2592280",
"content-hash": "9cb83aff80fee4b44d583fe7d848a32d",
"packages": [
{
"name": "brick/math",
@ -8092,16 +8092,16 @@
},
{
"name": "kitloong/laravel-migrations-generator",
"version": "v6.10.0",
"version": "v6.11.0",
"source": {
"type": "git",
"url": "https://github.com/kitloong/laravel-migrations-generator.git",
"reference": "116f50fab918b7f1363a40ebd954ce250f6aedcd"
"reference": "220b5f17fcb16610a3e9757d68c197319c0f7444"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/kitloong/laravel-migrations-generator/zipball/116f50fab918b7f1363a40ebd954ce250f6aedcd",
"reference": "116f50fab918b7f1363a40ebd954ce250f6aedcd",
"url": "https://api.github.com/repos/kitloong/laravel-migrations-generator/zipball/220b5f17fcb16610a3e9757d68c197319c0f7444",
"reference": "220b5f17fcb16610a3e9757d68c197319c0f7444",
"shasum": ""
},
"require": {
@ -8155,7 +8155,7 @@
],
"support": {
"issues": "https://github.com/kitloong/laravel-migrations-generator/issues",
"source": "https://github.com/kitloong/laravel-migrations-generator/tree/v6.10.0"
"source": "https://github.com/kitloong/laravel-migrations-generator/tree/v6.11.0"
},
"funding": [
{
@ -8163,7 +8163,7 @@
"type": "custom"
}
],
"time": "2023-03-26T07:37:00+00:00"
"time": "2023-10-10T13:55:26+00:00"
},
{
"name": "krlove/code-generator",
@ -11330,7 +11330,7 @@
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": "^8.1"
"php": "^8.2"
},
"platform-dev": [],
"plugin-api-version": "2.3.0"

View file

@ -0,0 +1,44 @@
<?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('historical_milestones', function (Blueprint $table) {
$table->id();
$table->string('title')->comment('Titre du jalon historique');
$table->string('text')->nullable()->comment('Texte du jalon historique');
$table->string('picture')->nullable()->comment('Path de l\'image du jalon historique');
$table->string('picture_alt')->nullable()
->comment('Attribut alt de l\'image du jalon historique. Obligatoire si l\'image est définie');
$table->string('picture_title')->nullable()
->comment('Attribut title de l\'image du jalon historique. Obligatoire si l\'image est définie');
$table->boolean('button_status')->comment('Le bouton est-il visible ?');
$table->string('button_label')->nullable()
->comment('Libellé du bouton. Obligatoire si le bouton est visible. Max: 35 caractères');
$table->string('button_url')->nullable()->comment('Url du bouton, obligatoire si le bouton est visible');
$table->boolean('button_new_tab')->comment('Le lien du bouton doit-il s\'ouvrir dans un nouvel onglet ?');
$table->unsignedSmallInteger('year')->comment('Année du jalon historique');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('historical_milestones');
}
};

View file

@ -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::create('job_videos', function (Blueprint $table) {
$table->id();
$table->string('title')->comment('Titre de la vidéo');
$table->string('place')->comment('Lieu de la vidéo');
$table->string('video_id', 11)->comment('Id de la vidéo youtube à afficher');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('job_videos');
}
};

View file

@ -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('logo_site', function (Blueprint $table) {
$table->unsignedBigInteger('logo_id');
$table->unsignedBigInteger('site_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('logo_site');
}
};

View file

@ -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::create('logos', function (Blueprint $table) {
$table->id();
$table->string('picture')->comment('Path de l\'image du logo');
$table->string('picture_alt')->comment('Attribut alt de l\'image du logo');
$table->string('picture_title')->comment('Attribut title de l\'image du logo');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('logos');
}
};

View file

@ -0,0 +1,47 @@
<?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 produit');
$table->string('seo_description')->comment('Utilisé pour la balise meta description de la page produit');
$table->string('title')->comment('Titre de l\'actualité (h1)');
$table->string('slug')->unique()->comment('Slug à partir de title');
$table->text('introduction')->comment('WYSIWYG - Introduction de l\'actualité');
$table->text('content')->nullable()->comment('WYSIWYG - Contenu de l\'actualité');
$table->string('linkedin_url')->nullable()->comment('Url du poste linkedin lié');
$table->string('thumbnail')->comment('Path de la vignette de l\'actualité');
$table->string('thumbnail_alt')->comment('Attribut alt de la vignette de l\'actualité');
$table->string('thumbnail_title')->comment('Attribut title de la vignette de l\'actualité');
$table->string('picture')->comment('Path de l\'image de l\'actualité');
$table->string('picture_alt')->comment('Attribut alt de l\'image de l\'actualité');
$table->string('picture_title')->comment('Attribut title de l\'image de l\'actualité');
$table->boolean('published')->comment('L\'actualité est-elle visible ?');
$table->timestamp('publish_at')->useCurrent()->comment('Date de publication de l\'actualité');
$table->timestamp('unpublish_at')->nullable()->comment('Date de dépublication de l\'actualité');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('news');
}
};

View file

@ -0,0 +1,44 @@
<?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('sections', function (Blueprint $table) {
$table->id();
$table->unsignedTinyInteger('section')->unique()
->comment('PageSectionEnum. Une seule section par valeur de l\'enum');
$table->string('h2_title')->comment('Titre h2 de la section');
$table->text('text')->comment('WYSIWYG - Contenu de la section.
- Optionnel pour les sections Nos missions, Notre Ambition, L\'équipe Volena, La vie chez Volena,
Nos Sites, Histoire, On se dévoile-Engagements
- Avancé optionnel pour Le Pôle Volena, Filière Locale, Vie de l\'entreprise, Alternance, Parité,
On se retruve, Ambition, Elever durablement, Mieux vivre, Respecter la Terre, Bien Nourrir,
On s\'engage-Engagements, On bouge ensemble-Vie de l\'entreprise et engagements, large gamme locale,
retrouvez en GMS, RHD, Export, Qualité
- Avancé obligatoire pour On étudie');
$table->json('additionnal_content')->comment('Minicrud content');
$table->unsignedBigInteger('page_id')->comment('Page associée');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sections');
}
};

View file

@ -0,0 +1,70 @@
<?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('sites', function (Blueprint $table) {
$table->id();
$table->string('seo_title')->comment('Utilisé pour la balise title de la page site');
$table->string('seo_description')->comment('Utilisé pour la balise meta description de la page site');
$table->string('name')->comment('Nom du site. Utilisé en H1. Min: 3, max: 100');
$table->string('slug')->unique()->comment('Slug à partir de name');
$table->string('description')->comment('Premier niveau de description du site');
$table->string('description_2')->nullable()->comment('Deuxième niveau de description du site');
$table->unsignedInteger('employees')->comment('Nombre d\'employés du site');
$table->json('pictos')->comment('Tableau de value d\'enum, entre 0 et n. SpeciesEnum');
$table->string('address')->comment('Adresse du site');
$table->string('phone_number')->comment('Numéro de téléphone du site');
$table->json('access_line')->comment('JSON avec 3 lignes (string) de texte décrivant l\'accès au site');
$table->string('director_name')->comment('Nom du directeur du site');
$table->text('director_speach')->comment('WYSIWYG - Le mot du directeur du site');
$table->string('employee_name')->nullable()->comment('Nom de l\'employé associé au speach');
$table->string('employee_function')->nullable()->comment('Fonction de l\'employé associé au speach');
$table->text('employee_speach')->nullable()->comment('WYSIWYG - Speach de l\'employé');
$table->text('highlights')->nullable()->comment('WYSIWYG - Texte points forts');
$table->double('latitude')->comment('Latitude du site en degrés');
$table->double('longitude')->comment('Longitude du site en degrés');
$table->string('logo')->comment('Path du logo du site');
$table->string('logo_alt')->comment('Attribut alt du logo du site');
$table->string('logo_title')->comment('Attribut title du logo du site');
$table->string('picture_1')->comment('Path de la première image du site');
$table->string('picture_1_alt')->comment('Attribut alt de la première image du site');
$table->string('picture_1_title')->comment('Attribut title de la première image du site');
$table->string('picture_2')->nullable()->comment('Path de la deuxième image du site');
$table->string('picture_2_alt')->nullable()
->comment('Attribut alt de la deuxième image du site. Obligatoire si picture_2 est définie');
$table->string('picture_2_title')->nullable()
->comment('Attribut title de la deuxième image du site. Obligatoire si picture_2 est définie');
$table->string('picture_3')->nullable()->comment('Path de la troisième image du site');
$table->string('picture_3_alt')->nullable()
->comment('Attribut alt de la troisième image du site. Obligatoire si picture_3 est définie');
$table->string('picture_3_title')->nullable()
->comment('Attribut title de la troisième image du site. Obligatoire si picture_3 est définie');
$table->string('map_picture')->comment('Path de l\'image de la carte');
$table->string('map_picture_alt')->comment('Attribut alt de l\'image de la carte');
$table->string('map_picture_title')->comment('Attribut title de l\'image de la carte');
$table->integer('order')->comment('Numéro permettant d\'ordonner les sites');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sites');
}
};

View file

@ -0,0 +1,45 @@
<?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('slides', function (Blueprint $table) {
$table->id();
$table->unsignedTinyInteger('slider')->unique()->comment('SliderTypeEnum');
$table->string('title')->nullable()
->comment('Titre de la slide. Optionnel si le slider est home, sinon obligatoire');
$table->string('content')->nullable()->comment('Descriptif de la slide. Texte multi-line');
$table->string('video_id', 11)->nullable()
->comment('Id de la video Youtube. Optionnel si le slider est home, sinon le champ reste vide.');
$table->boolean('button_status')->comment('Le bouton est-il visible ?');
$table->string('button_label')->nullable()
->comment('Libellé du bouton. Obligatoire si le bouton est visible. Max: 35 caractères');
$table->string('button_url')->nullable()->comment('Url du bouton, obligatoire si le bouton est visible');
$table->boolean('button_new_tab')->comment('Le lien du bouton doit-il s\'ouvrir dans un nouvel onglet ?');
$table->string('picture')->comment('Path de l\'image de la slide');
$table->string('picture_alt')->comment('Attribut alt de l\'image de la slide');
$table->string('picture_title')->comment('Attribut title de l\'image de la slide');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('slides');
}
};

View file

@ -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('strips', function (Blueprint $table) {
$table->id();
$table->unsignedTinyInteger('picto')->comment('PictoEnum');
$table->text('text')->comment('WYSIWYG minimal (gras + soulignement). Contenu du bandeau. Min 3, max 255');
$table->unsignedBigInteger('news_id')->nullable()->comment('News associée, optionnelle');
$table->boolean('published')->comment('Le bandeau est-il visible ?');
$table->timestamp('publish_at')->nullable()->comment('Date de publication du bandeau');
$table->timestamp('unpublish_at')->nullable()->comment('Date de dépublication du bandeau');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('strips');
}
};

View file

@ -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('name')->comment('Nom de la personne témoignant');
$table->string('job')->nullable()->comment('Fonction de la personne témoignant');
$table->text('content')->comment('WYSIWYG - Texte du témoignage');
$table->unsignedTinyInteger('type')->comment('TypeEnum');
$table->string('picture')->comment('Path de l\'image du témoignage');
$table->string('picture_alt')->comment('Attribut alt de l\'image du témoignage');
$table->string('picture_title')->comment('Attribut title de l\'image du témoignage');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('testimonials');
}
};

View file

@ -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('logo_site', function (Blueprint $table) {
$table->foreign(['logo_id'])->references(['id'])->on('sites')->onUpdate('NO ACTION')->onDelete('NO ACTION');
$table->foreign(['site_id'])->references(['id'])->on('logos')->onUpdate('NO ACTION')->onDelete('NO ACTION');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('logo_site', function (Blueprint $table) {
$table->dropForeign('logo_site_logo_id_foreign');
$table->dropForeign('logo_site_site_id_foreign');
});
}
};

View file

@ -0,0 +1,33 @@
<?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('sections', function (Blueprint $table) {
$table->foreign(['page_id'])->references(['id'])->on('static_pages')
->onUpdate('NO ACTION')->onDelete('NO ACTION');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('sections', function (Blueprint $table) {
$table->dropForeign('sections_page_id_foreign');
});
}
};

View file

@ -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('strips', function (Blueprint $table) {
$table->foreign(['news_id'])->references(['id'])->on('news')->onUpdate('NO ACTION')->onDelete('SET NULL');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('strips', function (Blueprint $table) {
$table->dropForeign('strips_news_id_foreign');
});
}
};