String ID -> schema.rb incorrect?


I made one of my ID columns a string, because I don’t want my IDs to
be guessable (I use a md5 hash of some system parameters with
rehashing in case of collisions.)

My migration reads:

change_column :users, :id, :string
change_column :comments, :user_id, :string

Afterwards executing this my db/schema.rb looks like this:

create_table “comments”, :force => true do |t|
t.integer “commentable_id”
t.string “commentable_type”
t.string “user_id”
t.datetime “date”
t.text “body”
#so far so good

create_table “users”, :force => true do |t|
t.string “email”
t.string “pwd_hash”
t.boolean “is_active”
t.datetime “last_activity”
t.string “pwd_salt”
t.string “activation_key”
t.datetime “signup_date”

hmm, I consider it a bug, because running the migrations and loading
the schema from schema.rb lead to different schemas.
What do you think?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs