3

I am using Drupal 7 and I want to create tables which have primary key and foreign keys using content types. Each table would be created using content types. Let's say, when I create Fruit content type, it should create a table for it, right? Then, I may have Price table, hence, I create a Price content type. Now, the Fruit id(primary key) should be connected with Fruit id in the Price table (content type). How's this possible? I don't know how to code the tables/content type schema.

Thanks for your help.

migrated from stackoverflow.com Jun 27 '11 at 13:47

This question came from our site for professional and enthusiast programmers.

  • It would be great to have this feature. I always think it's backward to make a db abstraction layer that removes functionality and makes things inefficient just to help in the one off chance you'll ever want to change your database back end... – artfulrobot Apr 3 '12 at 10:04
2

Following link has a long discussion about foreign key in Groups.Drupal

=> Add join/foreign key info to schema

  • yep, it's a good discussion. not v. satisfactory, and it ended in 2009. – artfulrobot Apr 3 '12 at 10:03
1

I think this is what you want: References Module

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.