/ src / sql / init_version_2.sql
init_version_2.sql
 1  --
 2  -- Let's get rid of the first20bytesofencryptedmessage field in the inventory table.
 3  --
 4  
 5  CREATE TEMP TABLE `inventory_backup` (
 6      `hash` blob ,
 7      `objecttype` text ,
 8      `streamnumber` int ,
 9      `payload` blob ,
10      `receivedtime` int ,
11      UNIQUE(hash) ON CONFLICT REPLACE
12  ) ;
13  
14  INSERT INTO `inventory_backup` SELECT  hash, objecttype, streamnumber, payload, receivedtime FROM inventory;
15  
16  DROP TABLE inventory;
17  
18  CREATE TABLE `inventory` (
19      `hash` blob ,
20      `objecttype` text ,
21      `streamnumber` int ,
22      `payload` blob ,
23      `receivedtime` int ,
24      UNIQUE(hash) ON CONFLICT REPLACE
25  ) ;
26  
27  INSERT INTO inventory SELECT hash, objecttype, streamnumber, payload, receivedtime FROM inventory_backup;
28  
29  DROP TABLE inventory_backup;