Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2025.02.3 [dev] #1761

Closed
wants to merge 30 commits into from
Closed

Release/2025.02.3 [dev] #1761

wants to merge 30 commits into from

Conversation

mbanting
Copy link
Contributor

Merge release/2025.02.3 to dev

mbanting and others added 26 commits November 6, 2024 10:52
)

This PR fixes the following issues:
- After adding a new activity to an applet, its entry to `applet_events` uses the old applet version number
- Adding a new scheduled event for an activity/flow removes all its previous scheduled event(s). There can be only one "always available" event, whereas many scheduled events per activity/flow should be allowed
- In the *notification_histories* table, the *is_deleted* column doesn't become `true` after removing the notification from the event
- In the *reminder_histories* table, the *is_deleted* column doesn’t become `true` after removing the reminder from the event
…t_events (M2-8743) (#1749)

This PR updates the query being used to find all the events linked to an applet when that applet is updated. This list of events is used as the base for which rows get inserted into `applet_events` whenever the applet version changes without changing any event versions.

Previously, the query being used was excluding individual events by adding the condition `WHERE user_id = NULL`
)

This PR fixes the following issues:
- After adding a new activity to an applet, its entry to `applet_events` uses the old applet version number
- Adding a new scheduled event for an activity/flow removes all its previous scheduled event(s). There can be only one "always available" event, whereas many scheduled events per activity/flow should be allowed
- In the *notification_histories* table, the *is_deleted* column doesn't become `true` after removing the notification from the event
- In the *reminder_histories* table, the *is_deleted* column doesn’t become `true` after removing the reminder from the event
This PR implements the following cleanup operations:
- Adds four new columns to the `events` table:
    - `activity_id`: taken from the `activity_events` table
    - `activity_flow_id`: taken from the `flow_events` table
    - `user_id`: taken from the `user_events` table
    - `event_type`: Enum with value `activity` or `flow`
- Removes the `periodicity_id` column from the `events` table
- Migrates all the data from the `activity_events`, `flow_events`, and `user_events` tables into the `events` table
- Drops the `activity_events`, `flow_events`, `user_events`, and `periodicity` tables
- Updates the API code to account for these changes, which mostly included rewriting queries to select only from the `events` table where multiple joins (and sometimes multiple queries) were previously being done

These changes are intended to be 100% backwards compatible and should introduce no new features from the client perspective
This PR restores the following tables that were previous removed as part of #1723:
- activity_events
- flow_events
- user_events

This restoration is optional and should only run if the tables are missing. So it should run on dev, but do nothing on UAT.

The rest of the code remains unchanged, and this change is made on Jody's suggestion to split this across two releases. There will be a follow-up PR that drops these tables in about a week or so
…migration-hotfix

chore: Schedules database clean up + restore *_event tables (M2-8495)
* fix: displays translated subscale q/a in dataviz and data export

Updates the script to update the subscale items in activity_items_histories, which is where the BE sources the submissions from for the dataviz and data export

* fix: ruff formatting errors

* fix: use date when ordering instead

Original ordering by id_version works up to 1.9.0 but because it orders by text it incorrectly orders that higher than 1.10.0

* chore: Add logging

---------

Co-authored-by: Marty <[email protected]>
@mbanting mbanting changed the title Release/2025.02.3 Release/2025.02.3 [dev] Feb 26, 2025
Copy link

github-actions bot commented Feb 26, 2025

➡️ Preview environment created: Click Me!

Copy link

❌ E2E tests failed

@mbanting mbanting closed this Feb 28, 2025
@mbanting
Copy link
Contributor Author

Abandoning this PR. Will branch from release/2025.02.3 and resolve conflicts there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants