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.

42 rindas
1.3KB

  1. <?php
  2. use yii\db\Migration;
  3. /**
  4. * Class m240508_093106_create_indexes_performance
  5. */
  6. class m240508_093106_create_indexes_performance extends Migration
  7. {
  8. /**
  9. * {@inheritdoc}
  10. */
  11. public function safeUp()
  12. {
  13. $this->createIndex('id_user', 'user_producer', 'id_user');
  14. $this->createIndex('id_producer', 'user_producer', 'id_producer');
  15. $this->createIndex('id_product', 'product_price', 'id_product');
  16. $this->createIndex('status', 'user', 'status');
  17. $this->createIndex('email', 'user', 'email');
  18. $this->createIndex('type', 'user', 'type');
  19. $this->createIndex('id_producer', 'user', 'id_producer');
  20. $this->createIndex('date', 'distribution', 'date');
  21. $this->createIndex('id_producer', 'distribution', 'id_producer');
  22. }
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public function safeDown()
  27. {
  28. $this->dropIndex('id_user', 'user_producer');
  29. $this->dropIndex('id_producer', 'user_producer');
  30. $this->dropIndex('id_product', 'product_prices');
  31. $this->dropIndex('status', 'user');
  32. $this->dropIndex('email', 'user');
  33. $this->dropIndex('type', 'user');
  34. $this->dropIndex('id_producer', 'user');
  35. $this->dropIndex('date', 'distribution');
  36. $this->dropIndex('id_producer', 'distribution');
  37. }
  38. }