CREATE TABLE settings_bk (
  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,
  latest_derived_path UNSIGNED INT DEFAULT 0,
  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
  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
) WITHOUT ROWID;

INSERT INTO settings_bk SELECT * FROM settings;

DROP TABLE settings;

ALTER TABLE settings_bk RENAME TO settings;

UPDATE settings SET default_sync_period = 777600; -- 9 days
