This commit adds a simple implementation of ensuring the mailpoet_email post type
has associated NewsletterEntity.
In the future we will need to add support also for saving additional data for
newsletters (subject, sending settings).
[MAILPOET-5365]
The email body will be stored as a wp_post, but for mailpoet specific attributes
we will use the current DB structure so that we can easy integrate emails edited in the new editor.
[MAILPOET-5365]
Now that these filters are using the shared DaysPeriodField, they store
the day count in a field named days instead of used_payment_method_days
or used_shipping_method_days.
This migration is based on Migration_20230712_180341, where we needed to
do the same thing for other filters.
MAILPOET-5496
As we don't want to allow working directly with EntityManager in
the Db level migrations this commit replaces direct access with helper
methods from the parent class.
We don't want to allow working with EntityManager since it is considered
high level service and causes errors when DB structure is not up to date.
[MAILPOET-5416]
All these extracted methods contain DB version check so for existing
sites the migration will be just added as completed to the migrations table.
[MAILPOET-5416]
In a previous commit, the name of the parameter of a few filters was
changed to `days`. This commit adds a migration to change the name of
parameter of existing filters when needed. The following parameters
should be renamed to days:
- number_of_orders_days
- total_spent_days
- single_order_value_days
- average_spent_days
I opted to leave the original parameter instead of deleting it, just to
be safe in case a given site needs to rollback to a previous version.
Once a change is made to a filter by the user, the old parameter will be
deleted.
[MAILPOET-4991]
Because we expect that our plugin can recover from an invalid DB state.
We rename old migrations that ensure both migrations are executed again.
[MAILPOET-4962]
We run the initial migrations via dbDelta which internally uses
$wpdb. ANSI_QUOTES is not on the list of WPDB's incompatible modes
(767bdad516/wp-includes/class-wpdb.php (L648-L655))
So we need to make sure SQL queries we run through wpdb are ANSI_QUOTES compatible.
This commit makes initial migrations compatible with the ANSI_QUETES mode.
[MAILPOET-4887]
This fixes issues with MailPoet in multiple schemas on the same MySQL instance as well
as simplifies the code. The migration was also renamed to a newer date. Additionally, the
edit of the initial MailPoet migration was reverted as this is not needed.
[MAILPOET-4733]