<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220812053443 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql("INSERT IGNORE INTO event(code)
VALUES
('no_model.invoice_created.notification')
");
$this->addSql("
INSERT INTO subscription_settings(user_id, event_id, type, own, _all, selected, no)
SELECT user.id, e.id, 'subscription.setting.type.no_model', false, false, false, true
FROM user
INNER JOIN event AS e
ON e.code = 'no_model.invoice_created.notification'
WHERE user.manufacturer_id is null
AND user.customer_id is null
AND user.is_active = 1
");}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}