feat(articlesupplier): add sort column, reorder method, and update queries and schema

This commit is contained in:
seb
2026-09-17 12:00:41 +02:00
parent 4c196c7209
commit af52ff595f
16 changed files with 264 additions and 78 deletions

View File

@@ -539,10 +539,12 @@ BEGIN
sku NVARCHAR(100) NULL,
stock FLOAT NULL,
pu FLOAT NOT NULL CONSTRAINT DF_articlesupplier_pu DEFAULT 1,
sort INT NOT NULL CONSTRAINT DF_articlesupplier_sort DEFAULT 0,
CONSTRAINT FK_articlesupplier_article FOREIGN KEY (article_id) REFERENCES article(id) ON DELETE CASCADE,
CONSTRAINT FK_articlesupplier_entity FOREIGN KEY (entity_id) REFERENCES entity(id) ON DELETE CASCADE,
CONSTRAINT FK_articlesupplier_price FOREIGN KEY (price_id) REFERENCES price(id) ON DELETE SET NULL,
CONSTRAINT UQ_articlesupplier_article_entity UNIQUE (article_id, entity_id)
CONSTRAINT FK_articlesupplier_price FOREIGN KEY (price_id) REFERENCES price(id) ON DELETE NO ACTION,
CONSTRAINT UQ_articlesupplier_article_entity UNIQUE (article_id, entity_id),
CONSTRAINT UQ_articlesupplier_article_sort UNIQUE (article_id, sort)
);
CREATE INDEX IX_articlesupplier_article_entity