From 3a0b6a93ad085c549b7c65442e7734a2615a3897 Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Mon, 9 Dec 2013 17:38:04 -0600 Subject: [PATCH] Update test schema.rb to match current migration However, set force: true and didn't set indices Fixes test failures for postgresql:: No integer type has byte size 11. Use a numeric with precision 0 instead. https://travis-ci.org/mbleigh/acts-as-taggable-on/jobs/15196579 see https://github.com/rails/rails/issues/6272 --- spec/schema.rb | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/spec/schema.rb b/spec/schema.rb index 4949f0107..2d2e27453 100644 --- a/spec/schema.rb +++ b/spec/schema.rb @@ -1,59 +1,63 @@ ActiveRecord::Schema.define :version => 0 do - create_table "taggings", :force => true do |t| - t.integer "tag_id", :limit => 11 - t.integer "taggable_id", :limit => 11 - t.string "taggable_type" - t.string "context" - t.datetime "created_at" - t.integer "tagger_id", :limit => 11 - t.string "tagger_type" + create_table :tags, :force => true do |t| + t.string :name end - add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" - add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" + create_table :taggings, :force => true do |t| + t.references :tag - create_table "tags", :force => true do |t| - t.string "name" + # You should make sure that the column created is + # long enough to store the required class names. + t.references :taggable, :polymorphic => true + t.references :tagger, :polymorphic => true + + # Limit is created to prevent MySQL error on index + # length for MyISAM table type: http://bit.ly/vgW2Ql + t.string :context, :limit => 128 + + t.datetime :created_at end - + # above copied from + # generators/acts_as_taggable_on/migration/migration_generator + create_table :taggable_models, :force => true do |t| t.column :name, :string t.column :type, :string end - + create_table :non_standard_id_taggable_models, :primary_key => "an_id", :force => true do |t| t.column :name, :string t.column :type, :string end - + create_table :untaggable_models, :force => true do |t| t.column :taggable_model_id, :integer t.column :name, :string end - + create_table :cached_models, :force => true do |t| t.column :name, :string t.column :type, :string t.column :cached_tag_list, :string end - + create_table :other_cached_models, :force => true do |t| t.column :name, :string t.column :type, :string - t.column :cached_language_list, :string + t.column :cached_language_list, :string t.column :cached_status_list, :string t.column :cached_glass_list, :string end - + create_table :users, :force => true do |t| t.column :name, :string end - + create_table :other_taggable_models, :force => true do |t| t.column :name, :string t.column :type, :string end - + create_table :ordered_taggable_models, :force => true do |t| t.column :name, :string t.column :type, :string