Unique Constraint - Definição do Glossário de CI/CD
Uma unique constraint garante que nenhuma linha compartilhe o mesmo valor em uma coluna ou conjunto de colunas, rejeitando inserts duplicados no nível do banco de dados.
Em migrations
Adicionar uma unique constraint a dados existentes falha se já houver duplicatas, então uma migration precisa limpar ou de-duplicar as linhas primeiro. O CI detecta isso quando a migration roda contra um snapshot realista.
Guias relacionados
Primary Key - CI/CD Glossary DefinitionPrimary Key: A primary key is the column (or set of columns) that uniquely identifies each row in a table. It…
Referential Integrity - CI/CD Glossary DefinitionReferential Integrity: Referential integrity is the guarantee that every foreign key points at a row that act…