-
Notifications
You must be signed in to change notification settings - Fork 199
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
Add student progress migration #7049
Conversation
Codecov Report
@@ Coverage Diff @@
## trunk #7049 +/- ##
============================================
+ Coverage 48.08% 48.25% +0.16%
- Complexity 10467 10534 +67
============================================
Files 573 575 +2
Lines 44164 44441 +277
Branches 402 402
============================================
+ Hits 21235 21443 +208
- Misses 22602 22671 +69
Partials 327 327
Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to leave this interface here as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to move this class to includes/internal/student-progress/migrations
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't move yet, not sure.
40dbf01
to
cbfc257
Compare
fa1032a
to
d9f666f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't do in-depth testing but it worked great on what I've tested! I will do some more edge-case testing next week.
I remember you mentioning the handling of trashed comments. Is that part done or it will be in another PR?
tests/unit-tests/internal/installer/migrations/test-class-student-progress-migration.php
Show resolved
Hide resolved
} | ||
|
||
if ( Course_Progress::STATUS_COMPLETE === $comment->comment_approved ) { | ||
$completed_at = $comment->comment_date; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we plan to store dates in GMT for the new tables? If so, I don't think the comment_date
is in GMT and might need some conversion. Maybe we can use comment_date_gmt
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m1r0 added usage of GMT date and conversion for the start
date.
includes/internal/installer/migrations/class-student-progress-migration.php
Outdated
Show resolved
Hide resolved
includes/internal/installer/migrations/class-student-progress-migration.php
Outdated
Show resolved
Hide resolved
includes/internal/installer/migrations/class-student-progress-migration.php
Outdated
Show resolved
Hide resolved
includes/internal/installer/migrations/class-student-progress-migration.php
Outdated
Show resolved
Hide resolved
includes/internal/installer/migrations/class-student-progress-migration.php
Outdated
Show resolved
Hide resolved
includes/internal/installer/migrations/class-student-progress-migration.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I wasn't able to find any issues. 🙂
Resolves #5437
Proposed Changes
Testing Instructions
add_filter( 'sensei_feature_flag_tables_based_progress', '__return_true' );
.Sensei LMS -> Tools
.Migrate comment-based progress
.DELETE FROM
wp_optionswhere option_name = 'sensei_migrated_progress_last_comment_id';
TRUNCATE TABLE
wp_sensei_lms_progress;
Pre-Merge Checklist