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.

35 line
1.0KB

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