In a new release of a module, a developer decides to rename a table that was defined in the earlier versions. Which action, if any, allows the developer to prevent data loss?
A.
Define onCreate=“migrateDataFromAnotherTable(old_table_name)” attribute in the table tag.
B.
Declarative schema supports ‘RENAME TABLE’, so the data will be migrated to the new table automatically.
C.
Define the table and columns mapping in the db_schema_whitelist.json.
the correct answer should be
A. Define onCreate=“migrateDataFromAnotherTable(old_table_name)” attribute in the table tag.
from magento documentation
"
Renaming a table via RENAME TABLE is NOT supported. To migrate data from another table, specify the onCreate attribute on the table declaration, and add specify the source table name: onCreate="migrateDataFromAnotherTable(catalog_category_entity)"
"
source: https://developer.adobe.com/commerce/php/development/components/declarative-schema/configuration/#rename-a-table
upvoted 5 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
rofibim897
Highly Voted 1 month, 3 weeks ago