Database Table Structures
Easy Digital Downloads (3.0+) and it’s extensions take advantage of custom database tables to ensure that we can provide a scalable solution that offers complex reporting features. Below is a list of our custom database tables that we use and their schema. While we attempt to maintain this list, there may be slight differences as we find improvements, and the most recent database table schema can always be found in EDD core’s codebase on GitHub.
All example tables here are prefixed with the standard wp_
table prefix. Your table prefix may be different.
Our ‘meta’ tables follow the standard format of the standard WordPress Meta table format, and consist of an ‘id’ column that is Auto Incremented, an ‘object ID’ column (the column name may differ depending on the object type), a meta key, and a meta value. The meta tables are registered with the WordPress Meta API for the object types.
Easy Digital Downloads Core
Order Data
These tables hold the transactional order data including the order overview, transaction IDs from the gateway, items ordered, any physical address information related to the order, and adjustments made to the order (IE: Taxes, discounts, fees)
wp_edd_orders
This table is the primary storage for an order record.
wp_edd_ordermeta
Holds any meta data about the order, so that developers can extend EDD.
wp_edd_order_transactions
This table contains a record of any transaction IDs from the payment gateway for safe keeping. Since an order can have multiple transaction IDs or have no Transaction ID at all, they are stored separate of the orders themselves.
wp_edd_order_items
This is the ‘cart details’ of an order, containing a list of downloads that were purchased.
wp_edd_order_itemmeta
If a developer needs to add specific items to the order item, it can be done here. Previously this would have been the ‘options’ array on the order item.
wp_edd_order_adjustments
Adjustments are anything non-product related that affect the contents. This means (but is not limited to) discounts used, taxes collected, or any fees associated with the order.
wp_edd_order_adjustmentmeta
Allowing developers to extend adjustments, this table contains the meta for the individual order adjustments.
wp_edd_order_addresses
As a customer may use different addresses for each order, we maintain a list of physical addresses used on each order, to aid in reporting. This can also be extended to add supplemental addresses (like shipping addresses) for extensions like ‘Simple Shipping’.
Notes
EDD uses a ‘notes’ concept to be able to store a thread of information about a specific object. For example, orders or customers. Notes are similar to WordPress comments, however, since notes are inherently not a public data set, we created a custom table for them, instead of including them as a custom comment type, in order to aid in front end performance.
wp_edd_notes
Many objects in EDD have notes, like customers and orders. This table holds the note information.
wp_edd_notemeta
If additional details need to be stored on a note, the meta table can be used.
Logs
As an eCommerce platform, we understand that keeping logs of events on your store is important. Logs can help you resolve customer issues, detect fraud, and provide evidence for things like disputes and customer support.
wp_edd_logs
This is the generic logging database table, which can be used to log any information necessary that does not have a specific table.
wp_edd_logmeta
Logs can contain meta to provide additional informaiton.
wp_edd_logs_file_downloads
This is the record of each file download that happens.
wp_edd_logs_file_downloadmeta
Any additional file download information can be saved in this meta table.
wp_edd_logs_api_reqeusts
This table holds a record of any API requests that have been made to the EDD REST API.
wp_edd_logs_api_requestsmeta
If any additional information is needed, it can be stored as meta.
Customers
EDD treats customers separate of WordPress users, as a store can allow guest purchases. The customer is our canonical reference point for who orders belong to.
wp_edd_customers
This table contains the main customer record.
wp_edd_customermeta
Any additional information about a customer that does not have a column can be saved as meta.
wp_edd_customer_email_addresses
As a customer may use different email addresses for subsequent purchases, we maintain a list of email addressers associated with each customer.
wp_edd_customer_addresses
As a customer may supply different physical addresses for each purchase, we also maintain a list of all physical addresses a customer uses and associate them with their customer ID.
Adjustments
In EDD, we treat any non-product modification to an order as an ‘adjustment’. This currently includes (but is not limited to, in the future) discounts codes (coupons) and tax rates.
wp_edd_adjustments
The primary table for adjustments.
wp_edd_adjustmentmeta
If any additional data is needed to be stored, meta can be used by developers.