This commit is contained in:
seb
2026-10-04 21:22:05 +02:00
parent 0268583ae3
commit 4718cb5726
48 changed files with 758 additions and 758 deletions

View File

@@ -222,10 +222,10 @@ CREATE TABLE IF NOT EXISTS article (
brand_id INTEGER,
articlelist_id INTEGER,
optionslist_id INTEGER,
is_father INTEGER NOT NULL DEFAULT 0,
fatherarticle_id INTEGER,
fathersort INTEGER NOT NULL DEFAULT 0,
fatherattributename_id INTEGER,
is_parent INTEGER NOT NULL DEFAULT 0,
parentarticle_id INTEGER,
parentsort INTEGER NOT NULL DEFAULT 0,
parentattributename_id INTEGER,
created_at TEXT NOT NULL DEFAULT (${UTC_NOW}),
updated_at TEXT NOT NULL DEFAULT (${UTC_NOW}),
UNIQUE (company_id, sku),
@@ -234,12 +234,12 @@ CREATE TABLE IF NOT EXISTS article (
FOREIGN KEY (brand_id) REFERENCES brand(id) ON DELETE SET NULL,
FOREIGN KEY (articlelist_id) REFERENCES articlelist(id) ON DELETE SET NULL,
FOREIGN KEY (optionslist_id) REFERENCES optionslist(id) ON DELETE SET NULL,
FOREIGN KEY (fatherarticle_id) REFERENCES article(id) ON DELETE NO ACTION,
FOREIGN KEY (fatherattributename_id) REFERENCES attributename(id) ON DELETE NO ACTION
FOREIGN KEY (parentarticle_id) REFERENCES article(id) ON DELETE NO ACTION,
FOREIGN KEY (parentattributename_id) REFERENCES attributename(id) ON DELETE NO ACTION
);
CREATE UNIQUE INDEX IF NOT EXISTS UQ_article_fatherarticle_fathersort
ON article(fatherarticle_id, fathersort)
WHERE fatherarticle_id IS NOT NULL;
CREATE UNIQUE INDEX IF NOT EXISTS UQ_article_parentarticle_parentsort
ON article(parentarticle_id, parentsort)
WHERE parentarticle_id IS NOT NULL;
`;
export const INIT_ARTICLEEAN = `