From 3e57a57a6a926ee796bfa0745f1cc1b70f9180fc Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 19 Jan 2017 15:52:10 +0100 Subject: [PATCH] Fixed issue #650 - Unable to process emails with email addresses longer then 140 signs. --- db/migrate/20120101000001_create_base.rb | 4 ++-- db/migrate/20170119000001_login_email_lentgh_650.rb | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20170119000001_login_email_lentgh_650.rb diff --git a/db/migrate/20120101000001_create_base.rb b/db/migrate/20120101000001_create_base.rb index 125a59af3bc1..32f701843a40 100644 --- a/db/migrate/20120101000001_create_base.rb +++ b/db/migrate/20120101000001_create_base.rb @@ -16,10 +16,10 @@ def up create_table :users do |t| t.references :organization, null: true - t.string :login, limit: 100, null: false + t.string :login, limit: 255, null: false t.string :firstname, limit: 100, null: true, default: '' t.string :lastname, limit: 100, null: true, default: '' - t.string :email, limit: 140, null: true, default: '' + t.string :email, limit: 255, null: true, default: '' t.string :image, limit: 100, null: true t.string :image_source, limit: 200, null: true t.string :web, limit: 100, null: true, default: '' diff --git a/db/migrate/20170119000001_login_email_lentgh_650.rb b/db/migrate/20170119000001_login_email_lentgh_650.rb new file mode 100644 index 000000000000..513f8749fdf3 --- /dev/null +++ b/db/migrate/20170119000001_login_email_lentgh_650.rb @@ -0,0 +1,10 @@ +class LoginEmailLength650 < ActiveRecord::Migration + def up + + # return if it's a new setup + return if !Setting.find_by(name: 'system_init_done') + + change_column(:users, :login, :string, limit: 255) + change_column(:users, :email, :string, limit: 255) + end +end