Menu Close
    Start a Project Request quote Reading list Switch to dark mode
    magento-hyperlocal-marketplace-guide

    Delete an existing Foreign key Magento2 installer

    If you want to Delete an existing foreign key from a table by installer, then you can use following code:


    Here,

    wk_child_table is the table name in which you created a foreign key column.

    wk_main_table is the table which you used for reference.

    entity_id is the foreign key column name of  “wk_child_table”.

    main_id is the referenced column of table “wk_main_table”.

     

    If you want to add a foreign key in your table then refer following blog:

    Add Foreign Key In Magento2

     

    Hope it will help you.

    Thank you.

    . . .

    Comment

    Add Your Comment

    Be the first to comment.

    Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again
    Close