PW-wp Early Database Upgrade Information

Last updated: 31 October, 2007

PW-wp, as the first plugin, has gone through 3 stages of development of infocard-related mysql tables.

New code will identify which stage of infocard mysql configuration (if any) may pre-exist in the database.

PW-wp Possible MySQL States

PW-wp DB v1

  • No wp_infocard_identities table
  • No wp_infocard_audit table
  • identity data is in in wp_usermeta
  • infocard_audit table exists

Entries added to wp_usermeta:

  • ppid
  • identity (modulus hash)

Entries Added to wp_options:

  • clickback_salt
  • infocard_key
  • infocard_opener
  • securesiteurl

Pw-wp DB v2

  • wp_infocard_identities table exists and has 3 columns:
    • modulusHash
    • ppid
    • accountid
  • wp_infocard_audit has 7 columns
    • modulusHash
    • ppid
    • accountid
    • email
    • time
    • IP
    • status

Options added to wp_options:

  • pw_clickback_salt
  • pw_debug_on
  • pw_enable_pass
  • pw_infocard_key
  • pw_infocard_opener
  • pw_securesiteurl

PW-wp DBv3

  • wp_infocard_identities table exists & has 5 columns:
    • cardhash
    • accountid
    • cardhandle
    • startdate
    • lastused
  • wp_infocard_audit table exists & has 6 columns:
    • cardhash
    • accountid
    • email
    • time
    • IP
    • status

Entries in wp_options:

  • pw_clickback_salt
  • pw_custom_data
  • pw_debug_on
  • pw_enable_pass
  • pw_infocard_key
  • pw_infocard_opener
  • pw_securesiteurl
  • pw_selector_trigger
  • pw_time_validation
  • pw_trusted_idp_list
  • pw_trust_managed_cards
  • pw_trust_personal_cards
  • pw_database_version

Note: pw_trust_managed_cards may be set to be 0/1 instead of set to strings - need to check for that.

DB version detection for PW-wp v0.9

1) Check for existence of pw_database_version. If it exists, we're DBv3 2) Check for existence of pw_infocard_key. If it exists, we're DBv2 3) Check for existence of infocard_key. If if exists, we're DBv1

DB upgrade versions

upgradePWDBv1tov3()

upgradePWDBv2tov3()