Proposes empty rank for corps by default (Closes #1071).
authorStéphane Jacob <sj@m4x.org>
Mon, 7 Jun 2010 14:03:00 +0000 (16:03 +0200)
committerStéphane Jacob <sj@m4x.org>
Mon, 7 Jun 2010 14:03:00 +0000 (16:03 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
modules/profile/jobs.inc.php
upgrade/newdirectory-0.0.1/07_corps.sql

index 7a48ceb..14f1051 100644 (file)
@@ -493,7 +493,8 @@ class ProfileSettingJobs extends ProfilePage
         $page->assign('current_corps', $res->fetchAllAssoc());
 
         $res = XDB::iterator("SELECT  id, name
-                                FROM  profile_corps_rank_enum");
+                                FROM  profile_corps_rank_enum
+                            ORDER BY  id = 1 DESC, name");
         $page->assign('corps_rank', $res->fetchAllAssoc());
     }
 }
index 2fff115..80f80bc 100644 (file)
@@ -4,9 +4,9 @@ DROP TABLE IF EXISTS profile_corps_rank_enum;
 
 CREATE TABLE profile_corps (
   pid INT(11) NOT NULL,
-  original_corpsid INT(4) UNSIGNED NOT NULL DEFAULT 0,
-  current_corpsid INT(4) UNSIGNED NOT NULL DEFAULT 0,
-  rankid INT(4) UNSIGNED NOT NULL DEFAULT 0,
+  original_corpsid INT(4) UNSIGNED NOT NULL DEFAULT 1,
+  current_corpsid INT(4) UNSIGNED NOT NULL DEFAULT 1,
+  rankid INT(4) UNSIGNED NOT NULL DEFAULT 1,
   corps_pub ENUM('private', 'ax', 'public') NOT NULL DEFAULT 'private',
   PRIMARY KEY(pid)
 ) ENGINE=InnoDB, CHARSET=utf8;