Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Commit e7cd61c

Browse files
authored
Merge pull request #14 from picbenoit/rename_offer_id_column_to_product_id_in_wishlist_content_table
rename offer_id wishlist_content column to product_id
2 parents 744c5b8 + 81aead0 commit e7cd61c

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"thomaswelton/laravel-gravatar": "^1.1",
3333
"thujohn/twitter": "^2.2",
3434
"tightenco/ziggy": "^0.6.9",
35-
"watson/active": "3.0.0"
35+
"watson/active": "3.0.0",
36+
"doctrine/dbal": "^2.9"
3637
},
3738
"require-dev": {
3839
"phpunit/phpunit": "~7.0",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class RenameOfferIdToProductIdInShopperWishlistContentTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
if (Schema::hasColumn('shopper_wishlist_content', 'offer_id')) {
17+
Schema::table('shopper_wishlist_content', function (Blueprint $table) {
18+
$table->renameColumn('offer_id', 'product_id');
19+
});
20+
}
21+
}
22+
23+
/**
24+
* Reverse the migrations.
25+
*
26+
* @return void
27+
*/
28+
public function down()
29+
{
30+
if (Schema::hasColumn('shopper_wishlist_content', 'product_id')) {
31+
Schema::table('shopper_wishlist_content', function (Blueprint $table) {
32+
$table->renameColumn('product_id', 'offer_id');
33+
});
34+
}
35+
}
36+
}

src/Plugins/Orders/Models/WishlistContent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class WishlistContent extends Model
1616
*/
1717
protected $fillable = [
1818
'wishlist_id',
19-
'offer_id'
19+
'product_id'
2020
];
2121

2222
/**

0 commit comments

Comments
 (0)