Problem/Motivation
If the table does not exist in the source database, the migration will fail with the database exception:
[error] Could not retrieve source count from sql: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'source.foo' doesn't exist: SELECT COUNT(*) AS "expression"
FROM
(SELECT 1 AS "expression"
FROM
"foo" "t") "subquery"; Array
(
)
My specific use-case: custom migration that was executed on multiple websites, where the data structure is a bit different.
Steps to reproduce
1) Create a migration with Table source plugin;
2) Specify not existing sql table;
3) Try running the migration;
Proposed resolution
Implement ::checkRequirements method in Table source plugin.
Remaining tasks
Submit a merge request, review, commit.
Comments
Comment #2
matroskeenComment #4
matroskeenComment #5
matroskeenThe first commit failed as expected. This is ready for review.
Comment #6
matroskeenI think we should agree on the approach in #3254986: Remove requirements array from RequirementsException message, so I'm postponing this one.
Comment #7
matroskeenComment #9
matroskeenCommitted to 8.x-5.x.