Theaters, Members, and Movies: name: theaters table: theaters models: - name: members table: members constraints: - type: reference parent: id name: tid - type: reference parent: partition name: partition models: - name: demos table: demographics constraints: - type: reference parent: id name: member_id models: - name: phone_numbers table: phone_numbers constraints: - type: reference parent: id name: demographic_id - name: movies table: movies constraints: - type: reference parent: id name: member_id - name: favorite_comic_movies table: movies constraints: - type: reference parent: id name: member_id - type: static name: genre value: comic - name: favorite_mystery_movies table: movies constraints: - type: reference parent: id name: member_id - type: static name: genre value: mystery - name: favorite_comedy_movies table: movies constraints: - type: reference parent: id name: member_id - type: static name: genre value: comedy Reverse Polymorphic Example: # In this example, an animal has a toy, but that toy is either a dog or cat toy, depending on # the type of the animal. So for this to work in this direction, static constraints pointed # at the parent (animals) is needed. name: animals models: - name: dog_toy table: dog_toys constraints: - parent: toy_id name: id - type: static parent: type value: Dog - name: cat_toy table: cat_toys constraints: - parent: toy_id name: id - type: static parent: type value: Cat