Steps to reproduce
We’ve got the problems in 8.1.0 and 9.0.0
Publish a post
Delete the post (with delete or delete all characters + save)
Confirm delete
Reload Mattermost app
Expected behaviour
The post should be deleted.
Observed behaviour
Mattermost Desktop App + web ui: the post disappears but reappears after reload or channel switching.
Mattermost iOS App
No error message with the delete function
If I edit the message, delete all characters and save, I’ve got the message »A problem occurred while editing this message. Please try again.«
In the javascript console I’ve got a 500 for https://our.mattermost.example.com/api/v4/posts/5cpws7wotpy8dxxnepazmxtpza with the following detailed error failed to update Posts: pq: function jsonb_set(text, unknown, unknown) does not exist
In the server mattermost.log I’ve got the same message:
{"timestamp":"2023-09-27 09:00:06.363 +02:00","level":"error","msg":"Unable to delete the post.","caller":"web/context.go:117","path":"/api/v4/posts/k3ss75r1rirq9xxwkwwkbtrsue","request_id":"y5on8oknk7futetbte51ii9zda","ip_addr":"87.79.xx.xx","user_id":"577e365riprofda4ps5y14rwea","method":"DELETE","err_where":"DeletePost","http_code":500,"error":"DeletePost: Unable to delete the post., failed to update Posts: pq: function jsonb_set(text, unknown, unknown) does not exist"}
I’m unable to find any solutions for this problem with google.
We’ve migrated our database before upgrading to version 8 from MySQL to postgresql with pgLoader.
We’ve already fixed some wrong smallint types (= converted to boolean) in teammembers and channelmembers.
Thank you for the info @dombn I think the correct DDL is as following:
CREATE TABLE IF NOT EXISTS public.posts (
id character varying(26) NOT NULL,
createat bigint,
updateat bigint,
deleteat bigint,
userid character varying(26),
channelid character varying(26),
rootid character varying(26),
originalid character varying(26),
message character varying(65535),
type character varying(26),
props jsonb,
hashtags character varying(1000),
filenames character varying(4000),
fileids character varying(300),
hasreactions boolean,
editat bigint,
ispinned boolean,
remoteid character varying(26)
)
Where props is a jsonb, hashtags, filenames and fileids are size constrained varchars.