Theaters, Members, and Movies: theaters: relationships: members: constraints: - type: reference parent: id name: tid - type: reference parent: partition name: partition members: relationships: demos: model: demographics constraints: - type: reference parent: id name: member_id movies: constraints: - type: reference parent: id name: member_id favorite_comic_movies: model: movies constraints: - type: reference parent: id name: member_id - type: static name: genre value: comic favorite_mystery_movies: model: movies constraints: - type: reference parent: id name: member_id - type: static name: genre value: mystery favorite_comedy_movies: model: movies constraints: - type: reference parent: id name: member_id - type: static name: genre value: comedy demographics: table: demographics relationships: phone_numbers: constraints: - type: reference parent: id name: demographic_id phone_numbers: movies: 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. animals: relationships: dog_toy: model: dog_toys constraints: - parent: toy_id name: id - type: static parent: type value: Dog cat_toy: model: cat_toys constraints: - parent: toy_id name: id - type: static parent: type value: Cat dog_toys: cat_toys: Partitioner Example 1: dogs: table: animals partitioners: - name: type value: Dog - name: deleted value: false Partitioner Example 2: owners: relationships: dogs: constraints: - name: owner_id parent: id dogs: table: animals partitioners: - name: type value: Dog - name: deleted value: false Patients: patients: relationships: patient_payments: constraints: - type: reference parent: id name: patient_id patient_field_values: constraints: - type: reference parent: id name: patient_id patient_field_values: relationships: fields: constraints: - type: reference parent: field_id name: id patient_payments: fields: