您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

38 行
1018B

  1. <?php
  2. use yii\db\Migration;
  3. use yii\db\Schema;
  4. /**
  5. * Class m240627_064315_create_table_automatic_email
  6. */
  7. class m240627_064315_create_table_automatic_email extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->createTable('automatic_email', [
  15. 'id' => 'pk',
  16. 'id_producer' => Schema::TYPE_INTEGER.' NOT NULL',
  17. 'day' => Schema::TYPE_INTEGER.' NOT NULL',
  18. 'delay_before_distribution' => Schema::TYPE_INTEGER.' NOT NULL',
  19. 'subject' => Schema::TYPE_STRING.' NOT NULL',
  20. 'message' => Schema::TYPE_TEXT.' NOT NULL',
  21. 'integrate_product_list' => Schema::TYPE_BOOLEAN,
  22. 'status' => Schema::TYPE_INTEGER.' NOT NULL',
  23. ]);
  24. $this->addForeignKey('fk_automatic_email_id_producer', 'automatic_email', 'id_producer', 'producer', 'id');
  25. }
  26. /**
  27. * {@inheritdoc}
  28. */
  29. public function safeDown()
  30. {
  31. $this->dropTable('automatic_email');
  32. }
  33. }