KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
here is my migration in rails 3.2.2: class CreateStatistics < ActiveRecord::Migration def change create_table :statistics do |t| t.string :name t.integer :item_id t.integer :value t.text :desc t.timestamps t.index [:name, :item_id] end end end and here is the migrate error: == CreateStatistics: migrating =============================================== -- create_table(:statistics) ActiveRecord::ConnectionAdapters::TableDefinition rake aborted! An error has occurred, all later migrations canceled: undefined method `index' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0xbd16888> Tasks: TOP => db:migrate (See full trace by running task with --trace) what is the right way to create a index?
Tags (comma-separated)
Save Edits
Cancel