From 2f9a34f716957451b80dc2421e1794a264dba9d4 Mon Sep 17 00:00:00 2001 From: davide.cucurnia@vola.it <davide.cucurnia@vola.it> Date: Mon, 05 Feb 2024 15:35:39 +0100 Subject: [PATCH] migration --- app/Models/Products.php | 2 app/Models/Msisdn.php | 5 ++ database/migrations/2023_05_02_170505_create_fakesso_vodafoneusers.php | 36 ++++++++++++++++++ database/migrations/2023_05_02_170505_create_fakesso_msisdn.php | 26 +++++++++++++ dev.env | 2 database/migrations/2023_05_02_170505_create_fakesso_products.php | 24 ++++++++++++ 6 files changed, 93 insertions(+), 2 deletions(-) diff --git a/app/Models/Msisdn.php b/app/Models/Msisdn.php index 5f3f0e8..f8be2cf 100644 --- a/app/Models/Msisdn.php +++ b/app/Models/Msisdn.php @@ -28,4 +28,9 @@ return $this->belongsTo('App\Models\VodafoneUser', 'VodafoneUser', 'id'); } + public function products() + { + return $this->hasMany('App\Models\Products','LinkedMSISDN', 'id'); + } + } diff --git a/app/Models/Products.php b/app/Models/Products.php index 6dcba0c..d165958 100644 --- a/app/Models/Products.php +++ b/app/Models/Products.php @@ -17,8 +17,8 @@ 'LinkedMSISDN', 'tmCode', 'OMProductId', + 'name', 'description', - 'activationDate' ]; public function msisdn() diff --git a/database/migrations/2023_05_02_170505_create_fakesso_msisdn.php b/database/migrations/2023_05_02_170505_create_fakesso_msisdn.php new file mode 100644 index 0000000..9491a86 --- /dev/null +++ b/database/migrations/2023_05_02_170505_create_fakesso_msisdn.php @@ -0,0 +1,26 @@ +<?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('fakesso_msisdn', function (Blueprint $table) { + $table->increments('id')->comment('Identificatore univoco msisdn'); + $table->bigInteger('VodafoneUser')->unsigned()->comment('Vodafone User di appartenenza'); + $table->string('MSISDN', 255)->nullable(); + $table->string('CardType', 255)->nullable(); + $table->string('IdPiano', 255)->nullable(); + $table->string('VodafoneOne', 255)->nullable(); + $table->string('TopClub', 255)->nullable(); + $table->string('SenioriryCluster', 255)->nullable(); + }); + } + + public function down() + { + Schema::dropIfExists('fakesso_msisdn'); + } +}; diff --git a/database/migrations/2023_05_02_170505_create_fakesso_products.php b/database/migrations/2023_05_02_170505_create_fakesso_products.php new file mode 100644 index 0000000..787446e --- /dev/null +++ b/database/migrations/2023_05_02_170505_create_fakesso_products.php @@ -0,0 +1,24 @@ +<?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('fakesso_products', function (Blueprint $table) { + $table->increments('id')->comment('Identificatore univoco profilo'); + $table->bigInteger('LinkedMSISDN')->unsigned()->comment('MSISDN di appartenenza'); + $table->string('tmCode', 255)->nullable(); + $table->string('OMProductId', 255)->nullable(); + $table->string('Name', 255)->nullable(); + $table->string('Description', 255)->nullable(); + }); + } + + public function down() + { + Schema::dropIfExists('fakesso_products'); + } +}; diff --git a/database/migrations/2023_05_02_170505_create_fakesso_vodafoneusers.php b/database/migrations/2023_05_02_170505_create_fakesso_vodafoneusers.php new file mode 100644 index 0000000..03d9c64 --- /dev/null +++ b/database/migrations/2023_05_02_170505_create_fakesso_vodafoneusers.php @@ -0,0 +1,36 @@ +<?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('fakesso_vodafoneusers', function (Blueprint $table) { + $table->increments('id')->comment('Identificatore univoco profilo'); + $table->string('Name', 255)->nullable(); + $table->string('Surname', 255)->nullable(); + $table->string('EmailAddress', 255)->nullable(); + $table->string('ProfileIdentifier', 255)->nullable(); + $table->string('FiscalCode', 255)->nullable(); + $table->string('Type_ID', 255)->nullable(); + $table->string('Custcode', 255)->nullable(); + $table->string('EmailCSA', 255)->nullable(); + $table->string('PIN_CSA', 255)->nullable(); + $table->string('ID_CSA', 255)->nullable(); + $table->string('Sex', 255)->nullable(); + $table->string('BirthProvinceName', 255)->nullable(); + $table->string('BirthPlace', 255)->nullable(); + $table->string('HomeProvinceName', 255)->nullable(); + $table->string('MicroBusiness', 255)->nullable(); + $table->string('HomePhone', 255)->nullable(); + $table->string('Address', 255)->nullable(); + }); + } + + public function down() + { + Schema::dropIfExists('fakesso_vodafoneusers'); + } +}; diff --git a/dev.env b/dev.env index ad9ea0e..0a859c2 100644 --- a/dev.env +++ b/dev.env @@ -13,7 +13,7 @@ DB_CONNECTION=mysql DB_HOST=host.docker.internal DB_PORT=3306 -DB_DATABASE=vola_mail_tool +DB_DATABASE=fakesso DB_USERNAME=root DB_PASSWORD= -- Gitblit v1.8.0