Permalink
Browse files

Changed allowed_children_cache type from string to text so old (mysql…

…) versions dont truncate the contents and wreck havoc. Fixes GH-316
  • Loading branch information...
1 parent c666e52 commit e9c6419d8e02af9d56f89386ace6d544f4596888 @blj blj committed Feb 10, 2012
Showing with 14 additions and 5 deletions.
  1. +9 −0 db/migrate/20120209231801_change_pages_allowed_children_cache_to_text.rb
  2. +5 −5 db/schema.rb
View
9 db/migrate/20120209231801_change_pages_allowed_children_cache_to_text.rb
@@ -0,0 +1,9 @@
+class ChangePagesAllowedChildrenCacheToText < ActiveRecord::Migration
+ def self.up
+ change_column :pages, :allowed_children_cache, :text
+ end
+
+ def self.down
+ change_column :pages, :allowed_children_cache, :string, :limit => 1500
+ end
+end
View
10 db/schema.rb
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20110902203823) do
+ActiveRecord::Schema.define(:version => 20120209231801) do
create_table "assets", :force => true do |t|
t.string "caption"
@@ -79,17 +79,17 @@
t.string "slug", :limit => 100
t.string "breadcrumb", :limit => 160
t.string "class_name", :limit => 25
- t.integer "status_id", :default => 1, :null => false
+ t.integer "status_id", :default => 1, :null => false
t.integer "parent_id"
t.integer "layout_id"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "published_at"
t.integer "created_by_id"
t.integer "updated_by_id"
- t.boolean "virtual", :default => false, :null => false
- t.integer "lock_version", :default => 0
- t.string "allowed_children_cache", :default => ""
+ t.boolean "virtual", :default => false, :null => false
+ t.integer "lock_version", :default => 0
+ t.text "allowed_children_cache", :limit => 1500, :default => ""
end
add_index "pages", ["class_name"], :name => "altered_pages_class_name"

0 comments on commit e9c6419

Please sign in to comment.