u
This commit is contained in:
10
src/sql/articlepic.js
Normal file
10
src/sql/articlepic.js
Normal file
@@ -0,0 +1,10 @@
|
||||
export const GET_NEXT_SORT = `
|
||||
SELECT ISNULL(MAX(sort), -1) + 1 AS sort
|
||||
FROM articlepic
|
||||
WHERE article_id = @articleId
|
||||
`;
|
||||
|
||||
export const ADD = `
|
||||
INSERT INTO articlepic (article_id, pic_id, sort)
|
||||
VALUES (@articleId, @picId, @sort)
|
||||
`;
|
||||
9
src/sql/pic.js
Normal file
9
src/sql/pic.js
Normal file
@@ -0,0 +1,9 @@
|
||||
export const CREATE = `
|
||||
INSERT INTO pic (
|
||||
w, h, size, hash, thumbw, thumbh, thumbhash, source, [binary], thumbbinary
|
||||
)
|
||||
OUTPUT INSERTED.id
|
||||
VALUES (
|
||||
@w, @h, @size, @hash, @thumbw, @thumbh, @thumbhash, @source, @binary, @thumbbinary
|
||||
)
|
||||
`;
|
||||
Reference in New Issue
Block a user