This repository has been archived on 2025-02-03. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2025-02-03/src/sql/init_version_2.sql

32 lines
791 B
SQL

--
-- Let's get rid of the first20bytesofencryptedmessage field in the inventory table.
--
CREATE TEMP TABLE `inventory_backup` (
`hash` blob ,
`objecttype` text ,
`streamnumber` int ,
`payload` blob ,
`receivedtime` int ,
UNIQUE(hash) ON CONFLICT REPLACE
) ;
INSERT INTO `inventory_backup` SELECT hash, objecttype, streamnumber, payload, receivedtime FROM inventory;
DROP TABLE inventory;
CREATE TABLE `inventory` (
`hash` blob ,
`objecttype` text ,
`streamnumber` int ,
`payload` blob ,
`receivedtime` int ,
UNIQUE(hash) ON CONFLICT REPLACE
) ;
INSERT INTO inventory SELECT hash, objecttype, streamnumber, payload, receivedtime FROM inventory_backup;
DROP TABLE inventory_backup;
UPDATE settings SET value = 3 WHERE key = 'version';