github.com/status-im/status-go@v1.1.0/appdatabase/migrations/sql/1706097653_migration_order_fix.up.sql (about)

     1  CREATE TABLE IF NOT EXISTS "token_preferences" (
     2      "key" TEXT NOT NULL, "position" INTEGER NOT NULL DEFAULT -1, "group_position" INTEGER NOT NULL DEFAULT -1, "visible" BOOLEAN NOT NULL DEFAULT TRUE, "community_id" TEXT NOT NULL DEFAULT '', "testnet" BOOLEAN NOT NULL DEFAULT FALSE, PRIMARY KEY ("key", "testnet")
     3  );
     4  
     5  CREATE TABLE "settings2" (
     6      address VARCHAR NOT NULL, chaos_mode BOOLEAN DEFAULT false, currency VARCHAR DEFAULT 'usd', current_network VARCHAR NOT NULL, custom_bootnodes BLOB, custom_bootnodes_enabled BLOB, dapps_address VARCHAR NOT NULL, eip1581_address VARCHAR, fleet VARCHAR, hide_home_tooltip BOOLEAN DEFAULT false, installation_id VARCHAR NOT NULL, key_uid VARCHAR NOT NULL, keycard_instance_uid VARCHAR, keycard_paired_on UNSIGNED BIGINT, keycard_pairing VARCHAR, last_updated UNSIGNED BIGINT, log_level VARCHAR, mnemonic VARCHAR, name VARCHAR NOT NULL, networks BLOB NOT NULL, node_config BLOB, notifications_enabled BOOLEAN DEFAULT false, photo_path BLOB NOT NULL, pinned_mailservers BLOB, preferred_name VARCHAR, preview_privacy BOOLEAN DEFAULT false, public_key VARCHAR NOT NULL, remember_syncing_choice BOOLEAN DEFAULT false, signing_phrase VARCHAR NOT NULL, stickers_packs_installed BLOB, stickers_recent_stickers BLOB, syncing_on_mobile_network BOOLEAN DEFAULT false, synthetic_id VARCHAR DEFAULT 'id' PRIMARY KEY, usernames BLOB, wallet_root_address VARCHAR NOT NULL, wallet_set_up_passed BOOLEAN DEFAULT false, wallet_visible_tokens VARCHAR, stickers_packs_pending BLOB, waku_enabled BOOLEAN DEFAULT false, waku_bloom_filter_mode BOOLEAN DEFAULT false, appearance INT NOT NULL DEFAULT 0, remote_push_notifications_enabled BOOLEAN DEFAULT FALSE, send_push_notifications BOOLEAN DEFAULT TRUE, push_notifications_server_enabled BOOLEAN DEFAULT FALSE, push_notifications_from_contacts_only BOOLEAN DEFAULT FALSE, push_notifications_block_mentions BOOLEAN DEFAULT FALSE, webview_allow_permission_requests BOOLEAN DEFAULT FALSE, use_mailservers BOOLEAN DEFAULT TRUE, link_preview_request_enabled BOOLEAN DEFAULT TRUE, link_previews_enabled_sites BLOB, profile_pictures_visibility INT NOT NULL DEFAULT 1, anon_metrics_should_send BOOLEAN DEFAULT false, messages_from_contacts_only BOOLEAN DEFAULT FALSE, default_sync_period INTEGER DEFAULT 777600, -- 9 days
     7      current_user_status BLOB, send_status_updates BOOLEAN DEFAULT TRUE, gif_recents BLOB, gif_favorites BLOB, opensea_enabled BOOLEAN DEFAULT false, profile_pictures_show_to INT NOT NULL DEFAULT 1, telemetry_server_url VARCHAR NOT NULL DEFAULT "", backup_enabled BOOLEAN DEFAULT TRUE, last_backup INT NOT NULL DEFAULT 0, backup_fetched BOOLEAN DEFAULT FALSE, auto_message_enabled BOOLEAN DEFAULT FALSE, gif_api_key TEXT NOT NULL DEFAULT "", display_name TEXT NOT NULL DEFAULT "", test_networks_enabled BOOLEAN NOT NULL DEFAULT FALSE, mutual_contact_enabled BOOLEAN DEFAULT FALSE, bio TEXT NOT NULL DEFAULT "", mnemonic_removed BOOLEAN NOT NULL DEFAULT FALSE, latest_derived_path INT NOT NULL DEFAULT "0", device_name TEXT NOT NULL DEFAULT "", wallet_accounts_position_change_clock INTEGER NOT NULL DEFAULT 0, profile_migration_needed BOOLEAN NOT NULL DEFAULT FALSE, is_sepolia_enabled BOOLEAN NOT NULL DEFAULT FALSE, url_unfurling_mode INT NOT NULL DEFAULT 1, omit_transfers_history_scan BOOLEAN NOT NULL DEFAULT FALSE, mnemonic_was_not_shown BOOLEAN NOT NULL DEFAULT FALSE, wallet_token_preferences_change_clock INTEGER NOT NULL DEFAULT 0, wallet_token_preferences_group_by_community BOOLEAN NOT NULL DEFAULT FALSE, wallet_show_community_asset_when_sending_tokens INTEGER NOT NULL DEFAULT TRUE, wallet_display_assets_below_balance BOOLEAN NOT NULL DEFAULT FALSE, wallet_display_assets_below_balance_threshold UNSIGNED BIGINT NOT NULL DEFAULT 100000000, wallet_collectible_preferences_change_clock INTEGER NOT NULL DEFAULT 0, wallet_collectible_preferences_group_by_collection BOOLEAN NOT NULL DEFAULT FALSE, wallet_collectible_preferences_group_by_community BOOLEAN NOT NULL DEFAULT FALSE
     8  ) WITHOUT ROWID;
     9  
    10  INSERT INTO
    11      settings2 (
    12          address, chaos_mode, currency, current_network, custom_bootnodes, custom_bootnodes_enabled, dapps_address, eip1581_address, fleet, hide_home_tooltip, installation_id, key_uid, keycard_instance_uid, keycard_paired_on, keycard_pairing, last_updated, log_level, mnemonic, name, networks, node_config, notifications_enabled, photo_path, pinned_mailservers, preferred_name, preview_privacy, public_key, remember_syncing_choice, signing_phrase, stickers_packs_installed, stickers_recent_stickers, syncing_on_mobile_network, synthetic_id, usernames, wallet_root_address, wallet_set_up_passed, wallet_visible_tokens, stickers_packs_pending, waku_enabled, waku_bloom_filter_mode, appearance, remote_push_notifications_enabled, send_push_notifications, push_notifications_server_enabled, push_notifications_from_contacts_only, push_notifications_block_mentions, webview_allow_permission_requests, use_mailservers, link_preview_request_enabled, link_previews_enabled_sites, profile_pictures_visibility, anon_metrics_should_send, messages_from_contacts_only, default_sync_period, current_user_status, send_status_updates, gif_recents, gif_favorites, opensea_enabled, profile_pictures_show_to, telemetry_server_url, backup_enabled, last_backup, backup_fetched, auto_message_enabled, gif_api_key, display_name, test_networks_enabled, mutual_contact_enabled, bio, mnemonic_removed, latest_derived_path, device_name, wallet_accounts_position_change_clock, profile_migration_needed, is_sepolia_enabled, url_unfurling_mode, omit_transfers_history_scan, wallet_show_community_asset_when_sending_tokens, wallet_display_assets_below_balance, wallet_display_assets_below_balance_threshold, wallet_collectible_preferences_change_clock, wallet_collectible_preferences_group_by_collection, wallet_collectible_preferences_group_by_community
    13      )
    14  SELECT
    15      address,
    16      chaos_mode,
    17      currency,
    18      current_network,
    19      custom_bootnodes,
    20      custom_bootnodes_enabled,
    21      dapps_address,
    22      eip1581_address,
    23      fleet,
    24      hide_home_tooltip,
    25      installation_id,
    26      key_uid,
    27      keycard_instance_uid,
    28      keycard_paired_on,
    29      keycard_pairing,
    30      last_updated,
    31      log_level,
    32      mnemonic,
    33      name,
    34      networks,
    35      node_config,
    36      notifications_enabled,
    37      photo_path,
    38      pinned_mailservers,
    39      preferred_name,
    40      preview_privacy,
    41      public_key,
    42      remember_syncing_choice,
    43      signing_phrase,
    44      stickers_packs_installed,
    45      stickers_recent_stickers,
    46      syncing_on_mobile_network,
    47      synthetic_id,
    48      usernames,
    49      wallet_root_address,
    50      wallet_set_up_passed,
    51      wallet_visible_tokens,
    52      stickers_packs_pending,
    53      waku_enabled,
    54      waku_bloom_filter_mode,
    55      appearance,
    56      remote_push_notifications_enabled,
    57      send_push_notifications,
    58      push_notifications_server_enabled,
    59      push_notifications_from_contacts_only,
    60      push_notifications_block_mentions,
    61      webview_allow_permission_requests,
    62      use_mailservers,
    63      link_preview_request_enabled,
    64      link_previews_enabled_sites,
    65      profile_pictures_visibility,
    66      anon_metrics_should_send,
    67      messages_from_contacts_only,
    68      default_sync_period,
    69      current_user_status,
    70      send_status_updates,
    71      gif_recents,
    72      gif_favorites,
    73      opensea_enabled,
    74      profile_pictures_show_to,
    75      telemetry_server_url,
    76      backup_enabled,
    77      last_backup,
    78      backup_fetched,
    79      auto_message_enabled,
    80      gif_api_key,
    81      display_name,
    82      test_networks_enabled,
    83      mutual_contact_enabled,
    84      bio,
    85      mnemonic_removed,
    86      latest_derived_path,
    87      device_name,
    88      wallet_accounts_position_change_clock,
    89      profile_migration_needed,
    90      is_sepolia_enabled,
    91      url_unfurling_mode,
    92      omit_transfers_history_scan,
    93      wallet_show_community_asset_when_sending_tokens,
    94      wallet_display_assets_below_balance,
    95      wallet_display_assets_below_balance_threshold,
    96      wallet_collectible_preferences_change_clock,
    97      wallet_collectible_preferences_group_by_collection,
    98      wallet_collectible_preferences_group_by_community
    99  FROM settings;
   100  
   101  DROP TABLE settings;
   102  
   103  ALTER TABLE settings2 RENAME TO settings;
   104  
   105  CREATE TABLE "keypairs_accounts2" (
   106      address VARCHAR PRIMARY KEY, key_uid VARCHAR, pubkey VARCHAR, path VARCHAR NOT NULL DEFAULT "", name VARCHAR NOT NULL DEFAULT "", color VARCHAR NOT NULL DEFAULT "", emoji VARCHAR NOT NULL DEFAULT "", wallet BOOL NOT NULL DEFAULT FALSE, chat BOOL NOT NULL DEFAULT FALSE, hidden BOOL NOT NULL DEFAULT FALSE, operable VARCHAR NOT NULL DEFAULT "no", created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, clock INT NOT NULL DEFAULT 0, position INT NOT NULL DEFAULT 0, removed BOOLEAN DEFAULT FALSE, prod_preferred_chain_ids VARCHAR NOT NULL DEFAULT "", test_preferred_chain_ids VARCHAR NOT NULL DEFAULT "", address_was_not_shown BOOLEAN NOT NULL DEFAULT FALSE, FOREIGN KEY (key_uid) REFERENCES keypairs (key_uid) ON DELETE CASCADE
   107  );
   108  
   109  INSERT INTO
   110      keypairs_accounts2 (
   111          address, key_uid, pubkey, path, name, color, emoji, wallet, chat, hidden, operable, created_at, updated_at, clock, position, removed, prod_preferred_chain_ids, test_preferred_chain_ids
   112      )
   113  SELECT
   114      address,
   115      key_uid,
   116      pubkey,
   117      path,
   118      name,
   119      color,
   120      emoji,
   121      wallet,
   122      chat,
   123      hidden,
   124      operable,
   125      created_at,
   126      updated_at,
   127      clock,
   128      position,
   129      removed,
   130      prod_preferred_chain_ids,
   131      test_preferred_chain_ids
   132  FROM keypairs_accounts;
   133  
   134  DROP TABLE keypairs_accounts;
   135  
   136  ALTER TABLE keypairs_accounts2 RENAME TO keypairs_accounts;