nodebb-plugin-dbsearch 6.2.7 → 6.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/postgres.js
CHANGED
|
@@ -130,7 +130,7 @@ exports.chat.index = async (data, ids) => {
|
|
|
130
130
|
try {
|
|
131
131
|
await db.pool.query({
|
|
132
132
|
name: `dbsearch-searchIndex-chat`,
|
|
133
|
-
text: `INSERT INTO "searchchat" SELECT d."id", d."data"->>'content' "content", (d."data"->>'
|
|
133
|
+
text: `INSERT INTO "searchchat" SELECT d."id", d."data"->>'content' "content", (d."data"->>'rid')::bigint "rid", (d."data"->>'uid')::text "uid" FROM UNNEST($1::text[], $2::jsonb[]) d("id", "data") ON CONFLICT ("id") DO UPDATE SET "content" = COALESCE(EXCLUDED."content", "searchchat"."content"), "uid" = COALESCE(EXCLUDED."uid", "searchchat"."uid"), "rid" = COALESCE(EXCLUDED."rid", "searchchat"."rid")`,
|
|
134
134
|
values: [ids, data],
|
|
135
135
|
});
|
|
136
136
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-dbsearch",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.9",
|
|
4
4
|
"description": "A Plugin that lets users search posts and topics",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -27,6 +27,6 @@
|
|
|
27
27
|
"eslint-plugin-import": "2.25.2"
|
|
28
28
|
},
|
|
29
29
|
"nbbpm": {
|
|
30
|
-
"compatibility": "^
|
|
30
|
+
"compatibility": "^4.0.0"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -46,14 +46,18 @@ module.exports = {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
if (mainDB === 'postgres') {
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
try {
|
|
50
|
+
await db.client.query('ALTER TABLE searchtopic ALTER COLUMN id TYPE text USING id::bigint');
|
|
51
|
+
await db.client.query('ALTER TABLE searchtopic ALTER COLUMN uid TYPE text USING uid::bigint');
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
await db.client.query('ALTER TABLE searchpost ALTER COLUMN id TYPE text USING id::bigint');
|
|
54
|
+
await db.client.query('ALTER TABLE searchpost ALTER COLUMN uid TYPE text USING uid::bigint');
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
await db.client.query('ALTER TABLE searchchat ALTER COLUMN id TYPE text USING id::bigint');
|
|
57
|
+
await db.client.query('ALTER TABLE searchchat ALTER COLUMN uid TYPE text USING uid::bigint');
|
|
58
|
+
} catch (err) {
|
|
59
|
+
console.error(err.stack);
|
|
60
|
+
}
|
|
57
61
|
}
|
|
58
62
|
},
|
|
59
63
|
};
|