You want to remove a column introduced by a third-party extension via declarative schema.
How do you do that?
A. Create the etc/db_schema.xml file and specify disable="true" on the column
B. Modify the original etc/db_schema.xml file and remove the column from there
C. Create a SchemaPatch file and remove the column programmatically
D. Copy the etc/db_schema.xml file into your module and remove the column from your copy
Correct Answer : B
Answer: B
In that case, Here is not say upgrading in mind so we can change third party module file because
Regarding A: Magento allowed removing column using “disabled” not “disable”
Regarding D: IF you overite any XML file and you remove specific code in XML, the system will find first in overwriting file if not able to find then search it in the parent XML file. and here again added remove code in this file
Correct Answer : D
D is the answer
– you need to copy db_schema.xml file in you module
– remove the column from your copy means add “disabled=true” in your copied xml file
– you need to copy db_schema.xml file in you module
– remove the column from your copy means add “disabled=true” in your copied xml file
i had try it by myself , and found D didnot affect.
A also didnot affect because of “disable”, the correct attribute is “disabled”.
At last, i choose A.
I agree with D, in option A it say “disable” but in actual it is “disabled”. Point to look out during the exam if the statement changes to disabled then the answer is A if not the best answer is D.
https://devdocs.magento.com/guides/v2.4/extension-dev-guide/declarative-schema/db-schema.html#drop-a-column-from-a-table
https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/db-schema.html
“To drop a column declared in another module, redeclare it with the disabled attribute set to true.”
There is attribute called “disabled” not “disable” like in A
D
To drop a column declared in another module, redeclare it with the disabled attribute set to true.
Its D because you wouldn’t want to edit a 3rd parties actually code. D Is the same solution as A bit it specifies its in your own module which is a “better” correct answer
it’s correct ? i think the correct ans is the A. https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/db-schema.html
“disabled Disables or deletes the declared table, column, constraint, or index. ”
Any can i help me?