Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Migration/Migration1575569953createTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function getCreationTimestamp(): int

public function update(Connection $connection): void
{
$connection->executeStatement('CREATE TABLE `frosh_mail_archive` (
$connection->executeStatement('CREATE TABLE IF NOT EXISTS `frosh_mail_archive` (
`id` BINARY(16) NOT NULL,
`sender` VARCHAR(255) NOT NULL,
`receiver` JSON NOT NULL,
Expand Down
3 changes: 3 additions & 0 deletions src/Migration/Migration1690743548AddEmlPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ public function getCreationTimestamp(): int

public function update(Connection $connection): void
{
if ($this->columnExists($connection, 'frosh_mail_archive', 'eml_path')) {
return;
}
$connection->executeStatement('ALTER TABLE `frosh_mail_archive`
ADD `eml_path` varchar(2048) NULL;');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Migration/Migration1691326842Attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function getCreationTimestamp(): int

public function update(Connection $connection): void
{
$connection->executeStatement('CREATE TABLE `frosh_mail_archive_attachment` (
$connection->executeStatement('CREATE TABLE IF NOT EXISTS `frosh_mail_archive_attachment` (
`id` BINARY(16) NOT NULL,
`mail_archive_id` BINARY(16) NULL,
`file_name` VARCHAR(255) NOT NULL,
Expand Down
3 changes: 3 additions & 0 deletions src/Migration/Migration1694604822AddSourceMailId.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ public function getCreationTimestamp(): int

public function update(Connection $connection): void
{
if ($this->columnExists($connection, 'frosh_mail_archive', 'source_mail_id')) {
return;
}
$connection->executeStatement('ALTER TABLE `frosh_mail_archive` ADD `source_mail_id` BINARY(16) NULL;');
}

Expand Down
3 changes: 3 additions & 0 deletions src/Migration/Migration1694714751TransportInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ public function getCreationTimestamp(): int

public function update(Connection $connection): void
{
if ($this->columnExists($connection, 'frosh_mail_archive', 'transport_state')) {
return;
}
$connection->executeStatement('ALTER TABLE `frosh_mail_archive` ADD `transport_state` VARCHAR(255) NULL;');
}

Expand Down
17 changes: 11 additions & 6 deletions src/Migration/Migration1739730285AddOrderId.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@ public function getCreationTimestamp(): int

public function update(Connection $connection): void
{
$connection->executeStatement('
ALTER TABLE `frosh_mail_archive`
ADD COLUMN `order_id` BINARY(16) NULL,
ADD COLUMN `order_version_id` BINARY(16) NULL
;
');
if (!$this->columnExists($connection, 'frosh_mail_archive', 'order_id')) {
$connection->executeStatement('
ALTER TABLE `frosh_mail_archive` ADD COLUMN `order_id` BINARY(16) NULL;
');
}

if (!$this->columnExists($connection, 'frosh_mail_archive', 'order_version_id')) {
$connection->executeStatement('
ALTER TABLE `frosh_mail_archive` ADD COLUMN `order_version_id` BINARY(16) NULL;
');
}
}

public function updateDestructive(Connection $connection): void
Expand Down
3 changes: 3 additions & 0 deletions src/Migration/Migration1739741754AddFlowId.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ public function getCreationTimestamp(): int

public function update(Connection $connection): void
{
if ($this->columnExists($connection, 'frosh_mail_archive', 'flow_id')) {
return;
}
$connection->executeStatement('
ALTER TABLE `frosh_mail_archive`
ADD COLUMN `flow_id` BINARY(16) NULL;');
Expand Down
3 changes: 3 additions & 0 deletions src/Migration/Migration1770821445AddMailTemplateId.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ public function getCreationTimestamp(): int

public function update(Connection $connection): void
{
if ($this->columnExists($connection, 'frosh_mail_archive', 'mail_template_id')) {
return;
}
$connection->executeStatement('ALTER TABLE `frosh_mail_archive` ADD COLUMN `mail_template_id` BINARY(16) NULL');
}

Expand Down