Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

m201207_160043_specific_prices.php 940B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. use yii\db\Migration;
  3. use yii\db\Schema;
  4. class m201207_160043_specific_prices extends Migration
  5. {
  6. public function safeUp()
  7. {
  8. $this->createTable('product_price', [
  9. 'id' => 'pk',
  10. 'id_product' => Schema::TYPE_INTEGER . ' NOT NULL',
  11. 'id_user' => Schema::TYPE_INTEGER,
  12. 'id_point_sale' => Schema::TYPE_INTEGER,
  13. 'price' => Schema::TYPE_FLOAT,
  14. ]);
  15. $this->addColumn('user_producer', 'product_price_percent', Schema::TYPE_INTEGER) ;
  16. $this->addColumn('point_sale', 'product_price_percent', Schema::TYPE_INTEGER) ;
  17. }
  18. public function safeDown()
  19. {
  20. $this->dropTable('product_price') ;
  21. $this->dropColumn('user_producer', 'product_price_percent') ;
  22. $this->dropColumn('point_sale', 'product_price_percent') ;
  23. return false;
  24. }
  25. }