Index: og_panels.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/og/modules/og_panels/Attic/og_panels.install,v
retrieving revision 1.4
diff -u -p -r1.4 og_panels.install
--- og_panels.install	29 Oct 2008 19:59:08 -0000	1.4
+++ og_panels.install	10 Jun 2009 14:08:31 -0000
@@ -1,36 +1,13 @@
 <?php
 // $Id: og_panels.install,v 1.4 2008/10/29 19:59:08 dww Exp $
 
+/**
+ * @file
+ * Install, update and uninstall functions for the og_panels module.
+ */
+
 function og_panels_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      db_query("CREATE TABLE {og_panels} (
-        did int NOT NULL,
-        nid int NOT NULL,
-        published int NOT NULL,
-        page_title varchar(255) NOT NULL,
-        path varchar(100) NOT NULL,
-        default_page int NULL,
-        show_blocks int NULL,
-        weight int(4) NOT NULL DEFAULT 0,
-        PRIMARY KEY  (did)
-      ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-      break;
-    case 'pgsql':
-      db_query("CREATE TABLE {og_panels} (
-        did integer NOT NULL,
-        nid integer NOT NULL,
-        published integer NOT NULL,
-        page_title varchar(255) NOT NULL,
-        path varchar(100) NOT NULL,
-        default_page integer NULL,
-        show_blocks integer NULL,
-        weight integer(4) NOT NULL DEFAULT 0,
-        PRIMARY KEY  (did)
-      );");
-      break;
-  }
+  drupal_install_schema('og_panels');
 }
 
 function og_panels_update_5001() {
@@ -56,3 +33,67 @@ function og_panels_uninstall() {
     variable_del($variable);
   }
 }
+
+/**
+ * Implementation of hook_schema().
+ */
+function og_panels_schema() {
+  $schema['og_panels'] = array(
+    'description' => 'Stores a panel for a group',
+    'fields' => array(
+      'nid'             => array(
+        'description'     => "The group's {node}.nid.",
+        'type'            => 'int',
+        'size'            => 'normal',
+        'not null'        => TRUE,
+      ),
+      'did'             => array(
+        'description'     => "The group's panels did.",
+        'type'            => 'int',
+        'size'            => 'normal',
+        'not null'        => TRUE,
+      ),
+      'published'             => array(
+        'description'     => "is the panels published yet or not",
+        'type'            => 'int',
+        'size'            => 'normal',
+        'not null'        => TRUE,
+      ),
+      'page_title'             => array(
+        'description'     => "store the Pagetitle of the panel",
+        'type'            => 'varchar',
+        'length'          => 255,
+        'not null'        => TRUE,
+      ),
+      'path'             => array(
+        'description'     => "stores the path of the panel page",
+        'type'            => 'varchar',
+        'length'          => 100,
+        'not null'        => TRUE,
+      ),
+      'default_page'             => array(
+        'description'     => "stores wether the panel page is the default page",
+        'type'            => 'int',
+        'size'            => 'normal',
+        'null'        => TRUE,
+      ),
+      'show_blocks'             => array(
+        'description'     => "stores wether the panel page is the default page",
+        'type'            => 'int',
+        'size'            => 'normal',
+        'null'        => TRUE,
+      ),
+      'weight'             => array(
+        'description'     => "stores the page weight of the page",
+        'type'            => 'int',
+        'size'            => 'normal',
+        'not null'        => TRUE,
+        'default' => '0',
+      ),
+    ),
+    'primary keys' => ('did'),
+  );
+
+  return $schema;
+}
+
