From 8b3c3f31bea4881273e447ec0aefca2602e9ebd3 Mon Sep 17 00:00:00 2001 From: Olivier Legat Date: Sat, 12 Mar 2022 12:04:40 +0100 Subject: [PATCH] add nom to xml_incos null lst_allergenes --- app/Jobs/XmlIncoReader.php | 3 +- app/Models/XmlInco.php | 1 + ...3_12_115802_add_nom_to_xml_incos_table.php | 32 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2022_03_12_115802_add_nom_to_xml_incos_table.php diff --git a/app/Jobs/XmlIncoReader.php b/app/Jobs/XmlIncoReader.php index 3a2998e..60080cc 100644 --- a/app/Jobs/XmlIncoReader.php +++ b/app/Jobs/XmlIncoReader.php @@ -61,6 +61,7 @@ class XmlIncoReader extends XmlJobs 'INCO_COMPO' => 'inco_compo', // Consider this sub array + 'INCO_COMPO.NOM' => 'nom', 'INCO_COMPO.TAILLE_REF' => 'taille_ref', 'INCO_COMPO.VAL_ENERG_KJ_NUT' => 'val_energ_kj_nut', 'INCO_COMPO.VAL_ENERG_KJ_R' => 'val_energ_kj_r', //_R apports de la taille_ref @@ -168,7 +169,7 @@ class XmlIncoReader extends XmlJobs 'allegations', 'astuces', 'arg_vente', 'pds_moy_theo', - 'lib_conso', 'lst_ing', + 'lib_conso', 'lst_ing', 'lst_allergene', 'allegat_sante', 'allegat_nutrit', 'allegat_autre', 'inco_compo', 'inco_compo.nom', diff --git a/app/Models/XmlInco.php b/app/Models/XmlInco.php index f33346b..c7b33cb 100644 --- a/app/Models/XmlInco.php +++ b/app/Models/XmlInco.php @@ -16,6 +16,7 @@ class XmlInco extends Model protected $fillable = [ 'id', 'no_art', + 'nom', 'prod_saison', 'allegations', 'conseil_prepa', diff --git a/database/migrations/2022_03_12_115802_add_nom_to_xml_incos_table.php b/database/migrations/2022_03_12_115802_add_nom_to_xml_incos_table.php new file mode 100644 index 0000000..120e12c --- /dev/null +++ b/database/migrations/2022_03_12_115802_add_nom_to_xml_incos_table.php @@ -0,0 +1,32 @@ +string('nom')->nullable()->after('id'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('xml_incos', function (Blueprint $table) { + $table->dropColumn('nom'); + }); + } +}