i tried - but it always gives me this error
mattermost=# select title,delete_at,id,board_id from focalboard_blocks_history where delete_at = '1676899974596' ;
title | delete_at | id | board_id
------------+---------------+-----------------------------+-----------------------------
asd | 1676899974596 | chde3i1otm7r55ygfz1wroqz8zc | bzimxi419bjnjbp7ru7eeuwdeno
Board view | 1676899974596 | vgzwfyy5w33bytkie6tuszrkkxo | bzimxi419bjnjbp7ru7eeuwdeno
card2 | 1676899974596 | cs3r9oi6dh3n83kjfck3ex8mn3e | bzimxi419bjnjbp7ru7eeuwdeno
(3 rows)
mattermost=# insert into focalboard_blocks select * from focalboard_blocks_history where id = 'chde3i1otm7r55ygfz1wroqz8zc';
ERROR: duplicate key value violates unique constraint "focalboard_blocks_pkey1"
DETAIL: Key (id)=(chde3i1otm7r55ygfz1wroqz8zc) already exists.
no rows in the target table
mattermost=# select title,delete_at,id from focalboard_blocks where id = 'chde3i1otm7r55ygfz1wroqz8zc' ;
title | delete_at | id
-------+-----------+----
(0 rows)
okay lets have a look at duplicate rows
mattermost=# select title,delete_at,id from focalboard_blocks_history where id = 'chde3i1otm7r55ygfz1wroqz8zc' ;
title | delete_at | id
-------+---------------+-----------------------------
| 0 | chde3i1otm7r55ygfz1wroqz8zc
asd | 0 | chde3i1otm7r55ygfz1wroqz8zc
asd | 0 | chde3i1otm7r55ygfz1wroqz8zc
asd | 1676899974596 | chde3i1otm7r55ygfz1wroqz8zc
(4 rows)
okay - only inserting one row
mattermost=# insert into focalboard_blocks select * from focalboard_blocks_history where id = 'chde3i1otm7r55ygfz1wroqz8zc' and delete_at = '1676899974596';
ERROR: null value in column "channel_id" violates not-null constraint
DETAIL: Failing row contains (chde3i1otm7r55ygfz1wroqz8zc, 2023-02-20 14:32:54.594469+01, bzimxi419bjnjbp7ru7eeuwdeno, 1, card, asd, {"contentOrder":[],"icon":"💶","isTemplate":false,"properties"..., 1676899456123, 1676899974596, 1676899974596, null, th19r78njpfgub1771m88mshge, null, th19r78njpfgub1771m88mshge, bzimxi419bjnjbp7ru7eeuwdeno).
i am confused …