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.

28 lines
560B

  1. <?php
  2. use yii\db\Migration;
  3. use yii\db\Schema;
  4. /**
  5. * Class m230904_064216_add_column_user_producer_newsletter
  6. */
  7. class m230904_064216_add_column_user_producer_newsletter extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->addColumn('user_producer', 'newsletter', Schema::TYPE_BOOLEAN);
  15. $this->execute('UPDATE user_producer SET newsletter = 1;');
  16. }
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public function safeDown()
  21. {
  22. $this->dropColumn('user_producer', 'newsletter');
  23. }
  24. }