Commit Graph

44 Commits

Author SHA1 Message Date
Rostislav Wolny
33e7e2d5f1 Fix typos in migration levels related strings
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
acd5846f70 Change migration level constants to lowercase
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
ba728c5612 Use phpstan type alias for migration types
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
871d9fd9f8 Small code and php doc enhancements in MailPoet/Migrator
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
725d81077f Add check for duplicate migrations names when loading migrations
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
ec8b5260dd Improve command for creating new migrations
Use required parameter instead of optional option
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
b4d0b35a1d Small code improvements based on review feedback
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
93c29512df Fix AppMigrationTemplate description
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
74a5dde19f Make migration runner aware of the level of running migration
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
94d8d28253 Refactor Migrations Repository to return also migrations level
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
8454925e9a Update functionality for generating new migrations to support levels
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
466782790a Remove access to higher level services in Db level migrations
[MAILPOET-5416]
2023-07-26 14:01:39 +02:00
Rostislav Wolny
5fd02b2bab Add support for App and Db migrations into Repository and Runner
[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
aca358d276 Add App level migration and template
[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
alex-mailpoet
e38fd951d1 Check indexes exist when adding them
[MAILPOET-5364]
2023-05-31 10:19:30 +03:00
Jan Jakes
89df50c160 Always skip unknown migrations (not only completed ones)
[MAILPOET-5054]
2023-02-13 16:56:01 +01:00
Jan Jakes
e9326e8c9e Handle a case when migrations table contains invalid data
See: https://wordpress.org/support/topic/null-values-are-exported-as-empty-strings/

[MAILPOET-5054]
2023-02-13 16:56:01 +01:00
Jan Lysý
c5cd863f15 Use database() value for column existing detection
[MAILPOET-4916]
2023-01-02 14:37:33 +01:00
Jan Jakes
65e78c7990 Add helper to determine whether a column exists
[MAILPOET-4852]
2022-11-24 16:04:29 +01:00
Jan Jakes
2bdc5d3683 Add helper to get current table name
[MAILPOET-4852]
2022-11-24 16:04:29 +01:00
Jan Jakes
d1df2d4f42 Add a helper function to create new table
[MAILPOET-4835]
2022-11-21 12:15:10 +01:00
Jan Jakes
70aefb421b Clear error when rerunning migration
[MAILPOET-4811]
2022-11-14 20:12:35 +03:00
Jan Jakes
4ee08c296b Fix unknown storage engine 'InnoDB' error
[MAILPOET-4802]
2022-11-10 12:59:24 +01:00
Rodrigo Primo
d970efc0da Reduce size of a database field to avoid error in some MySQL versions
This commit reduces the size of the `name` field from varchar(255) to
varchar(191) to avoid the following fatal error in some MySQL versions:

```
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
```

See the ticket descriptions and the links in it for more information.

[MAILPOET-4790]
2022-11-08 12:27:01 -03:00
Jan Jakes
43197bf859 Use 24-hour format in migration timestamps
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
bd34c4e7ec Ignore index.php in migrations directory
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
511b8ad7ff Retry timed out and failed migrations
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
a3f2ee8bbb Implement CLI output logging when running migrations
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
a177b3b8da Add the possibility to use a logger in migrator
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
f369fdfa4a Add ./do migrations:new command to generate migration files
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
dd10389c55 Implement WP CLI command to show migrations info
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
3dd6ef3da7 Implement WP CLI command to run migrations
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
036d0a29ae Implement full migration running logic
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
d199e0b77e Add migrator service with ability to resolve status of all migrations
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
17ab79aa6f Add store method to list all migrations
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
b10cd32449 Add runner to execute a migration and save its status
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
f9001c1826 Add store methods to start, complete, and fail a migration
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
31050394b9 Add a store with a method to create migrations table when it doesn't exist
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
e9970f3cc8 Implement loading existing migration classes from the filesystem
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
516c460ace Add repository with the ability to create new migration classes
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
03d80290e6 Add a migration template that will be used to generate new migrations
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Jan Jakes
d65b567858 Add abstract migration class with access to connection, entity manager, and the DI container
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00