PrestaShop
Privacy rules for PrestaShop 1.7.8, 8.2, and 9.0 on MySQL and MariaDB
Covers customers, addresses, employees, customer-service messages, sessions, API credentials, visitor logs, and four common modules; orders point to address rows instead of copying them.
Coverage
- Versions: 1.7.8, 8.2, and 9.0; version-only keys carry a comment.
- Engines: MySQL, MariaDB.
- Table prefix: the template assumes unprefixed table names. PrestaShop prefixes every table with
ps_by default (database_prefixinapp/config/parameters.php); prepend yours to every key.
Template
privacy:
rules:
emails:
columns:
- customer.email
- employee.email
- customer_thread.email
- mail.recipient
# Newsletter subscription (ps_emailsubscription) (optional)
- emailsubscription.email
# Stock alerts (ps_emailalerts) (optional)
- mailalert_customer_oos.customer_email
entity: EMAIL_ADDRESS
operator: hash
names:
columns:
- customer.firstname
- customer.lastname
- address.firstname
- address.lastname
- employee.firstname
- employee.lastname
- stock_mvt.employee_firstname
- stock_mvt.employee_lastname
- supply_order_history.employee_firstname
- supply_order_history.employee_lastname
- supply_order_receipt_history.employee_firstname
- supply_order_receipt_history.employee_lastname
# Product reviews (productcomments) (optional)
- product_comment.customer_name
entity: PERSON
operator: hash
phones:
columns:
- address.phone
- address.phone_mobile
entity: PHONE_NUMBER
operator: hash
addresses:
columns:
- address.address1
- address.address2
- address.city
entity: LOCATION
operator: hash
postcodes:
columns:
- address.postcode
entity: POSTCODE
operator: hash
companies:
columns:
- customer.company
- address.company
entity: ORGANIZATION
operator: hash
vat-numbers:
columns:
- address.vat_number
entity: VAT_NUMBER
operator: hash
registry-numbers:
columns:
- customer.siret
entity: COMMERCIAL_REGISTER
operator: hash
id-cards:
columns:
- address.dni
entity: NATIONAL_ID
operator: replace
birth-dates:
columns:
- customer.birthday
entity: DATE_OF_BIRTH
operator: replace
urls:
columns:
- customer.website
- connections.http_referer
- connections_source.http_referer
- connections_source.request_uri
# Newsletter subscription (ps_emailsubscription) (optional)
- emailsubscription.http_referer
# 404 log (pagesnotfound) (optional)
- pagenotfound.request_uri
- pagenotfound.http_referer
entity: URL
operator: replace
ip-addresses:
columns:
- connections.ip_address
- customer.ip_registration_newsletter
- customer_message.ip_address
# Newsletter subscription (ps_emailsubscription) (optional)
- emailsubscription.ip_registration_newsletter
entity: IP_ADDRESS
operator: hash
user-agents:
columns:
- customer_message.user_agent
entity: USER_AGENT
operator: hash
text:
columns:
- customer.note
- address.other
- customer_message.message
- message.message
- cart.gift_message
- orders.gift_message
- orders.note
- order_invoice.note
- order_return.question
# Product reviews (productcomments) (optional)
- product_comment.title
- product_comment.content
entity: FREE_TEXT
operator: replace
passwords:
columns:
- customer.passwd
- employee.passwd
- referrer.passwd # 1.7 only
entity: PASSWORD_HASH
operator: redact
tokens:
columns:
- customer.secure_key
- cart.secure_key
- orders.secure_key
- customer.reset_password_token
- employee.reset_password_token
- customer_session.token
- employee_session.token
- customer_thread.token
- order_detail.download_hash
entity: AUTH_TOKEN
operator: redact
secrets:
columns:
- webservice_account.key
- api_access.client_secret # 8.1–8.2
- api_client.client_secret # 9.0+
entity: API_KEY
operator: redact
# Optional: mixed-content columns. Ruling them hides their non-personal content too; remove to keep it readable.
mixed-content:
columns:
- cart.checkout_session_data
- log.message
entity: MIXED_CONTENT
operator: replaceChoices
secure_keyoncustomer,cart, andordersis a random key carried in order-confirmation and guest-tracking links.webservice_account.keyandcustomer_message.readare reserved words: the assistant's SQL must quote them with backticks.- Optional parts: delete the commented module columns you do not run and the
mixed-contentrule if the assistant needs those columns readable. emailsubscriptionholds newsletter sign-ups without a customer account; account holders' sign-ups are incustomer.
Trade-offs
- Indexed ruled columns:
customer.email,customer.passwd,employee.email,employee.passwd,webservice_account.key,mail.recipient,connections_source.http_referer,connections_source.request_uri,mailalert_customer_oos.customer_email. - Lookups that stop working: a customer, employee, subscriber, or sent mail by e-mail; a webservice account by key; visits grouped by IP or referrer.
- Join keys that stay unruled:
id_*columns, such asid_customer,id_address, andorders.id_address_delivery; alsoorders.reference. - IP formats differ:
connections.ip_addressis aBIGINT(ip2long), the other IP columns dotted text, so one address gets two tokens.
Not covered
customer.ape,last_passwd_gen,*.reset_password_validity: activity code and timestamps.customer_message.file_name, theguesttable: device details.connections_source.keywords: the referring search engine's search terms.mail.subject: template subjects.contact,store,supplier,manufacturer,warehouse: the shop's own contact data.mutation.mutator_identifier(9.0): who changed a record.
Sources
- PrestaShop/PrestaShop
install-dev/data/db_structure.sqlat 1.7.8.11, 8.2.9, and 9.0.3 - PrestaShop/PrestaShop Doctrine entities
StockMvtandApiAccessat 8.2.9 - PrestaShop/autoupgrade
upgrade/sql/8.1.0.sqland9.0.0.sql - Module install code: ps_emailsubscription v3.0.1, ps_emailalerts v3.0.1, productcomments v9.0.1, pagesnotfound v4.0.0