You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

m240508_093106_create_indexes_performance.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. }