From b5a906ef2b8be6c21e7f6c157045b410ad033261 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 25 Jul 2016 19:13:16 +0300 Subject: [PATCH] 20.07.16 --- common/modules/product/models/Product.php | 6 ++++++ composer_2.phar | Bin 1641993 -> 0 bytes console/migrations/m160722_150612_remove_option_product_variant_id.php | 27 +++++++++++++++++++++++++++ console/migrations/m160725_154511_remove_product_option_product_fkey.php | 27 +++++++++++++++++++++++++++ console/migrations/m160725_155127_remove_product_stock_product_variant_id_fkey.php | 27 +++++++++++++++++++++++++++ frontend/web/images/no_photo.png | Bin 9430 -> 0 bytes 6 files changed, 87 insertions(+), 0 deletions(-) delete mode 100755 composer_2.phar create mode 100644 console/migrations/m160722_150612_remove_option_product_variant_id.php create mode 100644 console/migrations/m160725_154511_remove_product_option_product_fkey.php create mode 100644 console/migrations/m160725_155127_remove_product_stock_product_variant_id_fkey.php delete mode 100755 frontend/web/images/no_photo.png diff --git a/common/modules/product/models/Product.php b/common/modules/product/models/Product.php index c38d6e2..9fb1c7d 100755 --- a/common/modules/product/models/Product.php +++ b/common/modules/product/models/Product.php @@ -4,6 +4,7 @@ namespace common\modules\product\models; use common\behaviors\Slug; use common\models\ProductToRating; +use common\models\Share; use common\modules\comment\models\Comment; use common\modules\product\behaviors\FilterBehavior; use common\modules\rubrication\models\TaxGroup; @@ -331,6 +332,11 @@ class Product extends \yii\db\ActiveRecord ProductImage::deleteAll(['product_id' => $this->product_id]); ProductCategory::deleteAll(['product_id' => $this->product_id]); ProductVariant::deleteAll(['product_id' => $this->product_id]); + ProductOption::deleteAll(['product_id' => $this->product_id]); + ProductVariantOption::deleteAll(['product_id' => $this->product_id]); + ProductStock::deleteAll(['product_id' => $this->product_id]); + Share::deleteAll(['product_id' => $this->product_id]); + return true; } public function imagesUpload() diff --git a/composer_2.phar b/composer_2.phar deleted file mode 100755 index 946d4d1..0000000 Binary files a/composer_2.phar and /dev/null differ diff --git a/console/migrations/m160722_150612_remove_option_product_variant_id.php b/console/migrations/m160722_150612_remove_option_product_variant_id.php new file mode 100644 index 0000000..213a477 --- /dev/null +++ b/console/migrations/m160722_150612_remove_option_product_variant_id.php @@ -0,0 +1,27 @@ +dropForeignKey('option_product_variant_id', '{{%product_variant_option}}'); + } + + public function down() + { + return false; + } + + /* + // Use safeUp/safeDown to run migration code within a transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} diff --git a/console/migrations/m160725_154511_remove_product_option_product_fkey.php b/console/migrations/m160725_154511_remove_product_option_product_fkey.php new file mode 100644 index 0000000..c59c6bb --- /dev/null +++ b/console/migrations/m160725_154511_remove_product_option_product_fkey.php @@ -0,0 +1,27 @@ +dropForeignKey('product_option_product_fkey', '{{%product_option}}'); + } + + public function down() + { + return false; + } + + /* + // Use safeUp/safeDown to run migration code within a transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} diff --git a/console/migrations/m160725_155127_remove_product_stock_product_variant_id_fkey.php b/console/migrations/m160725_155127_remove_product_stock_product_variant_id_fkey.php new file mode 100644 index 0000000..40eb68f --- /dev/null +++ b/console/migrations/m160725_155127_remove_product_stock_product_variant_id_fkey.php @@ -0,0 +1,27 @@ +dropForeignKey('product_stock_product_variant_id_fkey', '{{%product_stock}}'); + } + + public function down() + { + return false; + } + + /* + // Use safeUp/safeDown to run migration code within a transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} diff --git a/frontend/web/images/no_photo.png b/frontend/web/images/no_photo.png deleted file mode 100755 index fc71420..0000000 Binary files a/frontend/web/images/no_photo.png and /dev/null differ -- libgit2 0.21.4