How do you add a foreign key to an existing table created by another module?

How do you add a foreign key to an existing table created by another module?
A. Create etc/db_schema.xml file with the table node and constraint child node
B. Run the command bin/magento setup:db-schema:upgrade <table> <constraint declaration>
C. This can only be done with raw SQL in a Schema Patch file
D. Create the etc/db_constraints.xml file and specify foreign key there in the constraint node

Download Printable PDF. VALID exam to help you PASS.

5 thoughts on “How do you add a foreign key to an existing table created by another module?

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.