We don't want to run any actions during migrations.
This will also clean duplicate trigger actions
that were potentially created because of requests race conditions.
[MAILPOET-4684]
Since we are removing all the MP2 migration code the table
wp_mailpoet_mapping_to_external_entities is not needed anymore. It was
used to map MP2 objects to MP3 objects. This commit removes the code
that creates this table for new installs and deprecates its model.
[MAILPOET-4376]
This commit removes the main MP2 migration class and its test class. It
also removes two SQL files that were used in the test class. One of
those files executed the following query:
`SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"`
Removing this query made the tests inside SubscriberSegmentTest fail
when running the whole integration test suite. To work around this, I
added the above mentioned query to SubscriberSegmentTest. I'm not sure
why this test class fails without this query when running all the tests
but it doesn't when it is executed alone. Probably there is another test
class changing the SQL_MODE. Since SubscriberSegmentTest is a test class
for a Paris model that we will eventually remove, I decided it was not
necessary to investigate this further.
[MAILPOET-4376]
This was causing flakiness of acceptance test ReinstallFromScratchCest.php:reinstallFromScratch
and also potential issue for production.
In Activator::deactivate we remove MailPoet's DB tables. This takes some time.
In case there is another request during the deletion it may detect some tables are missing and trigger activation
and we end up creating MailPoet tables and removing them at the same time.
This commit adds locking to deactivate method so that any other attempt for activation ends up with an error.
[MAILPOET-4274]
It was necessary to deprecate the filter
mailpoet_archive_email_subject and create a new one since the type
of one of the parameters passed to the filter had to change.
[MAILPOET-4307]
MySQL has maximum key lengths for indexes, and the number can vary based
on storage engine and MySQL version. Using utf8mb4, the index would be
255 * 4 = 1020 bytes long, exceeding the MyISAM maximum of 1000 bytes
and the MySQL 5.6 maximum of 767 bytes.
See Column Prefix Key Parts in the MySQL reference:
https://dev.mysql.com/doc/refman/8.0/en/create-index.html
By reducing this length to 191, we ensure that the maximum likely index
length will be less than the 767 lower bound (191 * 4 = 764).
MAILPOET-4489
This commit fixes the logic of the code that enables third party
libraries by default. It was meant to enable those libraries only for
existing installs when the code was introduced in cfae753601
to avoid breaking functionality. But due to a bug, it was also enabling
those libraries for new installs.
To fix this issue, this commit moves the code to the Migrator class and
makes sure it is only executed for existing installs and only once when
doing a version update.
[MAILPOET-4285]