m231004_195249_mailer.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. use yii\db\Migration;
  3. /**
  4. * Class m231004_195249_mailer
  5. */
  6. class m231004_195249_mailer extends Migration {
  7. /**
  8. * {@inheritdoc}
  9. */
  10. public function safeUp() {
  11. $this->createTable("NotificacionCorreo", [
  12. "id" => $this->primaryKey(),
  13. "receptor" => $this->json()->notNull(),
  14. "asunto" => $this->string()->notNull(),
  15. "cuerpo" => $this->text()->notNull(),
  16. "estatus" => $this->string(20),
  17. "detalle" => $this->text(),
  18. "prioridad" => $this->smallInteger()->comment("1, 2 o 3"),
  19. "enviado" => $this->timestamp() . ' with time zone',
  20. "creado" => $this->timestamp() . ' with time zone',
  21. "modificado" => $this->timestamp() . ' with time zone',
  22. "eliminado" => $this->timestamp() . ' with time zone',
  23. ]);
  24. $this->createTable("NotificacionCorreoAdjunto", [
  25. "id" => $this->primaryKey(),
  26. "idNotificacionCorreo" => $this->integer(),
  27. "ruta" => $this->string()
  28. ]);
  29. $this->addForeignKey("NCAidNotificacionCorreoFK", "NotificacionCorreoAdjunto", "idNotificacionCorreo", "NotificacionCorreo", "id");
  30. }
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function safeDown() {
  35. $this->dropForeignKey("NCAidNotificacionCorreoFK", "NotificacionCorreoAdjunto");
  36. $this->dropTable("NotificacionCorreoAdjunto");
  37. $this->dropTable("NotificacionCorreo");
  38. }
  39. }