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

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