Skip to content

Instantly share code, notes, and snippets.

@universal
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save universal/0aae5a4ef69a4eaea1ac to your computer and use it in GitHub Desktop.

Select an option

Save universal/0aae5a4ef69a4eaea1ac to your computer and use it in GitHub Desktop.
class AddIndexToLineItems < ActiveRecord::Migration
def change
add_index :line_items, [:user_id, :product_id], unique: true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment