fix: the SQL to write producer column into songs table
This commit is contained in:
parent
2b04092f0a
commit
c7b0174742
@ -18,12 +18,19 @@ export async function collectSongs() {
|
||||
|
||||
export async function insertIntoSongs(sql: Psql, aid: number) {
|
||||
await sql`
|
||||
INSERT INTO songs (aid, published_at, duration, image)
|
||||
INSERT INTO songs (aid, published_at, duration, image, producer)
|
||||
VALUES (
|
||||
$1,
|
||||
(SELECT published_at FROM bilibili_metadata WHERE aid = ${aid}),
|
||||
(SELECT duration FROM bilibili_metadata WHERE aid = ${aid}),
|
||||
(SELECT cover_url FROM bilibili_metadata WHERE aid = ${aid})
|
||||
(SELECT cover_url FROM bilibili_metadata WHERE aid = ${aid}),
|
||||
(
|
||||
SELECT username
|
||||
FROM bilibili_user bu
|
||||
JOIN bilibili_metadata bm
|
||||
ON bm.uid = bu.uid
|
||||
WHERE bm.aid = ${aid}
|
||||
)
|
||||
)
|
||||
ON CONFLICT DO NOTHING
|
||||
`;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user