? wall1.patch
Index: walls.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/walls/walls.install,v
retrieving revision 1.1
diff -u -p -r1.1 walls.install
--- walls.install	7 Sep 2010 05:02:48 -0000	1.1
+++ walls.install	7 Sep 2010 08:10:49 -0000
@@ -1,29 +1,103 @@
 <?php
-// $Id: walls.install,v 1.1 2010/09/07 05:02:48 thehong Exp $
+// $Id$
 
 /**
  * @file Install, Uninstall, Schema functions.
  */
 
 /**
- * Implements hook_install().
- */
-function walls_install() {
-  drupal_install_schema('walls');
-}
-
-/**
- * Implements hook_uninstall().
- */
-function walls_uninstall() {
-  drupal_install_schema('walls');
-}
-
-/**
  * Implements hook_schema().
  */
 function walls_schema() {
   $schema = array();
 
-  return $schema();
+  $schema['walls_object'] = array(
+    'description' => 'The table for walls object.',
+    'fields' => array(
+      'object_id' => array(
+        'description' => 'The primary identifier for a walls object id.',
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'entity_type' => array(
+        'description' => 'The entity type of this walls object.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'entity_id' => array(
+        'description' => 'The entity id of this walls object.',
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+    ),
+    'primary key' => array('object_id'),
+    'indexes' => array(
+      'entity_type' => array('entity_type'),
+      'entity_id' => array('entity_id'),
+    ),
+  );
+  $schema['walls_status'] = array(
+    'description' => 'The table for walls status.',
+    'fields' => array(
+      'status_id' => array(
+        'description' => 'The primary identifier for a walls status id.',
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'object_id' => array(
+        'description' => 'ID of object that this status belongs to.',
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'plugin' => array(
+        'description' => 'Name of plugin which handle the status.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'created' => array(
+        'description' => 'The Unix timestamp when the status was created.',
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'uid' => array(
+        'description' => ' The {users}.uid that owns this status.',
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'body' => array(
+        'type' => 'text',
+        'not null' => FALSE,
+        'size' => 'medium',
+        'description' => 'The content of the status.',
+      ),
+    ),
+    'primary key' => array('status_id'),
+    'indexes' => array(
+      'object_id' => array('object_id'),
+      'created' => array('created'),
+      'uid' => array('uid'),
+    ),
+    'foreign keys' => array(
+      'status_object' => array(
+        'table' => 'walls_object',
+        'columns' => array('object_id' => 'object_id'),
+      ),
+      'status_author' => array(
+        'table' => 'users',
+        'columns' => array('uid' => 'uid'),
+      ),
+    ),
+  );
+
+  return $schema;
 }
