This commit is contained in:
seb
2026-10-08 03:02:56 +02:00
parent 69eb2c9a0d
commit 4e308cc177
7 changed files with 65 additions and 13 deletions

View File

@@ -418,11 +418,13 @@ BEGIN
article_id INT NOT NULL,
ean NVARCHAR(50) NOT NULL,
CONSTRAINT FK_articleean_article FOREIGN KEY (article_id) REFERENCES article(id) ON DELETE CASCADE,
CONSTRAINT UQ_articleean_ean UNIQUE (ean)
CONSTRAINT UQ_articleean_article_ean UNIQUE (article_id, ean)
);
-- Hot path: getBySku EANs by article (UQ is ean-leading only)
-- Hot path: getBySku EANs by article
CREATE INDEX IX_articleean_article_ean
ON articleean (article_id, ean);
CREATE INDEX IX_articleean_ean
ON articleean (ean);
END
`;