Database tables

All tables use the network base prefix and live on the main site. They are created by LH_Addresses_Table::maybe_upgrade(), keyed on schema_version() (currently 0.2.0) stored in the network option lh_addresses-schema_version. The 0.2.0 upgrade rebuilds a 0.1.0 uses table only while it is empty (dbDelta cannot change a primary key); one with rows holds the upgrade back and logs it.

{base_prefix}lh_addresses

{base_prefix}lh_address_uses

id, address_id, blog_id (0 for the member’s own book), type, created, created_by, ended_at, ended_by. Indexes on address_id and (blog_id, type, ended_at). A current use has ended_at NULL; at most one current use per user, site and type, enforced in code.

{base_prefix}lh_address_geo

address_id, geo_point (POINT, NOT NULL, spatial index), latitude, longitude. A row exists only once an address is geocoded; it is a side table because a spatial index needs a NOT NULL column. Points stay with replaced addresses.

History

Nothing is deleted or overwritten: changes end rows and start new ones, so the tables themselves are the history. The actions this plugin fires remain available to LH Audit Trail for who-did-what records.