sistemazione migration per modifica campi di appartenenza e foreign keys
1 files renamed
5 files modified
| | |
| | | |
| | | public function products() |
| | | { |
| | | return $this->hasMany('App\Models\Products','LinkedMSISDN', 'id'); |
| | | return $this->belongsToMany('App\Models\Products', 'pivot_msisdn_products', 'idProducts', 'idMsisdn'); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | public function msisdn() |
| | | { |
| | | return $this->belongsTo('App\Models\Msisdn', 'LinkedMSISDN', 'id'); |
| | | return $this->belongsToMany(Msisdn::class, 'pivot_msisdn_products', 'idProducts', 'idMsisdn'); |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | 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(); |
| | |
| | | { |
| | | 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(); |
File was renamed from database/migrations/2023_05_02_170504_create_fakesso_msisdn.php |
| | |
| | | { |
| | | 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(); |
| | |
| | | */ |
| | | 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(); |
| | | |
| | | }); |
| | | } |
| | | |