diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php.old similarity index 100% rename from database/migrations/2014_10_12_000000_create_users_table.php rename to database/migrations/2014_10_12_000000_create_users_table.php.old diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php.old similarity index 100% rename from database/migrations/2014_10_12_100000_create_password_resets_table.php rename to database/migrations/2014_10_12_100000_create_password_resets_table.php.old diff --git a/database/migrations/2018_09_27_074409_create_mouvements_table.php b/database/migrations/2018_09_27_074409_create_mouvements_table.php.old similarity index 100% rename from database/migrations/2018_09_27_074409_create_mouvements_table.php rename to database/migrations/2018_09_27_074409_create_mouvements_table.php.old diff --git a/database/migrations/2018_09_27_125349_add_soft_delete.php b/database/migrations/2018_09_27_125349_add_soft_delete.php.old similarity index 100% rename from database/migrations/2018_09_27_125349_add_soft_delete.php rename to database/migrations/2018_09_27_125349_add_soft_delete.php.old diff --git a/database/migrations/2019_01_02_110900_add_roles_to_users_table.php b/database/migrations/2019_01_02_110900_add_roles_to_users_table.php.old similarity index 100% rename from database/migrations/2019_01_02_110900_add_roles_to_users_table.php rename to database/migrations/2019_01_02_110900_add_roles_to_users_table.php.old diff --git a/database/migrations/2019_01_03_154432_create_site_user_pivot_table.php b/database/migrations/2019_01_03_154432_create_site_user_pivot_table.php.old similarity index 100% rename from database/migrations/2019_01_03_154432_create_site_user_pivot_table.php rename to database/migrations/2019_01_03_154432_create_site_user_pivot_table.php.old diff --git a/database/migrations/2019_01_07_103109_add_fields_to_sites_table.php b/database/migrations/2019_01_07_103109_add_fields_to_sites_table.php.old similarity index 100% rename from database/migrations/2019_01_07_103109_add_fields_to_sites_table.php rename to database/migrations/2019_01_07_103109_add_fields_to_sites_table.php.old diff --git a/database/migrations/2019_01_08_094821_add_diffusiondatefield_to_coupons_table.php b/database/migrations/2019_01_08_094821_add_diffusiondatefield_to_coupons_table.php.old similarity index 100% rename from database/migrations/2019_01_08_094821_add_diffusiondatefield_to_coupons_table.php rename to database/migrations/2019_01_08_094821_add_diffusiondatefield_to_coupons_table.php.old diff --git a/database/migrations/2019_01_09_132916_create_campagne_coupon_pivot_table.php b/database/migrations/2019_01_09_132916_create_campagne_coupon_pivot_table.php.old similarity index 100% rename from database/migrations/2019_01_09_132916_create_campagne_coupon_pivot_table.php rename to database/migrations/2019_01_09_132916_create_campagne_coupon_pivot_table.php.old diff --git a/database/migrations/2019_01_10_083318_add_countryfield_to_contact_table.php b/database/migrations/2019_01_10_083318_add_countryfield_to_contact_table.php.old similarity index 100% rename from database/migrations/2019_01_10_083318_add_countryfield_to_contact_table.php rename to database/migrations/2019_01_10_083318_add_countryfield_to_contact_table.php.old diff --git a/database/migrations/2019_02_14_083641_add_seuil_to_coupons.php b/database/migrations/2019_02_14_083641_add_seuil_to_coupons.php.old similarity index 100% rename from database/migrations/2019_02_14_083641_add_seuil_to_coupons.php rename to database/migrations/2019_02_14_083641_add_seuil_to_coupons.php.old diff --git a/database/migrations/2019_02_14_095700_add_name_to_notifications.php b/database/migrations/2019_02_14_095700_add_name_to_notifications.php.old similarity index 100% rename from database/migrations/2019_02_14_095700_add_name_to_notifications.php rename to database/migrations/2019_02_14_095700_add_name_to_notifications.php.old diff --git a/database/migrations/2019_02_14_111618_create_statistiques_table.php b/database/migrations/2019_02_14_111618_create_statistiques_table.php.old similarity index 100% rename from database/migrations/2019_02_14_111618_create_statistiques_table.php rename to database/migrations/2019_02_14_111618_create_statistiques_table.php.old diff --git a/database/migrations/2019_02_19_105641_create_logs_table.php b/database/migrations/2019_02_19_105641_create_logs_table.php.old similarity index 100% rename from database/migrations/2019_02_19_105641_create_logs_table.php rename to database/migrations/2019_02_19_105641_create_logs_table.php.old diff --git a/database/migrations/2019_02_27_133440_add_treatmentcenter_to_coupons.php b/database/migrations/2019_02_27_133440_add_treatmentcenter_to_coupons.php.old similarity index 100% rename from database/migrations/2019_02_27_133440_add_treatmentcenter_to_coupons.php rename to database/migrations/2019_02_27_133440_add_treatmentcenter_to_coupons.php.old diff --git a/database/migrations/2021_04_20_105237_create_customers_table.php b/database/migrations/2021_04_20_105237_create_customers_table.php.old similarity index 100% rename from database/migrations/2021_04_20_105237_create_customers_table.php rename to database/migrations/2021_04_20_105237_create_customers_table.php.old diff --git a/database/migrations/2021_10_10_165446_create_old_calendrier_table.php b/database/migrations/2021_10_10_165446_create_old_calendrier_table.php new file mode 100644 index 0000000..e51fa54 --- /dev/null +++ b/database/migrations/2021_10_10_165446_create_old_calendrier_table.php @@ -0,0 +1,37 @@ +truncate(); + Schema::create('calendrier', function (Blueprint $table) { + $table->id('calendrier_id'); + + $table->bigInteger('calendrier_couponId')->default(0); + + $table->timestamp('calendrier_startdate')->useCurrent(); + $table->timestamp('calendrier_enddate')->useCurrent()->useCurrentOnUpdate(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('calendrier'); + } +} diff --git a/database/migrations/2021_10_10_165625_create_old_campagne_table.php b/database/migrations/2021_10_10_165625_create_old_campagne_table.php new file mode 100644 index 0000000..3a5afee --- /dev/null +++ b/database/migrations/2021_10_10_165625_create_old_campagne_table.php @@ -0,0 +1,43 @@ +id('camp_id'); + + $table->string('camp_name', 500)->default(''); + $table->unsignedTinyInteger('camp_type')->default(0) + ->comment('0 = mur; 1 = panier; 2 = mur sous forme de panier'); + $table->smallInteger('camp_limitedPrinting')->default(0) + ->comment('Limite l\'impression des paniers à un BR à la fois'); + $table->smallInteger('camp_published')->default(1); + + $table->string('camp_siteId', 50); + + $table->timestamp('camp_createdate')->useCurrent(); + $table->timestamp('camp_updatedate')->useCurrent()->useCurrentOnUpdate(); + $table->timestamp('camp_deleted_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('campagne'); + } +} diff --git a/database/migrations/2021_10_10_165949_create_old_contact_table.php b/database/migrations/2021_10_10_165949_create_old_contact_table.php new file mode 100644 index 0000000..f8a2a43 --- /dev/null +++ b/database/migrations/2021_10_10_165949_create_old_contact_table.php @@ -0,0 +1,49 @@ +id('contact_id'); + + $table->string('contact_ref', 200)->default(''); // broken key + $table->string('contact_prenom', 200)->default(''); + $table->string('contact_nom', 200)->default(''); + $table->string('contact_email', 200)->default(''); // broken key + $table->string('contact_cp', 50)->default(''); + $table->string('contact_ville', 200)->default(''); + + $table->smallInteger('contact_country')->default(250); + $table->string('contact_hash', 50)->nullable(); + + $table->string('contact_siteId', 50); + + $table->timestamp('contact_createdate')->useCurrent(); + $table->timestamp('contact_updatedate')->useCurrent()->useCurrentOnUpdate(); + + // me demandez pas pourquoi iso prod (-_-") + $table->index(['contact_ref', 'contact_email'], 'contact_ref'); + $table->index(['contact_email', 'contact_ref'], 'contact_email'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('contact'); + } +} diff --git a/database/migrations/2021_10_10_174157_create_old_coupon_table.php b/database/migrations/2021_10_10_174157_create_old_coupon_table.php new file mode 100644 index 0000000..f115478 --- /dev/null +++ b/database/migrations/2021_10_10_174157_create_old_coupon_table.php @@ -0,0 +1,74 @@ +id('coupon_id'); + + $table->string('coupon_code', 50); + $table->string('coupon_gs1code', 500); + $table->string('coupon_name', 500); + $table->float('coupon_value', 0); + + $table->string('coupon_thumbnail1', 500); + $table->string('coupon_thumbnail2', 500); + $table->string('coupon_thumbnail3', 500); + $table->string('coupon_thumbnail4', 500); + $table->string('coupon_image', 500); + + $table->integer('coupon_enablelimitquantity')->default(0); + $table->integer('coupon_limitquantity')->default(1); + $table->integer('coupon_enablelimitperiod')->default(1); + $table->integer('coupon_limitperiod')->default(0); + $table->integer('coupon_validity')->default(30); + + $table->date('coupon_mindatediffusion')->nullable(); + $table->date('coupon_maxdatediffusion')->nullable(); + $table->date('coupon_maxdatevalidity')->nullable(); + + $table->unsignedTinyInteger('coupon_norme')->default(0) + ->comment('0 = par défaut; 1 = Benelux'); + $table->integer('coupon_published')->default(1); + + $table->string('coupon_decoration_image', 500)->nullable(); + $table->string('coupon_logo_image', 500)->nullable(); + $table->string('coupon_validity_text', 500)->nullable(); + $table->string('coupon_rcs', 500)->nullable(); + $table->string('coupon_legal_mentions', 1000)->nullable(); + + $table->tinyInteger('coupon_legal_mentions_splitted')->default(0); + + $table->string('coupon_site_contact', 500)->nullable(); + + $table->unsignedInteger('coupon_seuil_alert')->default(100); + $table->integer('coupon_treatment_center')->default(0); + + $table->bigInteger('coupon_siteId'); + + $table->timestamp('coupon_createdate')->useCurrent(); + $table->timestamp('coupon_updatedate')->useCurrent()->useCurrentOnUpdate(); + $table->timestamp('coupon_deleted_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('coupon'); + } +} diff --git a/database/migrations/2021_10_10_175642_create_old_campagne_coupon_table.php b/database/migrations/2021_10_10_175642_create_old_campagne_coupon_table.php new file mode 100644 index 0000000..f57d843 --- /dev/null +++ b/database/migrations/2021_10_10_175642_create_old_campagne_coupon_table.php @@ -0,0 +1,34 @@ +foreignId('campagne_id'); + $table->foreign('campagne_id')->references('camp_id')->on('campagne')->cascadeOnDelete(); + $table->foreignId('coup_id'); + $table->foreign('coup_id')->references('coupon_id')->on('coupon')->cascadeOnDelete(); + $table->unique(['campagne_id', 'coup_id']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('campagne_coupon'); + } +} diff --git a/database/migrations/2021_10_10_180351_create_old_customers_table.php b/database/migrations/2021_10_10_180351_create_old_customers_table.php new file mode 100644 index 0000000..830f596 --- /dev/null +++ b/database/migrations/2021_10_10_180351_create_old_customers_table.php @@ -0,0 +1,36 @@ +id(); // TODO remove this in the future + + $table->string('hashcode', 36)->unique(); + $table->string('email', 255)->unique(); + $table->integer('country')->default(250); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('customers'); + } +} diff --git a/database/migrations/2021_10_10_180358_create_old_logs_table.php b/database/migrations/2021_10_10_180358_create_old_logs_table.php new file mode 100644 index 0000000..c297cb7 --- /dev/null +++ b/database/migrations/2021_10_10_180358_create_old_logs_table.php @@ -0,0 +1,42 @@ +id(); + + $table->tinyInteger('log_action'); + $table->string('log_source', 255); + + $table->text('log_params')->nullable(); + $table->string('log_statut'); + $table->text('log_message'); + + $table->string('log_refsite', 255)->nullable(); + $table->bigInteger('log_contactId')->nullable(); + + $table->timestamp('created_at')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('logs'); + } +} diff --git a/database/migrations/2021_10_10_181920_create_old_mouvement_table.php b/database/migrations/2021_10_10_181920_create_old_mouvement_table.php new file mode 100644 index 0000000..3e76af4 --- /dev/null +++ b/database/migrations/2021_10_10_181920_create_old_mouvement_table.php @@ -0,0 +1,36 @@ +id('mouvement_id'); + + $table->unsignedInteger('mouvement_couponId'); + $table->integer('mouvement_nombre'); + $table->string('mouvement_commentaire')->nullable(); + + $table->timestamp('mouvement_created_at')->useCurrent()->useCurrentOnUpdate(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('mouvement'); + } +} diff --git a/database/migrations/2021_10_10_181928_create_old_mur_table.php b/database/migrations/2021_10_10_181928_create_old_mur_table.php new file mode 100644 index 0000000..687fc3d --- /dev/null +++ b/database/migrations/2021_10_10_181928_create_old_mur_table.php @@ -0,0 +1,43 @@ +id('mur_id'); + + $table->integer('mur_campId'); // broken foreign key + $table->integer('mur_contactId'); // broken foreign key + $table->integer('mur_couponId'); // broken foreign key + + $table->boolean('mur_deleted')->default(false); + + $table->timestamp('mur_createdate')->useCurrent(); + + // me demandez pas pourquoi iso prod (-_-") + $table->index(['mur_campId'], 'FK_mur_campagne'); + $table->index(['mur_contactId'], 'mur_contactId'); + $table->index(['mur_couponId'], 'mur_couponId'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('mur'); + } +} diff --git a/database/migrations/2021_10_10_181935_create_old_notification_table.php b/database/migrations/2021_10_10_181935_create_old_notification_table.php new file mode 100644 index 0000000..6589caa --- /dev/null +++ b/database/migrations/2021_10_10_181935_create_old_notification_table.php @@ -0,0 +1,35 @@ +id('notif_id'); + + $table->string('notif_email')->default(''); + $table->string('notif_name')->nullable(); + + $table->integer('notif_campId'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('old_notification'); + } +} diff --git a/database/migrations/2021_10_10_182935_create_old_panier_table.php b/database/migrations/2021_10_10_182935_create_old_panier_table.php new file mode 100644 index 0000000..52ff5ad --- /dev/null +++ b/database/migrations/2021_10_10_182935_create_old_panier_table.php @@ -0,0 +1,41 @@ +id('panier_id'); + + $table->string('panier_ref', 100)->default(''); + + $table->boolean('panier_pending') + ->comment('1 = en cours; 0 = terminé'); + + $table->integer('panier_campId'); + $table->integer('panier_contactId'); + + $table->timestamp('panier_createdate')->useCurrent(); + $table->timestamp('panier_updatedate')->useCurrent()->useCurrentOnUpdate(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('old_panier'); + } +} diff --git a/database/migrations/2021_10_10_182947_create_old_panier_content_table.php b/database/migrations/2021_10_10_182947_create_old_panier_content_table.php new file mode 100644 index 0000000..58b4bbf --- /dev/null +++ b/database/migrations/2021_10_10_182947_create_old_panier_content_table.php @@ -0,0 +1,36 @@ +id('panier_content_id'); + + $table->integer('panier_content_quantity')->default(0); + $table->integer('panier_content_printed')->default(0); + + $table->integer('panier_content_panierId')->default(0); + $table->integer('panier_content_couponId'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('panier_content'); + } +} diff --git a/database/migrations/2021_10_10_183008_create_old_password_resets_table.php b/database/migrations/2021_10_10_183008_create_old_password_resets_table.php new file mode 100644 index 0000000..47dc9d4 --- /dev/null +++ b/database/migrations/2021_10_10_183008_create_old_password_resets_table.php @@ -0,0 +1,33 @@ +string('email')->index('password_resets_email_index'); + $table->string('token'); + $table->timestamp('created_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('password_resets'); + } +} diff --git a/database/migrations/2021_10_10_183020_create_old_printed_walls_table.php b/database/migrations/2021_10_10_183020_create_old_printed_walls_table.php new file mode 100644 index 0000000..374b1f5 --- /dev/null +++ b/database/migrations/2021_10_10_183020_create_old_printed_walls_table.php @@ -0,0 +1,39 @@ +bigInteger('camp_id'); + $table->bigInteger('coupon_id'); + $table->bigInteger('customer_id'); + + // me demandez pas pourquoi iso prod (-_-") + $table->index('camp_id', 'FK_printed_wall_campagne'); + $table->index('coupon_id', 'FK_printed_wall_coupon'); + $table->index('customer_id', 'FK_printed_wall_customers'); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('printed_walls'); + } +} diff --git a/database/migrations/2021_10_10_184714_create_old_site_table.php b/database/migrations/2021_10_10_184714_create_old_site_table.php new file mode 100644 index 0000000..690ceaa --- /dev/null +++ b/database/migrations/2021_10_10_184714_create_old_site_table.php @@ -0,0 +1,40 @@ +id(); + + $table->string('site_nom', 200)->default(''); + $table->string('site_logo', 500)->default(''); + $table->string('site_contact', 500)->default(''); + $table->string('site_rcs', 100)->nullable(); + $table->string('site_libelle', 200)->nullable(); + $table->string('crm_token')->nullable(); + $table->string('crm_password')->nullable(); + + $table->string('site_id', 50); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('site'); + } +} diff --git a/database/migrations/2021_10_10_184750_create_old_statistiques_table.php b/database/migrations/2021_10_10_184750_create_old_statistiques_table.php new file mode 100644 index 0000000..042793b --- /dev/null +++ b/database/migrations/2021_10_10_184750_create_old_statistiques_table.php @@ -0,0 +1,37 @@ +id(); + + $table->integer('stat_couponPrinted'); + + $table->integer('stat_campId'); + $table->integer('stat_couponId'); + + $table->timestamp('created_at')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('statistiques'); + } +} diff --git a/database/migrations/2021_10_10_184757_create_old_users_table.php b/database/migrations/2021_10_10_184757_create_old_users_table.php new file mode 100644 index 0000000..4255343 --- /dev/null +++ b/database/migrations/2021_10_10_184757_create_old_users_table.php @@ -0,0 +1,40 @@ +id(); + + $table->string('name'); + $table->string('email'); + $table->timestamp('email_verified_at')->nullable(); + $table->string('password'); + $table->rememberToken(); + + $table->string('roles', 50); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('users'); + } +} diff --git a/database/migrations/2021_10_10_184842_create_old_site_user_table.php b/database/migrations/2021_10_10_184842_create_old_site_user_table.php new file mode 100644 index 0000000..ca38160 --- /dev/null +++ b/database/migrations/2021_10_10_184842_create_old_site_user_table.php @@ -0,0 +1,34 @@ +foreignId('user_id'); + $table->foreign('user_id')->references('id')->on('users')->cascadeOnDelete(); + $table->foreignId('site_id'); + $table->foreign('site_id')->references('id')->on('site')->cascadeOnDelete(); + $table->unique(['user_id', 'site_id']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('site_user'); + } +}