diff --git a/modules/system/system.install b/modules/system/system.install
index 7b66767..13f34ba 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -1453,6 +1453,7 @@ function system_schema() {
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
+        'default' => 0,
       ),
       'sid' => array(
         'description' => "A session ID. The value is generated by Drupal's session handlers.",
@@ -3086,6 +3087,25 @@ function system_update_7077() {
   ));
 }
 
+ /**
+ * Change the {sessions}.uid default value to 0.
+ */
+function system_update_7078() {
+  global $user;
+  if ($user->uid) {
+    db_delete('sessions')
+      ->condition('uid', $user->uid, '<>')
+      ->execute();
+  }
+  db_change_field('sessions', 'uid', 'uid', array(
+    'description' => 'The {users}.uid corresponding to a session, or 0 for anonymous user.',
+    'type' => 'int',
+    'unsigned' => TRUE,
+    'not null' => TRUE,
+    'default' => 0,
+  ));
+}
+
 /**
  * @} End of "defgroup updates-7.x-extra".
  * The next series of updates should start at 8000.
