Author: david
Date: Mon Jul  2 14:57:11 2012
New Revision: 11838

Log:
Add data migration for r11837. Fixes issue 1628

Modified:
   trunk/data/fixtures/settings.yml
   trunk/lib/task/migrate/arUpgrader120.class.php

Modified: trunk/data/fixtures/settings.yml
==============================================================================
--- trunk/data/fixtures/settings.yml    Mon Jul  2 11:24:47 2012        (r11837)
+++ trunk/data/fixtures/settings.yml    Mon Jul  2 14:57:11 2012        (r11838)
@@ -3,7 +3,7 @@
     name: version
     editable: 0
     deleteable: 0
-    value: 81
+    value: 82
   QubitSetting_2:
     name: upload_dir
     editable: 0

Modified: trunk/lib/task/migrate/arUpgrader120.class.php
==============================================================================
--- trunk/lib/task/migrate/arUpgrader120.class.php      Mon Jul  2 11:24:47 
2012        (r11837)
+++ trunk/lib/task/migrate/arUpgrader120.class.php      Mon Jul  2 14:57:11 
2012        (r11838)
@@ -162,6 +162,96 @@
 
         break;
 
+      // Use "text" field type to avoid truncating long strings (issue 1628)
+      case 82:
+        // TEXT
+        $textColumns = array(
+          'actor' => array(
+            'corporate_body_identifiers', 'description_identifier', 
'source_standard'),
+          'actor_i18n' => array(
+            'authorized_form_of_name', 'dates_of_existence', 
'institution_responsible_identifier'),
+          'contact_information' => array(
+            'contact_person', 'website'),
+          'contact_information_i18n' => array(
+            'contact_type', 'city', 'region'),
+          'event_i18n' => array(
+            'name', 'date'),
+          'function' => array(
+            'description_identifier', 'source_standard'),
+          'function_i18n' => array(
+            'authorized_form_of_name', 'classification', 'dates'),
+          'information_object' => array(
+            'identifier', 'description_identifier', 'source_standard'),
+          'information_object_i18n' => array(
+            'title', 'alternate_title', 'edition', 
'institution_responsible_identifier'),
+          'menu' => array(
+            'name', 'path'),
+          'menu_i18n' => array(
+            'label'),
+          'note' => array(
+            'scope'),
+          'oai_harvest' => array(
+            'metadataPrefix', 'set'),
+          'oai_repository' => array(
+            'name', 'uri'),
+          'other_name_i18n' => array(
+            'name', 'note'),
+          'physical_object_i18n' => array(
+            'name'),
+          'property' => array(
+            'scope', 'name'),
+          'property_i18n' => array(
+            'value'),
+          'relation_i18n' => array(
+            'date'),
+          'repository' => array(
+            'identifier', 'desc_identifier'),
+          'repository_i18n' => array(
+            'desc_institution_identifier'),
+          'rights' => array(
+            'copyright_jurisdiction'),
+          'setting' => array(
+            'name', 'scope'),
+          'static_page_i18n' => array(
+            'title'),
+          'taxonomy' => array(
+            'usage'),
+          'taxonomy_i18n' => array(
+            'name'),
+          'term' => array(
+            'code'),
+          'term_i18n' => array(
+            'name')
+        );
+
+        // Convert varchar columns to text
+        foreach ($textColumns as $tablename => $cols)
+        {
+          foreach ($cols as $col)
+          {
+            $sql = sprintf('ALTER TABLE %s MODIFY `%s` TEXT;', $tablename, 
$col);
+            QubitPdo::modify($sql);
+          }
+        }
+
+        // TEXT NOT NULL
+        $textNotNullColumns = array(
+          'digital_object' => array(
+            'name', 'path')
+        );
+
+        foreach ($textNotNullColumns as $tablename => $cols)
+        {
+          foreach ($cols as $col)
+          {
+            var_dump($tablename, $col);
+            $sql = sprintf('ALTER TABLE %s MODIFY %s TEXT NOT NULL;', 
$tablename, $col);
+            QubitPdo::modify($sql);
+          }
+        }
+
+        break;
+
       // TODO Add refId column to terms table???
       case 82:
         // $sql = sprintf('ALTER TABLE %s ADD COLUMN ref_id varchar(255);', 
QubitTaxonomy::TABLE_NAME);

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to