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.

m240912_075936_add_columns_automatic_email.php 1.0KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. use yii\db\Migration;
  3. use yii\db\Schema;
  4. /**
  5. * Class m240912_075936_add_columns_automatic_email
  6. */
  7. class m240912_075936_add_columns_automatic_email extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->addColumn('automatic_email', 'id_point_sale', Schema::TYPE_INTEGER);
  15. $this->addColumn('automatic_email', 'sending_day', Schema::TYPE_INTEGER);
  16. $this->addColumn('automatic_email', 'sending_hour', Schema::TYPE_INTEGER);
  17. $this->addForeignKey('automatic_email_fk_id_point_sale', 'automatic_email', 'id_point_sale', 'point_sale', 'id');
  18. $this->alterColumn('automatic_email', 'day', Schema::TYPE_INTEGER);
  19. $this->alterColumn('automatic_email', 'delay_before_distribution', Schema::TYPE_INTEGER);
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function safeDown()
  25. {
  26. $this->dropColumn('automatic_email', 'id_point_sale');
  27. $this->dropColumn('automatic_email', 'sending_day');
  28. $this->dropColumn('automatic_email', 'sending_hour');
  29. }
  30. }