Skip to content

Commit

Permalink
Merge pull request #2816 from irontec/PROVIDER-967-call-csv-scheduler…
Browse files Browse the repository at this point in the history
…s-email-field-should-be-not-null-default-empty-value

Default empty email in CallCsvScheduler
  • Loading branch information
rbatistadev authored Nov 27, 2024
2 parents e50efe5 + 8edadd8 commit 7ec992a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ abstract class CallCsvSchedulerAbstract
/**
* @var string
*/
protected $email;
protected $email = '';

/**
* @var ?\DateTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ abstract class CallCsvSchedulerDtoAbstract implements DataTransferObjectInterfac
/**
* @var string|null
*/
private $email = null;
private $email = '';

/**
* @var \DateTimeInterface|string|null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<field name="email" type="string" column="email" length="140" nullable="false">
<options>
<option name="fixed"/>
<option name="default"/>
</options>
</field>
<field name="lastExecution" type="datetime" column="lastExecution" nullable="true"/>
Expand Down
31 changes: 31 additions & 0 deletions schema/DoctrineMigrations/Version20241114091020.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace Application\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Ivoz\Core\Infrastructure\Persistence\Doctrine\LoggableMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241114091020 extends LoggableMigration
{
public function getDescription(): string
{
return 'Added default empty string to email in CallCsvSchedulers';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE CallCsvSchedulers CHANGE email email VARCHAR(140) DEFAULT \'\' NOT NULL');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE CallCsvSchedulers CHANGE email email VARCHAR(140) NOT NULL');
}
}

0 comments on commit 7ec992a

Please sign in to comment.