diff --git a/db/migrate/20120512211613_add_order_indexes.rb b/db/migrate/20120512211613_add_order_indexes.rb new file mode 100644 index 00000000..e2f5eda2 --- /dev/null +++ b/db/migrate/20120512211613_add_order_indexes.rb @@ -0,0 +1,11 @@ +class AddOrderIndexes < ActiveRecord::Migration + def self.up + add_index :group_order_articles, :group_order_id + add_index :group_order_articles, :order_article_id + end + + def self.down + remove_index :group_order_articles, :group_order_id + remove_index :group_order_articles, :order_article_id + end +end diff --git a/db/schema.rb b/db/schema.rb index a62d1c3f..618b7270 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,15 +1,17 @@ -# This file is auto-generated from the current state of the database. Instead of editing this file, -# please use the migrations feature of Active Record to incrementally modify your database, and -# then regenerate this schema definition. +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. # -# Note that this schema.rb definition is the authoritative source for your database schema. If you need -# to create the application database on another system, you should be using db:schema:load, not running -# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations # you'll amass, the slower it'll run and the greater likelihood for issues). # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20110507192928) do +ActiveRecord::Schema.define(:version => 20120512211613) do create_table "article_categories", :force => true do |t| t.string "name", :default => "", :null => false @@ -114,6 +116,8 @@ ActiveRecord::Schema.define(:version => 20110507192928) do end add_index "group_order_articles", ["group_order_id", "order_article_id"], :name => "goa_index", :unique => true + add_index "group_order_articles", ["group_order_id"], :name => "index_group_order_articles_on_group_order_id" + add_index "group_order_articles", ["order_article_id"], :name => "index_group_order_articles_on_order_article_id" create_table "group_orders", :force => true do |t| t.integer "ordergroup_id", :default => 0, :null => false