From ddb0faf5bc68598aec7b5fb3a500d67e952a6e59 Mon Sep 17 00:00:00 2001
From: Alexandr Kirienko <alex@kirienko.net>
Date: Thu, 3 Dec 2015 12:47:51 +0300
Subject: [PATCH] #2316625: Make http_referer column a TEXT type

---
 referral.install | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/referral.install b/referral.install
index 76157cc..c35fb8d 100755
--- a/referral.install
+++ b/referral.install
@@ -45,10 +45,8 @@ function referral_schema() {
         'default' => '',
         'description' => t('Network address.')),
       'http_referer' => array(
-        'type' => 'varchar',
-        'length' => 255,
+        'type' => 'text',
         'not null' => TRUE,
-        'default' => '',
         'description' => t('URL of referer site.'),),
     ),
     'primary key' => array('uid'),
@@ -72,3 +70,16 @@ function referral_uninstall() {
   // Remove variables.
   db_query("DELETE FROM {variable} WHERE name LIKE 'referral_%%'");
 }
+
+/**
+ * Change type of {referral}.http_referer from varchar to text.
+ */
+function referral_update_7001() {
+  if (db_field_exists('referral', 'http_referer')) {
+    db_change_field('referral', 'http_referer', 'http_referer', array(
+      'type' => 'text',
+      'not null' => TRUE,
+      'description' => t('URL of referer site.'),
+    ));
+  }
+}
-- 
1.9.1

