Merge commit 'origin/master' into fusionax
[platal.git] / bin / cron / clean.php
index 3c0590d..88feaab 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -37,12 +37,14 @@ query("DELETE FROM register_pending WHERE TO_DAYS(NOW()) - TO_DAYS(date) >= 365"
 query("DELETE FROM register_pending WHERE hash = 'INSCRIT'");
 
 // quelques tables sont triées pour que la lecture triée soit plus facile
-query("ALTER TABLE applis_def ORDER BY text");
+query("ALTER TABLE profile_education_enum ORDER BY name");
 query("ALTER TABLE binets_def ORDER BY text");
 query("ALTER TABLE groupesx_def ORDER BY text");
 query("ALTER TABLE secteur ORDER BY text");
 query("ALTER TABLE sections ORDER BY text");
 
+// Prunes older autocomplete queries.
+query("DELETE FROM search_autocomplete WHERE generated < DATE_SUB(NOW(), INTERVAL 1 DAY)");
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>