mysql - DB Design - Contextual constraints -


i have pair of tables parent-child relationship.

  domain:      id int not null auto_increment primary_key      domain varchar(100) not null    domain_url:      id int not null auto_increment primary key      domain_id int not null      path varchar(512) 

here want keep path unique in 1 domain. across domain path can duplicating. best constraint apply on path.

should focus on composite key between domain_id , path. composite key reliable solution?

i think want apply unique constraint in domain_url table on domain_id, path composite key. enforce requirement "to keep path unique in 1 domain"


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -