Skip to content

Commit

Permalink
Added WooCommerce orders table to checksum logic. (#32774)
Browse files Browse the repository at this point in the history
* Added a definition of the wc_orders table to the Replicastore.

* Changelog.

* Added two more tables to be used in checksums.

* Amended key field data according to schema.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/6226922322
  • Loading branch information
zinigor authored and matticbot committed Sep 18, 2023
1 parent 3d961c0 commit 45f16e4
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 109 deletions.
1 change: 1 addition & 0 deletions jetpack_vendor/automattic/jetpack-sync/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
This is an alpha version! The changes listed here are not final.

### Added
- Added a definition of a WooCommerce HPOS table to Jetpack Sync.
- Jetpack Sync: Drop Sync custom queue table when Jetpack is disconnected
- Woo: add HPOS (custom order tables) events to sync module.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,30 @@ protected function get_default_tables() {
'table_join_field' => 'order_item_id',
'is_table_enabled_callback' => array( $this, 'enable_woocommerce_tables' ),
),
'wc_orders' => array(
'table' => "{$wpdb->prefix}wc_orders",
'range_field' => 'id',
'key_fields' => array( 'id' ),
'checksum_text_fields' => array( 'type', 'status', 'payment_method_title' ),
'filter_values' => array(),
'is_table_enabled_callback' => array( $this, 'enable_woocommerce_tables' ),
),
'wc_order_addresses' => array(
'table' => "{$wpdb->prefix}wc_order_addresses",
'range_field' => 'order_id',
'key_fields' => array( 'order_id', 'address_type' ),
'checksum_text_fields' => array( 'address_type' ),
'filter_values' => array(),
'is_table_enabled_callback' => array( $this, 'enable_woocommerce_tables' ),
),
'wc_order_operational_data' => array(
'table' => "{$wpdb->prefix}wc_order_operational_data",
'range_field' => 'order_id',
'key_fields' => array( 'order_id' ),
'checksum_text_fields' => array( 'order_key', 'cart_hash' ),
'filter_values' => array(),
'is_table_enabled_callback' => array( $this, 'enable_woocommerce_tables' ),
),
'users' => array(
'table' => $wpdb->users,
'range_field' => 'ID',
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/i18n-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
),
'jetpack-sync' => array(
'path' => 'jetpack_vendor/automattic/jetpack-sync',
'ver' => '1.57.0-alpha1695061509',
'ver' => '1.57.0-alpha1695064121',
),
),
);
52 changes: 26 additions & 26 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-a8c-mc-stats",
"reference": "160aeb09a30c3f99de2e33d47c58cbce9d786f69"
"reference": "6c925f6e213e8ba278a0d9f85c21415b3e4c8ccd"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.9-alpha",
Expand Down Expand Up @@ -57,7 +57,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-admin-ui",
"reference": "9f212b9f2b8cbbe7b20c09674f290054b2e7fa09"
"reference": "2d2050d35f9724f29474de9395bbff344f14289f"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.9-alpha",
Expand Down Expand Up @@ -119,7 +119,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-assets",
"reference": "cd6f7138cd5d12d2d984fb71789e0c46952e132f"
"reference": "009f05b992c622e8866d2447828530412240bb8f"
},
"require": {
"automattic/jetpack-constants": "^1.6.23"
Expand Down Expand Up @@ -187,7 +187,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-autoloader",
"reference": "14a991b50815a0d3f25efcb3a86a11726f35956f"
"reference": "f2021cecd781b659ca4b9a94ec6d02bb97b18b18"
},
"require": {
"composer-plugin-api": "^1.1 || ^2.0"
Expand Down Expand Up @@ -249,7 +249,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-composer-plugin",
"reference": "296658a089d07e29d084833fe73094f6c646a6eb"
"reference": "64dbf05a816780230c9bb6c85ad86040b92d0804"
},
"require": {
"composer-plugin-api": "^2.1.0"
Expand Down Expand Up @@ -308,7 +308,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-config",
"reference": "09d67124e26b5b4c4daba15db8bc6075f5a7a512"
"reference": "6861a4cbaedcd9893db76b85a05e2f64d943ba49"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.9-alpha"
Expand Down Expand Up @@ -350,7 +350,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-connection",
"reference": "5574cc6c8d0976aa8f2a3c816b08d3fd76c9ab83"
"reference": "e7744d811eb1b2b5550b79a20a53a8de69f4eb3b"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^1.4.22-alpha",
Expand Down Expand Up @@ -428,7 +428,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-constants",
"reference": "d7f8c823b9fe705ac2cb546636a7f8be56485725"
"reference": "a15c9b63c2790ceade6adcabe2cd29389b939799"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.9-alpha",
Expand Down Expand Up @@ -479,7 +479,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-device-detection",
"reference": "55819aaee19ea1f3c824e6bca209a7fd67026aef"
"reference": "0835782a0c30e3dc33fe288073c4d908a3cec09b"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.9-alpha",
Expand Down Expand Up @@ -529,7 +529,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-identity-crisis",
"reference": "b70f3603d0f1146a3ebb47a52e27efca036413cc"
"reference": "6a250e24035fea71f8e9388e8c04e49f5e0c101d"
},
"require": {
"automattic/jetpack-assets": "^1.18.11-alpha",
Expand Down Expand Up @@ -607,7 +607,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-ip",
"reference": "8678c7be494cbd078a54d6231302a0b1fb590452"
"reference": "d6510f79e890868199e331b35645b4ec210926e4"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.9-alpha",
Expand Down Expand Up @@ -662,7 +662,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-jitm",
"reference": "05d7046a48de2690348e432a1ca7ab3abdfb4cb5"
"reference": "f872001b6b3aa90faf94d583d7a48ced8e0d4125"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^1.4.22-alpha",
Expand Down Expand Up @@ -737,7 +737,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-licensing",
"reference": "1876864b6318d16b2d8e1bc2cd2dcb4c61c1c35a"
"reference": "ece13314aebc52d1b46e28cb060b4949265349ce"
},
"require": {
"automattic/jetpack-connection": "^1.57.5-alpha"
Expand Down Expand Up @@ -798,7 +798,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-logo",
"reference": "ab4ae25c5be0438af546efa161e3ffc372de74a7"
"reference": "203aed10ebced3f9f6ccbca44b46433069defa42"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.9-alpha",
Expand Down Expand Up @@ -848,7 +848,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-my-jetpack",
"reference": "d7e1ee2f1134bc83464d01800a335a303e520d50"
"reference": "5607bbbf299f7a1a425ad2fb26d90c2442e8828a"
},
"require": {
"automattic/jetpack-admin-ui": "^0.2.23-alpha",
Expand Down Expand Up @@ -938,7 +938,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-partner",
"reference": "0ea2b8ca224e05a9495955a2a71423ece940189f"
"reference": "657b6e1df44defdb45a5ff17f82e195fd37073cc"
},
"require": {
"automattic/jetpack-connection": "^1.57.5-alpha",
Expand Down Expand Up @@ -1000,7 +1000,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-password-checker",
"reference": "1dbbb911178358e090e5bbe56a9406a79fc90aa2"
"reference": "901ecd4203d23519ad80a9a47f3aa87e3b4f7fe3"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.9-alpha",
Expand Down Expand Up @@ -1058,7 +1058,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-plugins-installer",
"reference": "a09f66eeb644f04e6f1b964ef242e0a15386201c"
"reference": "c745782d033071e9cf314ab7d6f4d1d0a1d0c81f"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^1.4.22-alpha"
Expand Down Expand Up @@ -1112,7 +1112,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-redirect",
"reference": "daa25a443cfe2f2f40dc8c378e8b4ef24cfb0534"
"reference": "eb0289d182ca4a2fb171a0195a3f52033ce769bc"
},
"require": {
"automattic/jetpack-status": "^1.18.4-alpha"
Expand Down Expand Up @@ -1166,7 +1166,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-roles",
"reference": "5c2294e4a581a78e571ae098a768404869a7e0c9"
"reference": "439bcb5180c5046cdf7a07c05bffc41f2d390ab4"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.9-alpha",
Expand Down Expand Up @@ -1217,7 +1217,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-search",
"reference": "b9238905825a97d41832643525505e70ff3fc5d1"
"reference": "77050a0b1e72b430332e39ef49265e30408d5082"
},
"require": {
"automattic/jetpack-assets": "^1.18.11-alpha",
Expand Down Expand Up @@ -1303,7 +1303,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-stats",
"reference": "e4de5d842e0a449afb19d08378bfc184b8849798"
"reference": "3a611ec020a1a10bcb8956694a3ed6f47851d21e"
},
"require": {
"automattic/jetpack-assets": "^1.18.11-alpha",
Expand Down Expand Up @@ -1367,7 +1367,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-status",
"reference": "253f75760b0ae8c1d8a9ffdb4ff2b143732ff048"
"reference": "104a7b820c65ba2a11a20d6f111bf65f7efe4fe8"
},
"require": {
"automattic/jetpack-constants": "^1.6.23"
Expand Down Expand Up @@ -1417,12 +1417,12 @@
},
{
"name": "automattic/jetpack-sync",
"version": "1.57.0-alpha.1695061509",
"version_normalized": "1.57.0.0-alpha1695061509",
"version": "1.57.0-alpha.1695064121",
"version_normalized": "1.57.0.0-alpha1695064121",
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-sync",
"reference": "6e986cab43af36ccfbfb96ca2eb2e3077408fddf"
"reference": "e362b8ad5a8e7104e34786800b82e3d460e968e7"
},
"require": {
"automattic/jetpack-connection": "^1.57.5-alpha",
Expand Down
Loading

0 comments on commit 45f16e4

Please sign in to comment.