migrations/Version20220509145500.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use App\Notification\SendExpertViewObjectNotification;
  5. use Doctrine\DBAL\Schema\Schema;
  6. use Doctrine\Migrations\AbstractMigration;
  7. /**
  8.  * Auto-generated Migration: Please modify to your needs!
  9.  */
  10. final class Version20220509145500 extends AbstractMigration
  11. {
  12.     public function getDescription(): string
  13.     {
  14.         return 'Alter description into template';
  15.     }
  16.     public function up(Schema $schema): void
  17.     {
  18.         $this->addSql('DELETE FROM notification_template WHERE notification_type=' SendExpertViewObjectNotification::TYPE);
  19.         $text_email_no "%header% <p>Hi %expert_name%, du mottok en ny melding fra et objekt</p> <p>User: %user_name%</p> <p>Email: %user_email%</p> <p>Telefon: %user_phone%</p> <p>Objekt: %object_link%</p> <p>Beskrivelse: %message%</p> %footer%";
  20.         $text_email_en "%header% <p>Hi %expert_name%, you received a new message from a object</p> <p>User: %user_name%</p> <p>Email: %user_email%</p> <p>Phone: %user_phone%</p> <p>Object: %object_link%</p> <p>Description: %message%</p> %footer%";
  21.         $this->addSql("INSERT INTO notification_template (notification_type,notification_language,text_email,text_sms,subject,created_at,updated_at,text_system) VALUES
  22.             (" SendExpertViewObjectNotification::TYPE " ,'nor-NO','{$text_email_no}',NULL,'Spesialist','" date('Y-m-d H:i:s') . "','" date('Y-m-d H:i:s') . "',NULL),
  23.             (" SendExpertViewObjectNotification::TYPE ",'eng-GB','{$text_email_en}',NULL,'Specialist','" date('Y-m-d H:i:s') . "','" date('Y-m-d H:i:s') . "',NULL);");
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         $this->addSql('DELETE FROM notification_template WHERE notification_type=' SendExpertViewObjectNotification::TYPE);
  28.         $text_email_no "%header% <p>Hi %expert_name%, du mottok en ny melding fra et objekt</p> <p>User: %user_name%</p> <p>Email: %user_email%</p> <p>Telefon: %user_phone%</p> <p>Objekt: %object_link%</p> <p>%message%</p> %footer%";
  29.         $text_email_en "%header% <p>Hi %expert_name%, you received a new message from a object</p> <p>User: %user_name%</p> <p>Email: %user_email%</p> <p>Phone: %user_phone%</p> <p>Object: %object_link%</p> <p>%message%</p> %footer%";
  30.         $this->addSql("INSERT INTO notification_template (notification_type,notification_language,text_email,text_sms,subject,created_at,updated_at,text_system) VALUES
  31.             (" SendExpertViewObjectNotification::TYPE " ,'nor-NO','{$text_email_no}',NULL,'Spesialist','" date('Y-m-d H:i:s') . "','" date('Y-m-d H:i:s') . "',NULL),
  32.             (" SendExpertViewObjectNotification::TYPE ",'eng-GB','{$text_email_en}',NULL,'Specialist','" date('Y-m-d H:i:s') . "','" date('Y-m-d H:i:s') . "',NULL);");
  33.     }
  34. }