diff --git a/application/config/version.php b/application/config/version.php index 7fe47efa1e5..42892cb6cc0 100644 --- a/application/config/version.php +++ b/application/config/version.php @@ -13,7 +13,7 @@ */ $config['versionnumber'] = "2.50+"; -$config['dbversionnumber'] = 255; +$config['dbversionnumber'] = 256; $config['buildnumber'] = ''; $config['updatable'] = true; //$config['updaterversion'] = 1; diff --git a/application/helpers/update/updatedb_helper.php b/application/helpers/update/updatedb_helper.php index 511b703615e..5488c16a9aa 100644 --- a/application/helpers/update/updatedb_helper.php +++ b/application/helpers/update/updatedb_helper.php @@ -1358,7 +1358,12 @@ function db_upgrade_all($iOldDBVersion) { // Update DBVersion $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>255),"stg_name='DBVersion'"); } - + if ( $iOldDBVersion < 256 ) + { + upgradeTokenTables256(); + alterColumn('{{participants}}', 'email', "text", false); + $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>256),"stg_name='DBVersion'"); + } $oTransaction->commit(); // Activate schema caching $oDB->schemaCachingDuration=3600; @@ -1385,6 +1390,22 @@ function db_upgrade_all($iOldDBVersion) { return true; } + +function upgradeTokenTables256() +{ + $surveyidresult = dbGetTablesLike("tokens%"); + if ($surveyidresult) + { + foreach ( $surveyidresult as $sTableName ) + { + alterColumn($sTableName, 'email', "text"); + alterColumn($sTableName, 'firstname', "string(150)"); + alterColumn($sTableName, 'lastname', "string(150)"); + } + } +} + + function upgradeSurveyTables255() { // We delete all the old boxes, and reinsert new ones diff --git a/application/models/Token.php b/application/models/Token.php index 845cec8459a..fa8df4b5733 100644 --- a/application/models/Token.php +++ b/application/models/Token.php @@ -83,8 +83,8 @@ public static function createTable($surveyId, array $extraFields = array()) $fields = array( 'tid' => 'pk', 'participant_id' => 'string(50)', - 'firstname' => 'string(40)', - 'lastname' => 'string(40)', + 'firstname' => 'string(150)', + 'lastname' => 'string(150)', 'email' => 'text', 'emailstatus' => 'text', 'token' => "string(35) {$sCollation}", diff --git a/application/views/admin/homepagesettings/index.php b/application/views/admin/homepagesettings/index.php index 3078fe62dcd..ada3a4451d1 100644 --- a/application/views/admin/homepagesettings/index.php +++ b/application/views/admin/homepagesettings/index.php @@ -38,7 +38,7 @@
- +
diff --git a/application/views/admin/super/fullpagebar_view.php b/application/views/admin/super/fullpagebar_view.php index 987f48cafd6..331ffa4574c 100644 --- a/application/views/admin/super/fullpagebar_view.php +++ b/application/views/admin/super/fullpagebar_view.php @@ -50,7 +50,7 @@ - + diff --git a/installer/sql/create-mssql.sql b/installer/sql/create-mssql.sql index a5c5ac94ece..0486ad6f043 100644 --- a/installer/sql/create-mssql.sql +++ b/installer/sql/create-mssql.sql @@ -195,7 +195,7 @@ CREATE TABLE [prefix_participants] ( [participant_id] varchar(50) NOT NULL, [firstname] nvarchar(150) NULL, [lastname] nvarchar(150) NULL, -[email] nvarchar(254) NULL, +[email] nvarchar(max) NULL, [language] varchar(40) NULL, [blacklisted] varchar(1) NOT NULL, [owner_uid] int NOT NULL, @@ -592,4 +592,4 @@ create index [parent_qid_idx] on [prefix_questions] ([parent_qid]); -- -- Version Info -- -INSERT INTO [prefix_settings_global] VALUES ('DBVersion', '255'); +INSERT INTO [prefix_settings_global] VALUES ('DBVersion', '256'); diff --git a/installer/sql/create-mysql.sql b/installer/sql/create-mysql.sql index 8c3e52e46df..d7710457260 100644 --- a/installer/sql/create-mysql.sql +++ b/installer/sql/create-mysql.sql @@ -195,7 +195,7 @@ CREATE TABLE `prefix_participants` ( `participant_id` varchar(50) NOT NULL, `firstname` varchar(150) DEFAULT NULL, `lastname` varchar(150) DEFAULT NULL, - `email` varchar(254) DEFAULT NULL, + `email` text, `language` varchar(40) DEFAULT NULL, `blacklisted` varchar(1) NOT NULL, `owner_uid` int(11) NOT NULL, @@ -598,4 +598,4 @@ CREATE INDEX `parent_qid_idx` ON `prefix_questions` (`parent_qid`); -- -- Version Info -- -INSERT INTO `prefix_settings_global` VALUES ('DBVersion', '255'); +INSERT INTO `prefix_settings_global` VALUES ('DBVersion', '256'); diff --git a/installer/sql/create-pgsql.sql b/installer/sql/create-pgsql.sql index ef57fa5fac8..424ded35886 100644 --- a/installer/sql/create-pgsql.sql +++ b/installer/sql/create-pgsql.sql @@ -201,7 +201,7 @@ CREATE TABLE prefix_participants ( "participant_id" character varying(50) PRIMARY KEY NOT NULL, "firstname" character varying(150), "lastname" character varying(150), - "email" character varying(254), + "email" text, "language" character varying(40), "blacklisted" character varying(1) NOT NULL, "owner_uid" integer NOT NULL, @@ -602,4 +602,4 @@ create unique index permissions_idx2 ON prefix_permissions (entity_id, entity, u -- -- Version Info -- -INSERT INTO prefix_settings_global VALUES ('DBVersion', '255'); +INSERT INTO prefix_settings_global VALUES ('DBVersion', '256');