diff --git a/app/bundles/FormBundle/Entity/Form.php b/app/bundles/FormBundle/Entity/Form.php index ba8c22e699c..3c61c4268b3 100644 --- a/app/bundles/FormBundle/Entity/Form.php +++ b/app/bundles/FormBundle/Entity/Form.php @@ -13,6 +13,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; use Mautic\ApiBundle\Serializer\Driver\ApiMetadataDriver; use Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder; @@ -182,7 +183,7 @@ public static function loadMetadata(ORM\ClassMetadata $metadata) ->columnName('post_action') ->build(); - $builder->createField('postActionProperty', 'string') + $builder->createField('postActionProperty', Types::TEXT) ->columnName('post_action_property') ->nullable() ->build(); diff --git a/app/migrations/Version20210623071326.php b/app/migrations/Version20210623071326.php new file mode 100644 index 00000000000..09c05993be1 --- /dev/null +++ b/app/migrations/Version20210623071326.php @@ -0,0 +1,29 @@ + Mautic Contributors. All rights reserved. + * @author Mautic + * @link https://mautic.org + * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html + */ + +namespace Mautic\Migrations; + +use Doctrine\DBAL\Schema\Schema; +use Mautic\CoreBundle\Doctrine\AbstractMauticMigration; + +final class Version20210623071326 extends AbstractMauticMigration +{ + public function up(Schema $schema): void + { + $this->addSql("ALTER TABLE {$this->prefix}forms MODIFY post_action_property LONGTEXT "); + } + + public function down(Schema $schema): void + { + $this->addSql("UPDATE {$this->prefix}forms SET post_action_property = left(post_action_property,191)"); + $this->addSql("ALTER TABLE {$this->prefix}forms MODIFY post_action_property VARCHAR(191) DEFAULT NULL "); + } +}