--- og_panels.install  2010-05-30 23:03:13.809366065 -0700
+++ og_panels_new.install  2010-05-30 23:03:29.498368532 -0700
@@ -20,6 +20,7 @@ function og_panels_uninstall() {
 */
 function og_panels_enable() {
   variable_set('page_manager_node_view_disabled', FALSE);
+  drupal_flush_all_caches();
 }


@@ -78,6 +79,17 @@ function og_panels_schema() {
         'type' => 'int',
         'not null' => TRUE,
         'default' => 0),
+      'use_template' => array(
+        'description' => 'Boolean: is this panels page going to use preset template or not',
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0),
+      'template_did' => array(
+        'description' => 'A display id of the preset template',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0),
       'tab_num' => array(
         'description' => 'Tab number for this node_tab.',
         'type' => 'int',
@@ -93,6 +105,26 @@ function og_panels_schema() {
      ),
     'primary key' => array('nid', 'tab_num'),
   );
+
+  $schema['og_panels_templates'] = array(
+    'description' => 'Define templates for OG Panels',
+    'fields' => array(
+      'name' => array(
+        'description' => 'An OG Panels Template Name',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => ''),
+      'did' => array(
+        'description' => 'A panels display id.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0),
+    ),
+    'unique keys' => array('name' => array('name')),
+  );
+
   return $schema;
 }

@@ -198,4 +230,21 @@ function og_panels_update_6002() {
   }

   return $ret;
+}
+
+function og_panels_update_6003(){
+  $ret   = array();
+
+  //add new field template_did to og_panels table
+  $ret[] = update_sql("ALTER TABLE {og_panels} ADD COLUMN use_template int(11) NOT NULL DEFAULT 0 AFTER weight");
+  $ret[] = update_sql("ALTER TABLE {og_panels} ADD COLUMN template_did int(11) NOT NULL DEFAULT 0 AFTER use_template");
+
+  //create table og_panels_templates
+  if (!db_table_exists('og_panels_templates')) {
+    $schema = og_panels_schema();
+    db_create_table($ret, 'og_panels_templates', $schema['og_panels_templates']);
+    return $ret;
+  }
+
+  return $ret;
 }
