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
Correct Answer: A
Answer: A
Correct Answer A
https://devdocs.magento.com/guides/v2.4/extension-dev-guide/declarative-schema/db-schema.html#create-a-foreign-key
A scroll down
https://magento.stackexchange.com/questions/192317/magento-2-how-to-add-foreign-key-in-update-schema
correct is A