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

     1  /* SQLite does not support dropping columns, hence we must create a temp table */
     2  CREATE TEMPORARY TABLE identity_images_backup(
     3      key_uid VARCHAR,
     4      name VARCHAR,
     5      image_payload BLOB NOT NULL,
     6      width int,
     7      height int,
     8      file_size int,
     9      resize_target int,
    10      PRIMARY KEY (key_uid, name) ON CONFLICT REPLACE
    11  ) WITHOUT ROWID;
    12  
    13  INSERT INTO identity_images_backup SELECT key_uid, name, image_payload, width, height, file_size, resize_target FROM identity_images;
    14  
    15  DROP TABLE identity_images;
    16  
    17  
    18  CREATE TABLE IF NOT EXISTS identity_images(
    19      key_uid VARCHAR,
    20      name VARCHAR,
    21      image_payload BLOB NOT NULL,
    22      width int,
    23      height int,
    24      file_size int,
    25      resize_target int,
    26      PRIMARY KEY (key_uid, name) ON CONFLICT REPLACE
    27  ) WITHOUT ROWID;
    28  
    29  
    30  INSERT INTO identity_images SELECT key_uid, name, image_payload, width, height, file_size, resize_target FROM identity_images_backup;
    31  
    32  DROP TABLE identity_images_backup;