Skip to content

Commit

Permalink
[TEAMMATES#12048] Config prod settings and convenience scripts for no…
Browse files Browse the repository at this point in the history
…n course migration (TEAMMATES#12959)

* Add fields

* Change based on feedback

* Add changes
  • Loading branch information
FergusMok authored and mingyuanc committed Apr 14, 2024
1 parent fb7c4e8 commit 6df39c1
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ protected void doOperationRemotely() {
System.out.println("Going to connect to:" + appDomain + ":" + appPort);

DatastoreOptions.Builder builder = DatastoreOptions.newBuilder().setProjectId(Config.APP_ID);
if (ClientProperties.isTargetUrlDevServer()) {
builder.setHost(ClientProperties.TARGET_URL);
}
// if (ClientProperties.isTargetUrlDevServer()) {
// builder.setHost(ClientProperties.TARGET_URL);
// }
ObjectifyService.init(new ObjectifyFactory(builder.build().getService()));
OfyHelper.registerEntityClasses();

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

/**
* Step 8 in the non course migration process.
*/
@SuppressWarnings("PMD")
public class NonCourseMigrationAfterMaintenanceWindow {

public static void main(String[] args) {
try {
DataMigrationForUsageStatisticsSql.main(args);
VerifyUsageStatisticsAttributes.main(args);
VerifyNonCourseEntityCounts.main(args);
} catch (Exception e) {
System.out.println(e);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package teammates.client.scripts.sql;

/**
* Step 3 in the non course migration process.
*/
@SuppressWarnings("PMD")
public class NonCourseMigrationBeforeMaintenanceWindow {

public static void main(String[] args) {
try {
DataMigrationForUsageStatisticsSql.main(args);
DataMigrationForAccountRequestSql.main(args);
VerifyAccountRequestAttributes.main(args);
} catch (Exception e) {
System.out.println(e);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package teammates.client.scripts.sql;

/**
* Step 5 in the non course migration process.
*/
@SuppressWarnings("PMD")
public class NonCourseMigrationDuringMaintenanceWindow {

public static void main(String[] args) {
try {
DataMigrationForAccountAndReadNotificationSql.main(args);
VerifyAccountAttributes.main(args);
} catch (Exception e) {
System.out.println(e);
}
}
}
8 changes: 4 additions & 4 deletions src/main/java/teammates/common/util/HibernateUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ public static void buildSessionFactory(String dbUrl, String username, String pas
.setProperty("hibernate.hikari.idleTimeout", "300000")
.setProperty("hibernate.hikari.connectionTimeout", "30000")
// Uncomment only during migration for optimized batch-insertion, batch-update, and batch-fetch.
// .setProperty("hibernate.jdbc.batch_size", "50")
// .setProperty("hibernate.order_updates", "true")
// .setProperty("hibernate.batch_versioned_data", "true")
// .setProperty("hibernate.jdbc.fetch_size", "50")
.setProperty("hibernate.jdbc.batch_size", "50")
.setProperty("hibernate.order_updates", "true")
.setProperty("hibernate.batch_versioned_data", "true")
.setProperty("hibernate.jdbc.fetch_size", "50")
.addPackage("teammates.storage.sqlentity");

if (Config.IS_DEV_SERVER) {
Expand Down

0 comments on commit 6df39c1

Please sign in to comment.