Relational database in Drupal

joshua.howell - July 22, 2008 - 23:14

Hi, I have been asked to create an employment website which allows;

employers to create positions available and search for suitable candidates,
candidates to search for positions available and apply for positions,
employment agency staff to add employers, positions, candidates, create employer accounts, candidate accounts, application lists, perform numerous searches, create numerous reports, etc.

I have built a few small Drupal sites before but i'm not too sure how to tackle this one. I have been doing some database planning to get a better idea of the tables and fields. I have built a few databases in Microsoft Access but thats a bit different to Drupal. Below is a basic diagram of the tables and their relationships;

Candidates (1) --> (∞) Application (∞) <-- (1) Position (∞) <-- (1) Employer

What would be the easiest way to create this and what would be the most flexible (for future changes) way to create it? Do i use CCK + Views + ??? or do i try to create it as a module (i have no experience creating modules)? Should Candidates and Employers be in the Users table and Positions & Applications as content types?

Any advice would be greatly appreciated, thank you.

Joshua Howell

Hi Joshua, Here's an idea

davedelong - July 23, 2008 - 04:04

Hi Joshua,

Here's an idea off the top of my head:
1. For Candidates and Employers, you could do two things: 1) You could create a new user role for each one. This way people who log in can be actively tracked as employers. 2) Enable the NodeProfile or Bio modules to allow users to create a single Employer or Candidate node type. This could allow you to store all sorts of information regarding a user in node format.

2. Positions - this would be a custom content type built with the CCK. It would have a a) user reference field (if you go the employer role route) or b) a node reference field (if you go the nodeprofile/bio route) that refers to the creating entity (the Employer).

3. Applications - Again, a custom CCK content type with a nodereference field for referring to a particular position, and either an a) user reference field (if you go the candidate role route) or b) a node reference field (if you go the nodeprofile/bio route).

Then if you wanted to get really spiffy, you could use the viewfield module to insert a view into each position node that shows all applications for that position.

Contact me privately if you'd like help setting this up.

HTH,

Dave

 
 

Drupal is a registered trademark of Dries Buytaert.