Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Conversation

ThomazFB
Copy link
Contributor

@ThomazFB ThomazFB commented Jul 24, 2023

⚠️ This PR has breaking changes that are connected with woocommerce/woocommerce-android#9453, do not merge it until everything is approved.

Summary

Introduces an external way to define a Revenue Stats range through an ID, making sure that we can insert/update/select any Revenue stats data through a range ID when available.

How to Test

  1. I recommend testing the changes introduced here through Analytics Performance: Improve Analytics revenue database system woocommerce/woocommerce-android#9453. Just make sure all unit tests are OK.

Update release notes:

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@ThomazFB ThomazFB changed the title Analytics Performance: Add access to revenue stats from ID query Analytics Performance: Add access to revenue stats from range ID queries Jul 26, 2023
@ThomazFB ThomazFB requested a review from atorresveiga July 26, 2023 00:35
@atorresveiga atorresveiga self-assigned this Jul 27, 2023
Copy link
Contributor

@atorresveiga atorresveiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, Thomaz! The code looks good and is working as expected. Tested alongside the Woo PR.

LGTM! :shipit:

db.execSQL("ALTER TABLE PostModel ADD AUTO_SHARE_ID INTEGER")
}
191 -> migrate(version) {
db.execSQL("ALTER TABLE WCRevenueStatsModel ADD RANGE_ID INTEGER")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Contributor

@atorresveiga atorresveiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I almost miss something 🤦

You must replace 191 -> migrate(version) to migrateAddOn(ADDON_WOOCOMMERCE, version) otherwise the WP app will crash because it doesn't have the WCRevenueStatsModel table

@ThomazFB
Copy link
Contributor Author

Wow, sorry that I forgot about this @atorresveiga, thank you so much for finding it in time to avoid a huge problem 😬 It's fixed now!

@ThomazFB ThomazFB requested a review from atorresveiga July 28, 2023 00:33
Copy link
Contributor

@atorresveiga atorresveiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work Thomaz! Using the new revenueRangeId is a great addition that will make our life easier when working with the stats.

LGTM! :shipit:

@ThomazFB ThomazFB merged commit 961cf6e into trunk Jul 28, 2023
@ThomazFB ThomazFB deleted the issue/add-custom-id-to-revenue-stats branch July 28, 2023 09:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants