- Timestamp:
- 04/25/10 16:25:18 (2 years ago)
- File:
-
- 1 edited
-
trunk/scripts/db-strip (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/db-strip
r1110 r1136 3 3 4 4 require_once(dirname($argv[0]) . "/utilities.php"); 5 require_once(dirname($argv[0]) . "/../common/db/round_task.php"); 6 5 7 db_connect(); 6 8 $smfprefix = IA_SMF_DB_PREFIX; … … 85 87 WHERE (ia_task.id IS NULL) OR (ia_round.id IS NULL)"); 86 88 89 // Recompute round task order 90 $rounds = db_fetch_all("SELECT DISTINCT `round_id` AS `id` FROM ia_round_task"); 91 foreach ($rounds as $round) { 92 round_task_recompute_order($round['id']); 93 } 94 95 // Delete orphan task ratings. 96 log_print("Deleting orphan task_ratings"); 97 db_query("DELETE ia_task_ratings FROM ia_task_ratings 98 LEFT JOIN ia_task ON ia_task_ratings.task_id = ia_task.id 99 LEFT JOIN ia_user on ia_task_ratings.user_id = ia_user.id 100 WHERE (ia_user.id IS NULL) OR (ia_task.id IS NULL)"); 101 87 102 // Delete orphan scores. 88 103 log_print("Deleting orphan scores."); … … 108 123 109 124 foreach ($rounds as $round) { 110 round_recompute_score($round[' round_id']);125 round_recompute_score($round['id']); 111 126 } 112 127
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)