1
vote
Enforce unique constraint without denormalization
If a task can belong only to one service, the second data model is the correct one. To enforce your constraint, you have to add a redundant copy of environment to task:
add a new column environment ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
schema × 1052database-design × 432
mysql × 228
postgresql × 194
sql-server × 173
oracle × 75
permissions × 63
normalization × 37
performance × 34
erd × 30
mongodb × 29
sql-server-2008 × 27
migration × 24
sql-server-2008-r2 × 23
table × 21
nosql × 21
foreign-key × 20
users × 20
relational-theory × 19
primary-key × 18
best-practices × 18
sql-server-2012 × 17
index × 17
security × 16
optimization × 15