Using `int` should suffice here, unless one needs the whole `unsigned`
range, or one is worried about conversions actually producing negative
values AND those creating problems.
This commit is contained in:
Stephan Günther 2017-09-22 15:55:47 +02:00
parent 160d0d805e
commit 14ef0460c8

View File

@ -69,7 +69,7 @@ class DmsfFileContainerRollback < ActiveRecord::Migration
def down
# dmsf_files
file_folder_ids = DmsfFile.joins(:dmsf_folder).where(:dmsf_folders => { :system => true }).pluck('dmsf_files.id, cast(dmsf_folders.title as unsigned)')
file_folder_ids = DmsfFile.joins(:dmsf_folder).where(:dmsf_folders => { :system => true }).pluck('dmsf_files.id, cast(dmsf_folders.title as int)')
remove_index :dmsf_files, :project_id
rename_column :dmsf_files, :project_id, :container_id
add_column :dmsf_files, :project_id, :int, :null => true # temporarily added for the save method