Internal Server error when having Content Version Plugin activated and trying to update a Collection Type
Steps to reproduce the behavior
Setup strapi with a postgres connection
Download and acvtivate Content Versioning Plugin
Create generic collection type (i only had one property called title)
Update said Collection Type
Expected behavior
Update Collection Type
Screenshots
If applicable, add screenshots to help explain your problem.
Code snippets
Output:
[2024-02-08 10:04:39.801] http: POST /content-manager/collection-types/api::film-work.film-work/1/actions/publish (1340
ms) 200
[2024-02-08 10:04:51.110] error: SELECT a.id, a.version_number, a.published_at
FROM film_works a WHERE NOT EXISTS (
SELECT 1 FROM film_works WHERE vuid=a.vuid AND (
CASE WHEN a.published_at is null THEN (
published_at is not null OR version_number > a.version_number
)
ELSE published_at is not null AND version_number > a.version_number
END
)
) AND vuid = '3ee899e4-2857-407a-bfef-dc4db534c1e6' - relation "film_works" does not exist
error: SELECT a.id, a.version_number, a.published_at
FROM film_works a WHERE NOT EXISTS (
SELECT 1 FROM film_works WHERE vuid=a.vuid AND (
CASE WHEN a.published_at is null THEN (
published_at is not null OR version_number > a.version_number
)
ELSE published_at is not null AND version_number > a.version_number
END
)
) AND vuid = '3ee899e4-2857-407a-bfef-dc4db534c1e6' - relation "film_works" does not exist
at Parser.parseErrorMessage (C:\Users\StretzS\projects\avefi_proto\node_modules\pg-protocol\dist\parser.js:287:98)
at Parser.handlePacket (C:\Users\StretzS\projects\avefi_proto\node_modules\pg-protocol\dist\parser.js:126:29)
at Parser.parse (C:\Users\StretzS\projects\avefi_proto\node_modules\pg-protocol\dist\parser.js:39:38)
at Socket. (C:\Users\StretzS\projects\avefi_proto\node_modules\pg-protocol\dist\index.js:11:42)
at Socket.emit (node:events:514:28)
at Socket.emit (node:domain:488:12)
at addChunk (node:internal/streams/readable:376:12)
at readableAddChunk (node:internal/streams/readable:349:9)
at Readable.push (node:internal/streams/readable:286:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
System
Node.js version:
NPM version:
Strapi version:
Database:
Operating system:
Additional context
Can be fixed by setting the schema before executing update statement or fully qualify table including the schema
Bug report
Describe the bug
Internal Server error when having Content Version Plugin activated and trying to update a Collection Type
Steps to reproduce the behavior
Expected behavior
Update Collection Type
Screenshots
If applicable, add screenshots to help explain your problem.
Code snippets
Output: [2024-02-08 10:04:39.801] http: POST /content-manager/collection-types/api::film-work.film-work/1/actions/publish (1340 ms) 200 [2024-02-08 10:04:51.110] error: SELECT a.id, a.version_number, a.published_at FROM film_works a WHERE NOT EXISTS ( SELECT 1 FROM film_works WHERE vuid=a.vuid AND ( CASE WHEN a.published_at is null THEN ( published_at is not null OR version_number > a.version_number ) ELSE published_at is not null AND version_number > a.version_number END ) ) AND vuid = '3ee899e4-2857-407a-bfef-dc4db534c1e6' - relation "film_works" does not exist error: SELECT a.id, a.version_number, a.published_at FROM film_works a WHERE NOT EXISTS ( SELECT 1 FROM film_works WHERE vuid=a.vuid AND ( CASE WHEN a.published_at is null THEN ( published_at is not null OR version_number > a.version_number ) ELSE published_at is not null AND version_number > a.version_number END ) ) AND vuid = '3ee899e4-2857-407a-bfef-dc4db534c1e6' - relation "film_works" does not exist at Parser.parseErrorMessage (C:\Users\StretzS\projects\avefi_proto\node_modules\pg-protocol\dist\parser.js:287:98) (C:\Users\StretzS\projects\avefi_proto\node_modules\pg-protocol\dist\index.js:11:42)
at Socket.emit (node:events:514:28)
at Socket.emit (node:domain:488:12)
at addChunk (node:internal/streams/readable:376:12)
at readableAddChunk (node:internal/streams/readable:349:9)
at Readable.push (node:internal/streams/readable:286:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
at Parser.handlePacket (C:\Users\StretzS\projects\avefi_proto\node_modules\pg-protocol\dist\parser.js:126:29)
at Parser.parse (C:\Users\StretzS\projects\avefi_proto\node_modules\pg-protocol\dist\parser.js:39:38) at Socket.
System
Additional context
Can be fixed by setting the schema before executing update statement or fully qualify table including the schema