github.com/status-im/status-go@v1.1.0/multiaccounts/migrations/sql/1606224181_drop_photo_path_from_accounts.up.sql (about)

     1  /* Copy the accounts table into a temp table, EXCLUDE the `photoPath` and INCLUDE `identicon` column */
     2  CREATE TEMPORARY TABLE accounts_backup(
     3      keyUid VARCHAR PRIMARY KEY,
     4      name TEXT NOT NULL,
     5      loginTimestamp BIG INT,
     6      identicon TEXT,
     7      keycardPairing TEXT
     8  ) WITHOUT ROWID;
     9  INSERT INTO accounts_backup SELECT keyUid, name, loginTimestamp, photoPath, keycardPairing FROM accounts;
    10  
    11  /* Drop the old accounts table and recreate with all columns EXCLUDING `photoPath` and INCLUDING `identicon`*/
    12  DROP TABLE accounts;
    13  CREATE TABLE accounts(
    14      keyUid VARCHAR PRIMARY KEY,
    15      name TEXT NOT NULL,
    16      loginTimestamp BIG INT,
    17      identicon TEXT,
    18      keycardPairing TEXT
    19   ) WITHOUT ROWID;
    20  INSERT INTO accounts SELECT keyUid, name, loginTimestamp, identicon, keycardPairing FROM accounts_backup;
    21  
    22  /* Tidy up, drop the temp table */
    23  DROP TABLE accounts_backup;