/ src / sql / initialize_schema.sql
initialize_schema.sql
  1  CREATE TABLE `inbox` (
  2     `msgid` blob,
  3     `toaddress` text,
  4     `fromaddress` text,
  5     `subject` text,
  6     `received` text,
  7     `message` text,
  8     `folder` text,
  9     `encodingtype` int,
 10     `read` bool,
 11     `sighash` blob,
 12  UNIQUE(msgid) ON CONFLICT REPLACE
 13  ) ;
 14  
 15  CREATE TABLE `sent` (
 16     `msgid` blob,
 17     `toaddress` text,
 18     `toripe` blob,
 19     `fromaddress` text,
 20     `subject` text,
 21     `message` text,
 22     `ackdata` blob,
 23     `senttime` integer,
 24     `lastactiontime` integer,
 25     `sleeptill` integer,
 26     `status` text,
 27     `retrynumber` integer,
 28     `folder` text,
 29     `encodingtype` int,
 30     `ttl` int
 31  ) ;
 32  
 33  
 34  CREATE TABLE `subscriptions` (
 35     `label` text,
 36     `address` text,
 37     `enabled` bool
 38  ) ;
 39  
 40  
 41  CREATE TABLE `addressbook` (
 42     `label` text,
 43     `address` text,
 44     UNIQUE(address) ON CONFLICT IGNORE
 45  ) ;
 46  
 47  
 48   CREATE TABLE `blacklist` (
 49      `label` text,
 50      `address` text,
 51      `enabled` bool
 52   ) ;
 53  
 54  
 55   CREATE TABLE `whitelist` (
 56      `label` text,
 57      `address` text,
 58      `enabled` bool
 59   ) ;
 60  
 61  
 62  CREATE TABLE `pubkeys` (
 63      `address` text,
 64      `addressversion` int,
 65      `transmitdata` blob,
 66      `time` int,
 67      `usedpersonally` text,
 68      UNIQUE(address) ON CONFLICT REPLACE
 69  ) ;
 70  
 71  
 72  CREATE TABLE `inventory` (
 73      `hash` blob,
 74      `objecttype` int,
 75      `streamnumber` int,
 76      `payload` blob,
 77      `expirestime` integer,
 78      `tag` blob,
 79      UNIQUE(hash) ON CONFLICT REPLACE
 80  ) ;
 81  
 82  
 83  INSERT INTO subscriptions VALUES ('Bitmessage new releases/announcements', 'BM-GtovgYdgs7qXPkoYaRgrLFuFKz1SFpsw', 1);
 84  
 85  
 86   CREATE TABLE `settings` (
 87      `key` blob,
 88      `value` blob,
 89      UNIQUE(key) ON CONFLICT REPLACE
 90   ) ;
 91  
 92  INSERT INTO settings VALUES('version','11');
 93  
 94  INSERT INTO settings VALUES('lastvacuumtime', CAST(strftime('%s', 'now') AS STR) );
 95  
 96  CREATE TABLE `objectprocessorqueue` (
 97      `objecttype` int,
 98      `data` blob,
 99      UNIQUE(objecttype, data) ON CONFLICT REPLACE
100  ) ;