Wednesday, July 13, 2011

[Rails] Adding a sequence to a migration

I want a field in my table to be a sequence that is not the id of the
record. Something like

create_table :foo do |t|
...
t.sequence :seq
...
end

Is there a clean way of doing this in migrations or will I end up
having to hack something. Like having an integer field and copying in
the id in an after_create filter?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate