status-go/protocol/migrations/sqlite/1683707289_recreate_deleted_for_mes.up.sql
frank 0197e6c484
Feat/sync local deleted message (#3476)
* sync local deleted messages

* rebase

* add REPLACE

* fix lint

* defer rows.Close() / rename function

* add local pair test

* replace unused clock with _
2023-05-12 16:31:34 +08:00

12 lines
408 B
SQL

CREATE TABLE IF NOT EXISTS user_messages_deleted_for_mes_bk (
clock INTEGER NOT NULL,
message_id VARCHAR NOT NULL,
PRIMARY KEY (message_id)
);
INSERT OR REPLACE INTO user_messages_deleted_for_mes_bk SELECT clock, message_id FROM user_messages_deleted_for_mes;
DROP TABLE user_messages_deleted_for_mes;
ALTER TABLE user_messages_deleted_for_mes_bk RENAME TO user_messages_deleted_for_mes;