update
This commit is contained in:
@@ -1,82 +1,41 @@
|
||||
# Database Schema — krolewskie-miody.pl
|
||||
# Schemat Danych
|
||||
|
||||
## Connection
|
||||
**Data analizy:** 2026-05-19
|
||||
|
||||
- **Engine:** MariaDB
|
||||
- **Host:** `mariadb114.miody.nazwa.pl`
|
||||
- **Database:** `miody_miodynew`
|
||||
- **Table prefix:** `wp_` (default WordPress prefix)
|
||||
- **Charset:** `utf8mb4`
|
||||
## Główne Źródło Danych
|
||||
|
||||
## Standard WordPress Tables
|
||||
- Aplikacja używa bazy WordPress skonfigurowanej w `wp-config.php`.
|
||||
- `wp-config.php` zawiera `$table_prefix`; wartości DB credentials nie są dokumentowane.
|
||||
- Standardowe tabele WordPress i WooCommerce nie są zdefiniowane w repo jako migracje.
|
||||
|
||||
| Table | Purpose |
|
||||
|-------|---------|
|
||||
| `wp_posts` | All content (pages, products, orders, templates) |
|
||||
| `wp_postmeta` | Post metadata (product price, order items, etc.) |
|
||||
| `wp_terms` | Taxonomy terms (categories, tags, product attributes) |
|
||||
| `wp_term_taxonomy` | Term-taxonomy relationships |
|
||||
| `wp_term_relationships` | Object-term relationships |
|
||||
| `wp_options` | Site configuration, plugin settings |
|
||||
| `wp_users` | Customer and admin accounts |
|
||||
| `wp_usermeta` | User metadata (shipping address, billing, roles) |
|
||||
| `wp_comments` | Product reviews, order notes |
|
||||
| `wp_commentmeta` | Comment metadata |
|
||||
| `wp_links` | Blogroll (legacy, rarely used) |
|
||||
## Customowe Dane Projektu
|
||||
|
||||
## WooCommerce Tables
|
||||
**`ws-inpost-map`:**
|
||||
- Opcje pluginu: `ws_inpost_plugin_options`, używane w `wp-content/plugins/ws-inpost-map/App/WSInpostSettings.php`.
|
||||
- Order meta: `paczkomat_id`, zapisywane w `wp-content/plugins/ws-inpost-map/App/WsInpostActions.php`.
|
||||
- Pole checkoutu: `billing__paczkomat_id`, renderowane w `WsInpostActions::registerCustomField`.
|
||||
- Metoda dostawy: `wsim_inpost_shipping_method`, rejestrowana w `WsInpostActions::addCustomShippingMethod`.
|
||||
|
||||
| Table | Purpose |
|
||||
|-------|---------|
|
||||
| `wp_woocommerce_sessions` | Cart sessions |
|
||||
| `wp_woocommerce_api_keys` | REST API authentication |
|
||||
| `wp_woocommerce_attribute_taxonomies` | Product attribute definitions |
|
||||
| `wp_woocommerce_downloadable_product_permissions` | Digital product access |
|
||||
| `wp_woocommerce_order_items` | Line items per order |
|
||||
| `wp_woocommerce_order_itemmeta` | Metadata for order items |
|
||||
| `wp_woocommerce_tax_rates` | Tax rate definitions |
|
||||
| `wp_woocommerce_tax_rate_locations` | Tax rate geographic zones |
|
||||
| `wp_woocommerce_shipping_zones` | Shipping zone definitions |
|
||||
| `wp_woocommerce_shipping_zone_locations` | Zone geographic areas |
|
||||
| `wp_woocommerce_shipping_zone_methods` | Methods per zone |
|
||||
| `wp_woocommerce_payment_tokens` | Saved payment methods |
|
||||
| `wp_woocommerce_payment_tokenmeta` | Payment token metadata |
|
||||
| `wp_woocommerce_log` | WooCommerce action log |
|
||||
## Tabele Tworzone Przez Pluginy
|
||||
|
||||
## Plugin Tables (selected)
|
||||
Repo zawiera wiele vendorowych pluginów, które mogą tworzyć własne tabele. Przykłady znalezione w kodzie:
|
||||
|
||||
| Table | Plugin | Purpose |
|
||||
|-------|--------|---------|
|
||||
| `wp_code_snippets` | Code Snippets | Custom PHP snippet storage |
|
||||
| `wp_complianz_*` | Complianz GDPR | Cookie consent records |
|
||||
| `wp_wfpk_*` or similar | PixelYourSite | Tracking pixel config |
|
||||
- `wp-content/plugins/broken-link-checker-seo/app/Main/Updates.php` - tworzy tabele dla Broken Link Checker by AIOSEO.
|
||||
- `wp-content/plugins/broken-link-checker-seo/app/Main/PreUpdates.php` - pre-update/migracje tabel BLC.
|
||||
- `wp-content/plugins/wpforms-lite/uninstall.php` - usuwa tabele `wpforms_*` przy uninstall.
|
||||
- WooCommerce i Action Scheduler zarządzają własnymi tabelami wewnątrz `wp-content/plugins/woocommerce/`.
|
||||
|
||||
## Key Relationships
|
||||
## Migracje
|
||||
|
||||
### Products
|
||||
- `wp_posts` (post_type = 'product' or 'product_variation')
|
||||
- `wp_postmeta` — `_price`, `_regular_price`, `_sale_price`, `_sku`, `_stock`
|
||||
- `wp_term_relationships` → `wp_terms` (product categories, tags, attributes)
|
||||
- Brak projektowego katalogu migracji dla custom code.
|
||||
- Custom plugin `ws-inpost-map` nie tworzy własnych tabel; zapisuje ustawienia w `wp_options` i dane zamówień w meta WooCommerce.
|
||||
- Vendorowe migracje należy traktować jako własność pluginów i nie modyfikować ich ręcznie.
|
||||
|
||||
### Orders
|
||||
- `wp_posts` (post_type = 'shop_order')
|
||||
- `wp_postmeta` — `_billing_*`, `_shipping_*`, `_order_total`, `_payment_method`
|
||||
- `wp_woocommerce_order_items` + `wp_woocommerce_order_itemmeta`
|
||||
## Ryzyka
|
||||
|
||||
### Customers
|
||||
- `wp_users` — account
|
||||
- `wp_usermeta` — `billing_address_1`, `shipping_city`, etc.
|
||||
|
||||
## Migration Rules
|
||||
|
||||
Per CLAUDE.md:
|
||||
1. Schema changes require a new migration file
|
||||
2. Never modify existing migrations
|
||||
3. Document all custom schema changes in this file
|
||||
|
||||
## Custom Schema Changes
|
||||
|
||||
*No custom tables or schema changes recorded yet.*
|
||||
- Zmiany checkoutu i order meta muszą być zgodne z WooCommerce HPOS, jeśli HPOS jest włączone w środowisku.
|
||||
- Ustawienia i sekrety mogą żyć w `wp_options`; nie należy zakładać, że repo zawiera pełny stan runtime.
|
||||
- Bez dumpa bazy nie można potwierdzić aktywnego motywu, aktywnych pluginów, statusu HPOS ani rzeczywistych wartości ustawień.
|
||||
|
||||
---
|
||||
*Update this file whenever schema changes are made.*
|
||||
*Aktualizuj po każdej zmianie zapisów do bazy, order meta, ustawień pluginów albo migracji.*
|
||||
|
||||
Reference in New Issue
Block a user