#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    218
    Rep Power
    5

    Is this a correct design for a user and client relation?


    I'm building a database in which.

    > A Client has phases that belong to them, A client can have a 'design-phase', 'development-phase'. Now a Client has many users, and these users can be assigned phases. But only the one's their parent (the client) has offcourse. **All Clients should by default have every phase assigned to them that their parent has, so that's why I'm thinking about the client_blocks table**

    Now I'm wondering if my database design is correct, It feels like something is off.


    Screen Shot 2017-01-10 at 23.06.53.png

    - Does my database need to worry about which phases are part of this client, or on creating a user, should I copy over the phases that are assigned to his parent, the client?

    Any help in the right direction would be greatly appreciated!
    Thank you
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,639
    Rep Power
    4287
    > But only the one's their parent (the client) has

    then you need a relationship between user_blocks and client_blocks to enforce this
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo