Index: l10n_community/l10n_community.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/l10n_community/Attic/l10n_community.install,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 l10n_community.install
--- l10n_community/l10n_community.install	17 Dec 2007 20:09:54 -0000	1.1.2.4
+++ l10n_community/l10n_community.install	17 Dec 2007 21:28:54 -0000
@@ -108,14 +108,14 @@ function l10n_community_install() {
         language       VARCHAR(12)   NOT NULL,
         translation    TEXT          NOT NULL,
         
-        uid_entered    INTEGER       NOT NULL,
-        uid_approved   INTEGER       NOT NULL,
-        time_entered   INTEGER       NOT NULL,
-        time_approved  INTEGER       NOT NULL,
+        uid_entered    INTEGER       NOT NULL DEFAULT 0,
+        uid_approved   INTEGER       NOT NULL DEFAULT 0,
+        time_entered   INTEGER       NOT NULL DEFAULT 0,
+        time_approved  INTEGER       NOT NULL DEFAULT 0,
         
-        has_suggestion INTEGER       NOT NULL,
-        is_suggestion  INTEGER       NOT NULL,
-        is_active      INTEGER       NOT NULL
+        has_suggestion INTEGER       NOT NULL DEFAULT 0,
+        is_suggestion  INTEGER       NOT NULL DEFAULT 0,
+        is_active      INTEGER       NOT NULL DEFAULT 0
         ) $table_config;");
 
       db_query("ALTER TABLE  {l10n_community_release}  ADD FOREIGN KEY (pid) REFERENCES {l10n_community_project} (pid);");
@@ -140,11 +140,24 @@ function l10n_community_install() {
  * link to http://drupal.org/project/$uri.
  */
 function l10n_community_update_5000() {
+  $ret = array();
   $ret[] = update_sql('ALTER TABLE {l10n_community_project} ADD home_link TEXT NOT NULL AFTER title');
   return $ret;
 }
 
 /**
+ * Add DEFAULT 0 to integer fields we not always fill in.
+ */
+function l10n_community_update_5001() {
+  $default_to_zero = array('uid_entered', 'uid_approved', 'time_entered', 'time_approved', 'has_suggestion', 'is_suggestion', 'is_active');  
+  $ret = array();
+  foreach ($default_to_zero as $column)
+    $ret[] = update_sql('ALTER TABLE {l10n_community_translation} CHANGE '. $column .' '. $column . ' INTEGER NOT NULL DEFAULT 0');
+  }
+  return $ret;
+}
+
+/**
  * Implementation of hook_uninstall().
  */
 function l10n_community_uninstall() {
