Skip to content

Commit 76d19a2

Browse files
committed
After review 0
1 parent 6381d1c commit 76d19a2

File tree

8 files changed

+651
-332
lines changed

8 files changed

+651
-332
lines changed

resources/Database/Schema.sql

Lines changed: 622 additions & 276 deletions
Large diffs are not rendered by default.

src/Domain/Identity/Model/Administrator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class Administrator implements DomainModel, Identity, CreationDate, Modification
3232
#[ORM\GeneratedValue]
3333
private ?int $id = null;
3434

35-
#[ORM\Column(name: 'created', type: 'datetime', nullable: true)]
36-
protected DateTime $createdAt;
35+
#[ORM\Column(name: 'created', type: 'datetime', nullable: false)]
36+
protected ?DateTime $createdAt = null;
3737

3838
#[ORM\Column(name: 'modified', type: 'datetime', nullable: false)]
3939
private DateTime $updatedAt;
@@ -77,7 +77,7 @@ public function getId(): ?int
7777
return $this->id;
7878
}
7979

80-
public function getCreatedAt(): DateTime
80+
public function getCreatedAt(): ?DateTime
8181
{
8282
return $this->createdAt;
8383
}

src/Domain/Messaging/Model/Bounce.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Bounce implements DomainModel, Identity
3030
#[ORM\Column(type: 'blob', nullable: true)]
3131
private ?string $data;
3232

33-
#[ORM\Column(type: 'string', length: 20, nullable: true)]
33+
#[ORM\Column(type: 'string', length: 255, nullable: true)]
3434
private ?string $status;
3535

3636
#[ORM\Column(type: 'text', nullable: true)]

src/Domain/Messaging/Model/Message/MessageFormat.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ class MessageFormat implements EmbeddableInterface
1717
#[ORM\Column(name: 'sendformat', type: 'string', length: 20, nullable: true)]
1818
private ?string $sendFormat = null;
1919

20-
#[ORM\Column(name: 'astext', type: 'boolean', options: ['default' => false])]
20+
#[ORM\Column(name: 'astext', type: 'boolean')]
2121
private bool $asText = false;
2222

23-
#[ORM\Column(name: 'ashtml', type: 'boolean', options: ['default' => false])]
23+
#[ORM\Column(name: 'ashtml', type: 'boolean')]
2424
private bool $asHtml = false;
2525

26-
#[ORM\Column(name: 'aspdf', type: 'boolean', options: ['default' => false])]
26+
#[ORM\Column(name: 'aspdf', type: 'boolean')]
2727
private bool $asPdf = false;
2828

29-
#[ORM\Column(name: 'astextandhtml', type: 'boolean', options: ['default' => false])]
29+
#[ORM\Column(name: 'astextandhtml', type: 'boolean')]
3030
private bool $asTextAndHtml = false;
3131

32-
#[ORM\Column(name: 'astextandpdf', type: 'boolean', options: ['default' => false])]
32+
#[ORM\Column(name: 'astextandpdf', type: 'boolean')]
3333
private bool $asTextAndPdf = false;
3434

3535
public const FORMAT_TEXT = 'text';

src/Migrations/Version20251030081120PostgreSqlPlatform.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ public function down(Schema $schema): void
192192
)
193193
);
194194
// this down() migration is auto-generated, please modify it to your needs
195-
$this->addSql('CREATE SCHEMA public');
196195
$this->addSql('ALTER TABLE phplist_admin_attribute DROP CONSTRAINT FK_58E07690D3B10C48');
197196
$this->addSql('ALTER TABLE phplist_admin_attribute DROP CONSTRAINT FK_58E07690B8ED4D93');
198197
$this->addSql('ALTER TABLE phplist_admin_login DROP CONSTRAINT FK_5FCE0842B8ED4D93');

src/Migrations/Version20251030083621MySqlRenameIndex.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace PhpList\Core\Migrations;
66

7+
use Doctrine\DBAL\Platforms\MySQLPlatform;
78
use Doctrine\DBAL\Schema\Schema;
89
use Doctrine\Migrations\AbstractMigration;
910

@@ -19,6 +20,15 @@ public function getDescription(): string
1920

2021
public function up(Schema $schema): void
2122
{
23+
$platform = $this->connection->getDatabasePlatform();
24+
$this->skipIf(
25+
!$platform instanceof MySQLPlatform,
26+
sprintf(
27+
'This migration is only applicable for MySQL. Current platform: %s',
28+
get_class($platform)
29+
)
30+
);
31+
2232
// this up() migration is auto-generated, please modify it to your needs
2333
$this->addSql('ALTER TABLE phplist_admin RENAME INDEX loginnameidx TO phplist_admin_loginnameidx');
2434
$this->addSql('ALTER TABLE phplist_bounce RENAME INDEX dateindex TO phplist_bounce_dateindex');
@@ -103,6 +113,15 @@ public function up(Schema $schema): void
103113

104114
public function down(Schema $schema): void
105115
{
116+
$platform = $this->connection->getDatabasePlatform();
117+
$this->skipIf(
118+
!$platform instanceof MySQLPlatform,
119+
sprintf(
120+
'This migration is only applicable for MySQL. Current platform: %s',
121+
get_class($platform)
122+
)
123+
);
124+
106125
// this down() migration is auto-generated, please modify it to your needs
107126
$this->addSql('ALTER TABLE phplist_admin RENAME INDEX phplist_admin_loginnameidx TO loginnameidx');
108127
$this->addSql('ALTER TABLE phplist_bounce RENAME INDEX phplist_bounce_dateindex TO dateindex');

0 commit comments

Comments
 (0)