Truncates values from the db before shortening them
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
class SetUsernameLimit < ActiveRecord::Migration
|
||||
def change
|
||||
execute "ALTER TABLE users ALTER COLUMN username TYPE VARCHAR(60) USING SUBSTR(username, 1, 60)"
|
||||
change_column :users, :username, :string, limit: 60
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
class SetOrganizationNameLimit < ActiveRecord::Migration
|
||||
def change
|
||||
execute "ALTER TABLE organizations ALTER COLUMN name TYPE VARCHAR(60) USING SUBSTR(name, 1, 60)"
|
||||
change_column :organizations, :name, :string, limit: 60
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
class SetTagNameLimit < ActiveRecord::Migration
|
||||
def change
|
||||
execute "ALTER TABLE tags ALTER COLUMN name TYPE VARCHAR(40) USING SUBSTR(name, 1, 40)"
|
||||
change_column :tags, :name, :string, limit: 40
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user