Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

m240627_064315_create_table_automatic_email.php 1018B

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