2

I am creating a module which have three tables let's say for example

table1
--------
id int(13) PRIMARY_KEY
title varchar(50)

table2
--------
id int(13) PRIMARY_KEY
title varchar(255)

table3 `relational_table`
--------
table1_id int(13) (foreign key of table1)
table2_id int(13) (foreign key of table2)

For table1 and table2 I have defined everything like Interface, API, Resource Model.

So my main concern is
Should I have to create PRIMARY_KEY for table3 ?
Should I have to create Resource Model, Interface, API for table3

If YES then how many things needed? and NO then how crud operation will be perform for maintaining relation?

I have referenced magento core module module-tax for tax_rate to tax_rule they have five tables and maintaining all relation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.