src/pEpEngine.c
branchsync
changeset 3806 b9c98a86b791
parent 3762 55501092d6e3
child 3829 e1d53d19bb4d
child 3841 f9d1e79ae49b
child 3843 cbdc7255c019
child 3863 e10b2a4785a5
     1.1 --- a/src/pEpEngine.c	Mon Jun 03 13:58:16 2019 +0200
     1.2 +++ b/src/pEpEngine.c	Mon Jun 03 14:56:29 2019 +0200
     1.3 @@ -968,6 +968,7 @@
     1.4                  "   timestamp integer default (datetime('now')),\n"
     1.5                  "   primary key (address, user_id)\n"
     1.6                  ");\n"
     1.7 +                "create index if not exists identity_userid_addr on identity(address, user_id);\n"
     1.8                  "create table if not exists trust (\n"
     1.9                  "   user_id text not null\n"
    1.10                  "       references person (id)\n"
    1.11 @@ -1423,6 +1424,17 @@
    1.12                  if (status != PEP_STATUS_OK)
    1.13                      return status;
    1.14              }
    1.15 +            if (version < 12) {
    1.16 +                int_result = sqlite3_exec(
    1.17 +                    _session->db,
    1.18 +                    "create index if not exists identity_userid_addr on identity(address, user_id);\n"
    1.19 +                    ,
    1.20 +                    NULL,
    1.21 +                    NULL,
    1.22 +                    NULL
    1.23 +                );
    1.24 +                assert(int_result == SQLITE_OK);                
    1.25 +            }
    1.26          }        
    1.27          else { 
    1.28              // Version from DB was 0, it means this is initial setup.