X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/19ea2726815a0d74f718339b1e42f76cc4bb463c..b586b7eece173fe0cf0ce5e53aa8969f1239ef16:/services/api/db/migrate/20190322174136_add_file_info_to_collection.rb diff --git a/services/api/db/migrate/20190322174136_add_file_info_to_collection.rb b/services/api/db/migrate/20190322174136_add_file_info_to_collection.rb old mode 100755 new mode 100644 index 816514e67a..c0cd40d28e --- a/services/api/db/migrate/20190322174136_add_file_info_to_collection.rb +++ b/services/api/db/migrate/20190322174136_add_file_info_to_collection.rb @@ -2,9 +2,20 @@ # # SPDX-License-Identifier: AGPL-3.0 -class AddFileInfoToCollection < ActiveRecord::Migration - def change +class AddFileInfoToCollection < ActiveRecord::Migration[4.2] + def up add_column :collections, :file_count, :integer, default: 0, null: false - add_column :collections, :file_size_total, :integer, default: 0, null: false + add_column :collections, :file_size_total, :integer, limit: 8, default: 0, null: false + + puts "Collections now have two new columns, file_count and file_size_total." + puts "They were initialized with a zero value. If you are upgrading an Arvados" + puts "installation, please run the populate-file-info-columns-in-collections.rb" + puts "script to populate the columns. If this is a new installation, that is not" + puts "necessary." + end + + def down + remove_column :collections, :file_count + remove_column :collections, :file_size_total end end