I am trying to find a way to achieve this, but I cannot find any attempts, even so I think that maybe my approach is completely wrong. However, what should I do in my migration if I want the combination of the two fields to be unique? Note that I do not want them to be indexes, just database fields.
For example, to go below, I can separately add unique: true to the fields, but combos?
class CreateSomething < ActiveRecord::Migration def change create_table :something do |t| t.date :datestamp, :null => false t.integer :some_number, :null => false t.timestamps end end end
source share