# Database Table Structures

Easy Digital Downloads (3.0+) and it&#039;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&#039;s codebase on GitHub](https://github.com/awesomemotive/easy-digital-downloads/tree/main/includes/database).

All example tables here are prefixed with the standard `wp_` table prefix. Your table prefix may be different.

Our &#039;meta&#039; tables follow the standard format of the standard WordPress Meta table format, and consist of an &#039;id&#039; column that is Auto Incremented, an &#039;object ID&#039; 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](#aioseo-order-data)
- [Notes](#aioseo-notes)
- [Logs](#aioseo-logs)
- [Customers](#aioseo-customers)
- [Adjustments](#aioseo-adjustments)



---

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.

[View Schema](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/schemas/class-orders.php)

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-orders.php)





### wp\_edd\_ordermeta

Holds any meta data about the order, so that developers can extend EDD.

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-order-meta.php)





### 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.

[View Schema](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/schemas/class-order-transactions.php)

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-order-transactions.php)





### wp\_edd\_order\_items

This is the &#039;cart details&#039; of an order, containing a list of downloads that were purchased.

[View Schema](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/schemas/class-order-items.php)

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-order-items.php)





### 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 &#039;options&#039; array on the order item.

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-order-item-meta.php)





### 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.

[View Schema](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/schemas/class-order-adjustments.php)

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-order-adjustments.php)





### wp\_edd\_order\_adjustmentmeta

Allowing developers to extend adjustments, this table contains the meta for the individual order adjustments.

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-order-adjustment-meta.php)





### 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 &#039;Simple Shipping&#039;.

[View Schema](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/schemas/class-order-addresses.php)

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-order-addresses.php)





---

Notes
-----

EDD uses a &#039;notes&#039; 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.

[View Schema](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/schemas/class-notes.php)

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-notes.php)





### wp\_edd\_notemeta

If additional details need to be stored on a note, the meta table can be used.

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-note-meta.php)





---

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.

[View Schema](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/schemas/class-logs.php)

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-logs.php)





### wp\_edd\_logmeta

Logs can contain meta to provide additional informaiton.

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-log-meta.php)





### wp\_edd\_logs\_file\_downloads

This is the record of each file download that happens.

[View Schema](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/schemas/class-logs-file-downloads.php)

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-logs-file-downloads.php)





### wp\_edd\_logs\_file\_downloadmeta

Any additional file download information can be saved in this meta table.

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-logs-file-download-meta.php)





### wp\_edd\_logs\_api\_reqeusts

This table holds a record of any API requests that have been made to the EDD REST API.

[View Schema](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/schemas/class-logs-api-requests.php)

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-logs-api-requests.php)





### wp\_edd\_logs\_api\_requestsmeta

If any additional information is needed, it can be stored as meta.

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-logs-api-request-meta.php)





---

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.

[View Schema](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/schemas/class-customers.php)

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-customers.php)





### wp\_edd\_customermeta

Any additional information about a customer that does not have a column can be saved as meta.

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-customer-meta.php)





### 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.

[View Schema](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/schemas/class-customer-email-addresses.php)

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-customer-email-addresses.php)





### 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.

[View Schema](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/schemas/class-customer-addresses.php)

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-customer-addresses.php)





---

Adjustments
-----------

In EDD, we treat any non-product modification to an order as an &#039;adjustment&#039;. 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.

[View Schema](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/schemas/class-adjustments.php)

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-adjustments.php)





### wp\_edd\_adjustmentmeta

If any additional data is needed to be stored, meta can be used by developers.

[View Create Statement](https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/database/tables/class-adjustment-meta.php)