Commit Graph

60 Commits

Author SHA1 Message Date
David Remer
d2d465165d Remove double log entries before adding unique index
[MAILPOET-5630]
2023-10-09 13:20:20 +02:00
Jan Jakes
7fac20fc8c Make default error value NULL, make data non-nullable
[MAILPOET-5599]
2023-09-25 06:10:52 -07:00
Jan Jakes
c5f50b2a47 Fix "Field 'run_number' doesn't have a default value"
[MAILPOET-5599]
2023-09-25 06:10:52 -07:00
Brezo Cordero
6388a7307f Check table exists before altering it
[MAILPOET-5590]
2023-09-25 05:48:48 -07:00
Jan Jakes
d7addd8e55 Add migration to fix and add more automation log data
[MAILPOET-5568]
2023-09-20 02:36:40 -07:00
Jan Jakes
d730083d22 Fix unintended "ON UPDATE current_timestamp()" on some timestamp columns
[MAILPOET-5568]
2023-09-20 02:36:40 -07:00
David Remer
71453f0c14 Switch double quotes with single quotes
[MAILPOET-5485]
2023-09-11 12:14:33 +02:00
David Remer
9991ba546a Separate migration app and db logic
[MAILPOET-5485]
2023-09-11 12:14:33 +02:00
David Remer
bba7786e7e Store current order status in revenue statistics
[MAILPOET-5485]
2023-09-11 12:14:33 +02:00
Rostislav Wolny
e6e20e3159 Save association to WP post with newsletter
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]
2023-08-24 15:44:34 +02:00
Rostislav Wolny
7d99556683 Add DB migration and wpPostId to NewsletterEntity
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]
2023-08-24 15:44:34 +02:00
John Oleksowicz
7a6cc36718 Include timeframe in migration to avoid BC code
MAILPOET-5496
2023-08-17 13:49:08 +02:00
John Oleksowicz
0e9bf64986 Migrate existing shipping/payment method filter data
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
2023-08-17 13:49:08 +02:00
Rostislav Wolny
7954f9d74f Move newly added migrations (after rebase) to correct folders
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
35b7e9177c Eliminate settings controller from the initial migration
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
f0a8f3bfd3 Eliminate direct access to EntityManager in Db migrations
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]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
435152281a Extract App level method from initial Db migration to a new App level migration
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]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
7f363a96f5 Refactor Migration_20230111_120000 to work without SettingsController
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
9684285105 Move clearly App level migrations to App directory
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
5c4dcb77c5 Move all current migrations to Dd folder
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
092fcb78d0 Rename Migration to DbMigration
We want to distinguish Db and App level migrations. This is the first step.
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rodrigo Primo
1198c52808 Add migration to change the update name of parameters of a few filters
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]
2023-07-19 15:24:46 +02:00
David Remer
e194a4d04b Add indicies to automation_runs and automation_run_logs table
[MAILPOET-5091]
2023-07-18 13:03:16 +02:00
John Oleksowicz
b02ef8fe8f Use populator instead of migration
MAILPOET-5404
2023-07-12 15:48:03 +02:00
John Oleksowicz
784df9c1ac Add migration to trigger initial backfilling
MAILPOET-5404
2023-07-12 15:48:03 +02:00
John Oleksowicz
1e82378df2 Add new tracking columns
MAILPOET-4998
2023-06-22 15:29:22 +02:00
alex-mailpoet
e38fd951d1 Check indexes exist when adding them
[MAILPOET-5364]
2023-05-31 10:19:30 +03:00
John Oleksowicz
ed51588bf3 Only index first 10 characters of name columns
MAILPOET-4997
2023-05-12 13:59:12 +02:00
John Oleksowicz
2898c38bcb Add first/last name indexes to subscribers table
MAILPOET-4997
2023-05-12 13:59:12 +02:00
John Oleksowicz
c411186a98 Add migration to fix problem on existing sites
MAILPOET-5261
2023-05-03 10:21:13 +02:00
Jan Jakes
761c28ef01 Add migration from "transactional" email type to "automation_transactional"
We also need to extend the column max. size.

[MAILPOET-5258]
2023-04-24 09:54:08 +03:00
Jan Lysý
0fe75d98f9 Add migration fixing newsletter option fields
[MAILPOET-5244]
2023-04-19 15:32:28 +02:00
Rostislav Wolny
68e01ccf9f Add migration for setting initial homepage state for old users
[MAILPOET-4831]
2023-03-13 14:09:17 +01:00
Sam Najian
ddd89e70ed Add context and raw message to mailpoet_logs
[MAILPOET-4983]
2023-03-01 17:46:22 +01:00
David Remer
e7d9f3d362 Remove unnecessary check.
[MAILPOET-4966]
2023-03-01 16:14:38 +01:00
David Remer
4a49143422 Add primary key to automation_run_subjects table
[MAILPOET-4966]
2023-03-01 16:14:38 +01:00
David Remer
c68fc1378c Improve name of "run only once" meta
[MAILPOET-4966]
2023-03-01 16:14:38 +01:00
David Remer
e7868f033d Set existing automations to run only once
[MAILPOET-4966]
2023-03-01 16:14:38 +01:00
David Remer
9e016bfc07 Add hash to Subject
The hash gives us a new column in our table, which we can
use to query a specific combination of args and key more
efficient

[MAILPOET-4966]
2023-03-01 16:14:38 +01:00
David Remer
8cfb93a3b6 Add meta data to Automation
[MAILPOET-4966]
2023-03-01 16:14:38 +01:00
David Remer
c4faa53386 Store run subjects in extra table
[MAILPOET-4966]
2023-03-01 16:14:38 +01:00
Jan Lysý
89f76f67ca Rename old migrations
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]
2023-01-25 20:21:13 +01:00
Rostislav Wolny
69440ec2a6 Add migration with a fix for inconsistent MailerLog data
[MAILPOET-4940]
2023-01-09 20:01:47 +01:00
Rostislav Wolny
b266edb8e7 Make initial migration ANSI_QUOTES compatible
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]
2022-12-12 13:59:09 +01:00
Jan Jakes
5769fa45f5 Use helper methods for method column migration
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]
2022-11-25 14:51:57 +01:00
Sam Najian
90c8e5b2c9 Introduce method column to statistics_unsubscribes table
[MAILPOET-4733]
2022-11-25 14:51:57 +01:00
Jan Jakes
83f7eee8ae Early return to make the migration idempotent
[MAILPOET-4852]
2022-11-24 16:04:29 +01:00
Jan Jakes
dc1f63d8bb Rename segments migration to be executed again
[MAILPOET-4852]
2022-11-24 16:04:29 +01:00
Jan Jakes
3e2425abd8 Rewrite segments migration to use helper methods, Doctrine DBAL, and lower number of queries
[MAILPOET-4852]
2022-11-24 16:04:29 +01:00
Oluwaseun Olorunsola
8b922681b6 Use boolean instead of integer for displayInManageSubscriptionPage column
MAILPOET-4669
2022-11-21 15:21:29 +01:00