From cc36578a7f913be66ba23761d7be56ac632427e9 Mon Sep 17 00:00:00 2001
From: Eric Rasmussen <eric@unl.edu>
Date: Tue, 5 Oct 2010 19:52:05 +0000
Subject: [PATCH] Bring unl_schema() up to date with latest unl_sites table
 changes so that a fresh drupal install will work; Fix unl_update_ functions
 by removing multiple adds of clean_url column which causes update to fail

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@224 20a16fea-79d4-4915-8869-1ea9d5ebf173
---
 sites/all/modules/unl/unl.install | 35 ++++++++++++++-----------------
 1 file changed, 16 insertions(+), 19 deletions(-)

diff --git a/sites/all/modules/unl/unl.install b/sites/all/modules/unl/unl.install
index 32696338..5ca132fe 100644
--- a/sites/all/modules/unl/unl.install
+++ b/sites/all/modules/unl/unl.install
@@ -10,12 +10,6 @@ function unl_schema() {
         'unsigned' => TRUE,
         'not null' => TRUE,
       ),
-      'site_path_prefix' => array(
-        'type'     => 'varchar',
-        'length'   => 255,
-        'not null' => TRUE,
-        'default'  => '',
-      ),
       'site_path' => array(
         'type'     => 'varchar',
         'length'   => 255,
@@ -37,18 +31,26 @@ function unl_schema() {
         'type'     => 'int',
         'not null' => TRUE,
         'default'  => 1,
+      ),
+      'db_prefix' => array(
+        'type'     => 'varchar',
+        'length'   => 255,
+        'not null' => TRUE,
+        'default'  => '',
       )
     ),
     'primary key' => array('site_id'),
     'unique keys' => array(
-      'sub_site' => array('site_path_prefix', 'site_path'),
+      'sub_site' => array('site_path'),
     )
   );
   
-
   return $schema;
 }
 
+/**
+ * Updates prior to upgrading to unl module 7.x-1.0
+ */
 function unl_update_7100() {
   $table = array(
     'description' => 'Table of tables to be programatically created',
@@ -58,6 +60,12 @@ function unl_update_7100() {
         'unsigned' => TRUE,
         'not null' => TRUE,
       ),
+      'site_path_prefix' => array(
+        'type'     => 'varchar',
+        'length'   => 255,
+        'not null' => TRUE,
+        'default'  => '',
+      ),
       'site_path' => array(
         'type'     => 'varchar',
         'length'   => 255,
@@ -74,17 +82,6 @@ function unl_update_7100() {
         'type'     => 'int',
         'not null' => TRUE,
         'default'  => 0,
-      ),
-      'clean_url'  => array(
-        'type'     => 'int',
-        'not null' => TRUE,
-        'default'  => 1,
-      ),
-      'db_prefix' => array(
-        'type'     => 'varchar',
-        'length'   => 255,
-        'not null' => TRUE,
-        'default'  => '',
       )
     ),
     'primary key' => array('site_id'),
-- 
GitLab