Based off http://guides.rubyonrails.org/v3.2.21/migrations.html and given the following migration:
class CreateVacations < ActiveRecord::Migration
def change
create_table :vacations do |t|
t.string :name
t.string :slug, :uniqueness => true
t.datetime :starts_at
t.datetime :ends_at
t.timestamps
end
end
end
I ran rake db:migrate and see this schema:
ActiveRecord::Schema.define(:version => 20150825170615) do
create_table "vacations", :force => true do |t|
t.string "name"
t.string "slug"
t.datetime "starts_at"
t.datetime "ends_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
end
I do not ssee any uniqueness requirement for 'slug'. If I did it wrong, how can I fix it at this point?
If it was right, why doesn't the schema say it's unique? Thank you