diff --git a/migrations/m170307_100221_update_email_type.php b/migrations/m170307_100221_update_email_type.php new file mode 100644 index 00000000..9acbab96 --- /dev/null +++ b/migrations/m170307_100221_update_email_type.php @@ -0,0 +1,29 @@ +alterColumn('user', 'email', 'varchar(254)'); + } + + public function down() + { + echo "m170307_100221_update_email_type cannot be reverted.\n"; + + return false; + } + + /* + // Use safeUp/safeDown to run migration code within a transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} diff --git a/migrations/mysql.schema.sql b/migrations/mysql.schema.sql index 1e83df31..98b5ee1f 100644 --- a/migrations/mysql.schema.sql +++ b/migrations/mysql.schema.sql @@ -280,7 +280,7 @@ CREATE TABLE IF NOT EXISTS `user` ( `updated_at` int(11) NOT NULL, `registration_ip` varchar(15) DEFAULT NULL, `bind_to_ip` varchar(255) DEFAULT NULL, - `email` varchar(128) DEFAULT NULL, + `email` varchar(254) DEFAULT NULL, `email_confirmed` smallint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; diff --git a/views/auth/confirmEmail.php b/views/auth/confirmEmail.php index c21d1978..42d1a23d 100644 --- a/views/auth/confirmEmail.php +++ b/views/auth/confirmEmail.php @@ -34,7 +34,7 @@ 'validateOnBlur'=>false, ]); ?> - field($model, 'email')->textInput(['maxlength' => 255, 'autofocus'=>true]) ?> + field($model, 'email')->textInput(['maxlength' => 254, 'autofocus'=>true]) ?>
diff --git a/views/auth/passwordRecovery.php b/views/auth/passwordRecovery.php index b834c6d0..c68b7818 100644 --- a/views/auth/passwordRecovery.php +++ b/views/auth/passwordRecovery.php @@ -30,7 +30,7 @@ 'validateOnBlur'=>false, ]); ?> - field($model, 'email')->textInput(['maxlength' => 255, 'autofocus'=>true]) ?> + field($model, 'email')->textInput(['maxlength' => 254, 'autofocus'=>true]) ?> field($model, 'captcha')->widget(Captcha::className(), [ 'template' => '
{image}
{input}
', diff --git a/views/user/_form.php b/views/user/_form.php index e828d60f..4736ff75 100644 --- a/views/user/_form.php +++ b/views/user/_form.php @@ -44,7 +44,7 @@ - field($model, 'email')->textInput(['maxlength' => 255]) ?> + field($model, 'email')->textInput(['maxlength' => 254]) ?> field($model, 'email_confirmed')->checkbox() ?> @@ -70,4 +70,4 @@
- \ No newline at end of file +