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

[#12048] Prepare for migration testing #13089

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class DataMigrationForCourseEntitySql extends DatastoreClient {
AtomicLong numberOfScannedKey;
AtomicLong numberOfUpdatedEntities;

private static final int MAX_RESPONSE_COUNT = -1;
private static final int MAX_RESPONSE_COUNT = 10000;

private VerifyCourseEntityAttributes verifier;

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package teammates.client.scripts.sql;

import com.googlecode.objectify.cmd.Query;

import teammates.client.scripts.DataMigrationEntitiesBaseScript;
import teammates.storage.entity.Course;

/**
* Index the newly-indexable fields of courses.
*/
public class IndexCourseFields extends DataMigrationEntitiesBaseScript<Course> {

public static void main(String[] args) {
new IndexCourseFields().doOperationRemotely();
}

@Override
protected Query<Course> getFilterQuery() {
return ofy().load().type(Course.class);
}

@Override
protected boolean isPreview() {
return true;
}

@Override
protected boolean isMigrationNeeded(Course course) {
return true;
}

@Override
protected void migrateEntity(Course course) {
// Save without any update; this will build the previously non-existing indexes
saveEntityDeferred(course);
}
}
2 changes: 1 addition & 1 deletion src/client/java/teammates/client/scripts/sql/SeedDb.java
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ public static void main(String[] args) throws Exception {
@Override
protected void doOperation() {
try {
clearDataStore();
// clearDataStore();
// LogicStarter.initializeDependencies();
this.persistData();
} catch (Exception e) {
Expand Down
12 changes: 12 additions & 0 deletions src/main/appengine/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,15 @@ indexes:
name: targetUser
- direction: asc
name: endTime
- kind: Course
properties:
- direction: asc
name: isMigrated
- direction: asc
name: createdAt
- kind: Course
properties:
- direction: asc
name: isMigrated
- direction: desc
name: createdAt