This commit is contained in:
seb
2026-10-09 18:26:01 +02:00
parent 07c4f0bff9
commit 178055f1d8
13 changed files with 80 additions and 25 deletions

View File

@@ -1,10 +1,14 @@
export const CREATE = `
INSERT INTO pic (
w, h, size, hash, thumbw, thumbh, thumbhash, source, fullbinary, thumbbinary
w, h, size, hash, thumbw, thumbh, thumbhash,
smallthumbw, smallthumbh, smallthumbbinary,
source, fullbinary, thumbbinary
)
OUTPUT INSERTED.id
VALUES (
@w, @h, @size, @hash, @thumbw, @thumbh, @thumbhash, @source, @fullbinary, @thumbbinary
@w, @h, @size, @hash, @thumbw, @thumbh, @thumbhash,
@smallthumbw, @smallthumbh, @smallthumbbinary,
@source, @fullbinary, @thumbbinary
)
`;

View File

@@ -95,9 +95,12 @@ BEGIN
thumbw INT NOT NULL,
thumbh INT NOT NULL,
thumbhash NVARCHAR(64) NOT NULL,
smallthumbw INT NOT NULL,
smallthumbh INT NOT NULL,
source NVARCHAR(MAX) NOT NULL,
fullbinary VARBINARY(MAX) NOT NULL,
thumbbinary VARBINARY(MAX) NOT NULL,
smallthumbbinary VARBINARY(MAX) NOT NULL,
CONSTRAINT UQ_pic_hash UNIQUE (hash)
);
END
@@ -1220,4 +1223,3 @@ export const SCHEMA_SCRIPTS = [
INIT_SHIPPING,
INIT_PACKAGE,
];

View File

@@ -8,10 +8,12 @@ export const {
export const CREATE = `
INSERT INTO pic (
w, h, size, hash, thumbw, thumbh, thumbhash, source
w, h, size, hash, thumbw, thumbh, thumbhash,
smallthumbw, smallthumbh, smallthumbbinary, source
)
VALUES (
@w, @h, @size, @hash, @thumbw, @thumbh, @thumbhash, @source
@w, @h, @size, @hash, @thumbw, @thumbh, @thumbhash,
@smallthumbw, @smallthumbh, @smallthumbbinary, @source
)
RETURNING id
`;

View File

@@ -43,6 +43,9 @@ CREATE TABLE IF NOT EXISTS pic (
thumbw INTEGER NOT NULL,
thumbh INTEGER NOT NULL,
thumbhash TEXT NOT NULL,
smallthumbw INTEGER NOT NULL,
smallthumbh INTEGER NOT NULL,
smallthumbbinary BLOB NOT NULL,
source TEXT NOT NULL
);
`;