Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Segment public name property for preference center (#8238)
* Segment public name property for preference center * Lead lists public_name migration update * Updated tests for segment public name * Migrate segment public name property feature to v3 * Add default value for segment public_name field * Update failing campaign test schema * Fix test Co-authored-by: Dennis Ameling <dennis@dennisameling.com>
- Loading branch information
1 parent
30d909d
commit 60bdfc8
Showing
12 changed files
with
119 additions
and
4 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
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
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
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
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
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
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
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
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
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
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
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,46 @@ | ||
<?php | ||
|
||
/* | ||
* @package Mautic | ||
* @copyright 2019 Mautic Contributors. All rights reserved. | ||
* @author Mautic | ||
* @link http://mautic.org | ||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html | ||
*/ | ||
|
||
namespace Mautic\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\DBAL\Schema\SchemaException; | ||
use Doctrine\Migrations\Exception\SkipMigration; | ||
use Mautic\CoreBundle\Doctrine\AbstractMauticMigration; | ||
|
||
/** | ||
* Auto-generated Migration: Please modify to your needs! | ||
*/ | ||
class Version20191206113956 extends AbstractMauticMigration | ||
{ | ||
/** | ||
* @throws SkipMigration | ||
* @throws SchemaException | ||
*/ | ||
public function preUp(Schema $schema): void | ||
{ | ||
$table = $schema->getTable($this->prefix.'lead_lists'); | ||
|
||
if ($table->hasColumn('public_name')) { | ||
throw new SkipMigration('Schema includes this migration'); | ||
} | ||
} | ||
|
||
public function up(Schema $schema): void | ||
{ | ||
$this->addSql("ALTER TABLE {$this->prefix}lead_lists ADD public_name VARCHAR(255) DEFAULT '' NOT NULL"); | ||
$this->addSql("UPDATE {$this->prefix}lead_lists SET public_name=name"); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
$this->addSql("{$this->prefix}ALTER TABLE lead_lists DROP public_name"); | ||
} | ||
} |