Rails 5.0.0.beta3 - HoboFields has minor glitch

70 views
Skip to first unread message

Donald Ziesig

unread,
Mar 11, 2016, 2:33:03 PM3/11/16
to Hobo Users
Hi All!

I just upgraded to Rails 5.0.0.beta3 and everything seemed to be going
well until I noticed a minor annoyance.

I think I saw the same thing with beta2 but I was in the middle of
learning coffeescript so I was not paying attention.
It is not harmful, just strange.

When I do rails generate hobo:migration, the migration itself happens
correctly, but it seems to be updating all tables that have columns with
default values, as well.

For example, I added one field to a "Setup" table and ran
hobo:migration. The terminal output is:

Running via Spring preloader in process 13666

---------- Up Migration ----------
change_column :appointments, :completed, :boolean, :default => false
change_column :appointments, :cancelled, :boolean, :default => false

change_column :properties, :mon_start, :float, :default => 0
change_column :properties, :mon_end, :float, :default => 0
change_column :properties, :tue_start, :float, :default => 0
change_column :properties, :tue_end, :float, :default => 0
change_column :properties, :wed_start, :float, :default => 0
change_column :properties, :wed_end, :float, :default => 0
change_column :properties, :thu_start, :float, :default => 0
change_column :properties, :thu_end, :float, :default => 0
change_column :properties, :fri_start, :float, :default => 0
change_column :properties, :fri_end, :float, :default => 0
change_column :properties, :sat_start, :float, :default => 0
change_column :properties, :sat_end, :float, :default => 0
change_column :properties, :sun_start, :float, :default => 0
change_column :properties, :sun_end, :float, :default => 0

add_column :setups, :hours_in_advance, :integer #### the only change I made.

change_column :users, :is_admin, :boolean, :default => false
----------------------------------

---------- Down Migration --------
change_column :appointments, :completed, :boolean, default: false
change_column :appointments, :cancelled, :boolean, default: false

change_column :properties, :mon_start, :float, default: 0.0
change_column :properties, :mon_end, :float, default: 0.0
change_column :properties, :tue_start, :float, default: 0.0
change_column :properties, :tue_end, :float, default: 0.0
change_column :properties, :wed_start, :float, default: 0.0
change_column :properties, :wed_end, :float, default: 0.0
change_column :properties, :thu_start, :float, default: 0.0
change_column :properties, :thu_end, :float, default: 0.0
change_column :properties, :fri_start, :float, default: 0.0
change_column :properties, :fri_end, :float, default: 0.0
change_column :properties, :sat_start, :float, default: 0.0
change_column :properties, :sat_end, :float, default: 0.0
change_column :properties, :sun_start, :float, default: 0.0
change_column :properties, :sun_end, :float, default: 0.0

remove_column :setups, :hours_in_advance

change_column :users, :is_admin, :boolean, default: false
----------------------------------

What now: [g]enerate migration, generate and [m]igrate now or [c]ancel? m
=> "m"

Migration filename: [<enter>=hobo_migration_10|<custom_name>]:
=> "hobo_migration_10"
create db/migrate/20160311192034_hobo_migration_10.rb
rake db:migrate
== 20160311192034 HoboMigration10: migrating
==================================
-- change_column(:appointments, :completed, :boolean, {:default=>false})
-> 0.0093s
-- change_column(:appointments, :cancelled, :boolean, {:default=>false})
-> 0.0045s
-- change_column(:properties, :mon_start, :float, {:default=>0})
-> 0.0067s
-- change_column(:properties, :mon_end, :float, {:default=>0})
-> 0.0062s
-- change_column(:properties, :tue_start, :float, {:default=>0})
-> 0.0063s
-- change_column(:properties, :tue_end, :float, {:default=>0})
-> 0.0068s
-- change_column(:properties, :wed_start, :float, {:default=>0})
-> 0.0060s
-- change_column(:properties, :wed_end, :float, {:default=>0})
-> 0.0064s
-- change_column(:properties, :thu_start, :float, {:default=>0})
-> 0.0060s
-- change_column(:properties, :thu_end, :float, {:default=>0})
-> 0.0061s
-- change_column(:properties, :fri_start, :float, {:default=>0})
-> 0.0065s
-- change_column(:properties, :fri_end, :float, {:default=>0})
-> 0.0076s
-- change_column(:properties, :sat_start, :float, {:default=>0})
-> 0.0089s
-- change_column(:properties, :sat_end, :float, {:default=>0})
-> 0.0090s
-- change_column(:properties, :sun_start, :float, {:default=>0})
-> 0.0079s
-- change_column(:properties, :sun_end, :float, {:default=>0})
-> 0.0101s
-- add_column(:setups, :hours_in_advance, :integer)
-> 0.0025s
-- change_column(:users, :is_admin, :boolean, {:default=>false})
-> 0.0129s
== 20160311192034 HoboMigration10: migrated (0.1334s)
=========================


I searched all of the models in the app, and the fields shown above are
all the fields with default values. None are missing.

I am using PostgreSQL 9.3.4 if that makes a difference.

As I said, this is a minor annoyance, but I always worry when things
that don't have to be changed are changed. Just one more thing that can
go wrong .... go wrong .... go..... wrdna..... NO CARRIER ;)

Don Ziesig




Henry Baragar

unread,
Mar 22, 2016, 9:06:55 AM3/22/16
to hobo...@googlegroups.com
Donald,

It won't be a minor annoyance if the migration tries to change one of my tables that has over a billion rows. 

Henry
--

 

Henry Baragar

Director, Software Development

CSE | Canadian Securities Exchange

(647) 729-8325

               

220 Bay Street, 9th Floor | Toronto | ON | Canada | M5J 2W4

www.thecse.com | @CSE_News 

 

Ed Gomolka

unread,
Mar 24, 2016, 12:01:05 AM3/24/16
to Hobo Users
This issue also exists under Hobo 2.2.5/Rails 4.2.5.1/PostgreSQL 9.3.10.

Ignacio Huerta

unread,
Sep 2, 2016, 3:08:38 AM9/2/16
to Hobo Users
This error has been fixed in master branch: https://github.com/Hobo/hobo/issues/186

Owen Dall

unread,
Sep 4, 2016, 5:51:45 AM9/4/16
to Hobo Users
Thanks much, Ignacio!
Reply all
Reply to author
Forward
0 new messages