[eluser]North2Alaska[/eluser]
I'm just beginning to convert an existing project to use DMZ. I've not got as far as any actual code yet, I'm just building the database; renaming columns, adding ID columns, adding create and change dates and renaming and/or adding join tables.
But I've run into a stumper. I have tables named AREAS, USERS and PROFILES. AREAS and USERS are a many to many so I create the AREAS_USERS table. No problem. But now PROFILES. Each user will have one profile per area. So, I have been using the AREAS_USERS for this purpose and keeping a AREA_ID and USER_ID in the PROFILES table. But I believe this will break the naming conventions.
So, before I get too far, I thought I would just ask how is the best way to handle this relationship? I could have an AREAS_PROFILES table but that doesn't take into consideration users. Do I create a AREAS_PROFILES_USERS table? Or maybe an AREA_USERS_PROFILES table as the AREA_USERS it what I'm joining to.
As I'm writing this, I'm seeing that I could use just a has_many from the AREAS_USERS table to the PROFILES table. And a has_one from the PROFILES table to the AREAS_USERS table.
Just a little kick in the right direction would be appreciated.