forked from mautic/mautic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '5.0' into 5.0.1-to-5.x
- Loading branch information
Showing
3 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Mautic\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\Exception\SkipMigration; | ||
use Mautic\CoreBundle\Doctrine\AbstractMauticMigration; | ||
|
||
final class Version20200415135706 extends AbstractMauticMigration | ||
{ | ||
public function preUp(Schema $schema): void | ||
{ | ||
if ($schema->getTable("{$this->prefix}form_fields")->hasColumn('mapped_object')) { | ||
throw new SkipMigration('Schema includes this migration'); | ||
} | ||
} | ||
|
||
public function up(Schema $schema): void | ||
{ | ||
$this->addSql("ALTER TABLE {$this->prefix}form_fields | ||
ADD mapped_object VARCHAR(191) DEFAULT NULL, | ||
ADD mapped_field VARCHAR(191) DEFAULT NULL"); | ||
|
||
// All field that starts with company belongs to the company object. | ||
// Except the company field itself that belongs to the contact (lead) object. | ||
$this->addSql("UPDATE {$this->prefix}form_fields | ||
SET mapped_object = CASE | ||
WHEN lead_field LIKE 'company%' AND lead_field != 'company' THEN 'company' | ||
ELSE 'contact' | ||
END, mapped_field = lead_field | ||
WHERE lead_field IS NOT NULL"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Mautic\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\DBAL\Schema\SchemaException; | ||
use Doctrine\Migrations\Exception\SkipMigration; | ||
use Mautic\CoreBundle\Doctrine\AbstractMauticMigration; | ||
|
||
/** | ||
* Migration for removing online status. | ||
*/ | ||
class Version20200513162918 extends AbstractMauticMigration | ||
{ | ||
/** | ||
* @throws SkipMigration | ||
* @throws SchemaException | ||
*/ | ||
public function preUp(Schema $schema): void | ||
{ | ||
if ($schema->getTable("{$this->prefix}email_copies")->hasColumn('body_text')) { | ||
throw new SkipMigration("The body_text column has already been added to the {$this->prefix}email_copies table."); | ||
} | ||
} | ||
|
||
public function up(Schema $schema): void | ||
{ | ||
$this->addSql("ALTER TABLE {$this->prefix}email_copies ADD COLUMN `body_text` LONGTEXT NULL DEFAULT NULL AFTER `body`"); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
$this->addSql("ALTER TABLE {$this->prefix}email_copies DROP COLUMN `body_text`"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"stability": "stable", | ||
"minimum_php_version": "8.0.2", | ||
"maximum_php_version": "8.1.99", | ||
"minimum_mysql_version": "5.7.14", | ||
"minimum_mariadb_version": "10.2.7", | ||
"show_php_version_warning_if_under": "8.0.2", | ||
"minimum_mautic_version": "4.4.10", | ||
"announcement_url": "https://github.com/mautic/mautic/releases/tag/5.0.0" | ||
"announcement_url": "https://github.com/mautic/mautic/releases/tag/5.0.1" | ||
} |