davide.cucurnia@vola.it
2024-07-02 b55a38378482bfe6a43315f5b665f608a7651880
sistemazione migration per modifica campi di appartenenza e foreign keys
1 files renamed
5 files modified
23 ■■■■■ changed files
app/Models/Msisdn.php 2 ●●● patch | view | raw | blame | history
app/Models/Products.php 2 ●●● patch | view | raw | blame | history
database/migrations/2023_05_02_170505_create_fakesso_products.php 4 ●●●● patch | view | raw | blame | history
database/migrations/2023_05_02_170506_create_fakesso_vodafoneusers.php 4 ●●●● patch | view | raw | blame | history
database/migrations/2023_05_02_170537_create_fakesso_msisdn.php 2 ●●●●● patch | view | raw | blame | history
database/migrations/2024_06_27_105025_create_pivot_msisdn_products.php 9 ●●●● patch | view | raw | blame | history
app/Models/Msisdn.php
@@ -30,7 +30,7 @@
    public function products()
    {
        return $this->hasMany('App\Models\Products','LinkedMSISDN', 'id');
        return $this->belongsToMany('App\Models\Products', 'pivot_msisdn_products', 'idProducts', 'idMsisdn');
    }
}
app/Models/Products.php
@@ -23,7 +23,7 @@
    public function msisdn()
    {
        return $this->belongsTo('App\Models\Msisdn', 'LinkedMSISDN', 'id');
        return $this->belongsToMany(Msisdn::class, 'pivot_msisdn_products', 'idProducts', 'idMsisdn');
    }
}
database/migrations/2023_05_02_170505_create_fakesso_products.php
@@ -9,8 +9,8 @@
    {
        Schema::create('fakesso_products', function (Blueprint $table) {
            $table->increments('id')->comment('Identificatore univoco profilo');
            $table->integer('LinkedMSISDN')->unsigned()->comment('MSISDN di appartenenza');
            $table->foreign('LinkedMSISDN')->references('id')->on('fakesso_msisdn');
            //$table->integer('LinkedMSISDN')->unsigned()->comment('MSISDN di appartenenza');
            //$table->foreign('LinkedMSISDN')->references('id')->on('fakesso_msisdn');
            $table->string('tmCode', 255)->nullable();
            $table->string('OMProductId', 255)->nullable();
            $table->string('Name', 255)->nullable();
database/migrations/2023_05_02_170506_create_fakesso_vodafoneusers.php
@@ -9,8 +9,8 @@
    {
        Schema::create('fakesso_vodafoneusers', function (Blueprint $table) {
            $table->increments('id')->comment('Identificatore univoco profilo');
            $table->integer('LinkedMSISDN')->unsigned()->comment('identificatore MSISDN');
            $table->foreign('LinkedMSISDN')->references('id')->on('fakesso_msisdn');
            //$table->integer('LinkedMSISDN')->unsigned()->comment('identificatore MSISDN');
            //$table->foreign('LinkedMSISDN')->references('id')->on('fakesso_msisdn');
            $table->string('Name', 255)->nullable();
            $table->string('Surname', 255)->nullable();
            $table->string('EmailAddress', 255)->nullable();
database/migrations/2023_05_02_170537_create_fakesso_msisdn.php
File was renamed from database/migrations/2023_05_02_170504_create_fakesso_msisdn.php
@@ -9,6 +9,8 @@
    {
        Schema::create('fakesso_msisdn', function (Blueprint $table) {
            $table->increments('id')->comment('Identificatore univoco msisdn');
            $table->integer('LinkedUser')->unsigned()->comment('vodafoneuser di appartenenza');
            $table->foreign('LinkedUser')->references('id')->on('fakesso_vodafoneusers');
            $table->string('MSISDN', 255)->nullable();
            $table->string('CardType', 255)->nullable();
            $table->string('IdPiano', 255)->nullable();
database/migrations/2024_06_27_105025_create_pivot_msisdn_products.php
@@ -13,9 +13,14 @@
     */
    public function up()
    {
        Schema::create('pivot_msisdn_products', function (Blueprint $table) {
            $table->id();
        Schema::create('msisdn_has_products', function (Blueprint $table) {
            $table->increments('id')->comment('Identificatore univoco pivot msisdn products');
            $table->integer('idMsisdn')->comment('chiave appartenenza pivot msisdn')->unsigned();
            $table->foreign('idMsisdn')->references('id')->on('fakesso_msisdn');
            $table->integer('idProducts')->comment('chiave appartenenza pivot products')->unsigned();
            $table->foreign('idProducts')->references('id')->on('fakesso_products');
            $table->timestamps();
        });
    }