Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration Generator changes column type #133

Open
haslinger opened this issue Dec 19, 2014 · 0 comments
Open

Migration Generator changes column type #133

haslinger opened this issue Dec 19, 2014 · 0 comments

Comments

@haslinger
Copy link

I see a strange issue here: I added to the user model

erp_account_nr   :string, :index => true
erp_contact_nr   :string

a long time ago.
Suddenly when i run the migration generator (because of a change in another model),
it also wants to change

---------- Up Migration ----------
change_column :users, :erp_contact_nr, :integer, :limit => 4
change_column :users, :erp_account_nr, :integer, :limit => 4

and correspondingly

---------- Down Migration --------
change_column :users, :erp_contact_nr, :string
change_column :users, :erp_account_nr, :string

It's not a shopstopper, I just don't migrate immediately, fix the migration by hand and run it, but I don't get a few things:

  • Why does it suggest :limit => 4 , this is so un-Hobo-esque ?
  • I don't find any limit setting to 4 in the Hobo code, I looked in the current /hobo/hobo_fields/lib/generators/hobo/migration/*
  • I thought, maybe it's the postfix _nr ... so I thought : change the columns to erp_account_nur, but that wouldn't rename, it would retype the old column to integer still and create a new column.

Probably I'm doing something completely wrong here ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant