This commit is contained in:
seb
2026-10-11 17:26:11 +02:00
parent 7ffb21aabb
commit 7f4092971d
17 changed files with 3076 additions and 2616 deletions

View File

@@ -0,0 +1,5 @@
import * as source from '../../mssql/queries/attributevaluepic.js';
import { translateQueries } from './translate.js';
const queries = translateQueries(source, 'attributevaluepic');
export const { ADD, DELETE_BY_ATTRIBUTE_VALUE, GET_FIRST_PIC_BY_ATTRIBUTE_VALUE, GET_NEXT_SORT } = queries;

View File

@@ -284,6 +284,19 @@ CREATE TABLE IF NOT EXISTS brandpic (
);
`;
export const INIT_ATTRIBUTEVALUEPIC = `
CREATE TABLE IF NOT EXISTS attributevaluepic (
id INTEGER PRIMARY KEY AUTOINCREMENT,
attributevalue_id INTEGER NOT NULL,
pic_id INTEGER NOT NULL,
sort INTEGER NOT NULL DEFAULT 0,
UNIQUE (attributevalue_id, pic_id),
UNIQUE (attributevalue_id, sort),
FOREIGN KEY (attributevalue_id) REFERENCES attributevalue(id) ON DELETE CASCADE,
FOREIGN KEY (pic_id) REFERENCES pic(id) ON DELETE CASCADE
);
`;
export const INIT_ARTICLELISTARTICLE = `
CREATE TABLE IF NOT EXISTS articlelistarticle (
id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -853,6 +866,7 @@ export const SCHEMA_SCRIPTS = [
INIT_ARTICLEEAN,
INIT_ARTICLEPIC,
INIT_BRANDPIC,
INIT_ATTRIBUTEVALUEPIC,
INIT_ARTICLELISTARTICLE,
INIT_OPTIONSLISTARTICLE,
INIT_CATEGORYARTICLE,