BUGFIX: initial migrate was broken cause bust schema was cached

This commit is contained in:
Sam 2014-05-12 13:31:33 +10:00
parent 7490a74875
commit a619aa4bbb
2 changed files with 3 additions and 1 deletions

View File

@ -1,3 +1,6 @@
# fix any bust caches post initial migration
ActiveRecord::Base.send(:subclasses).each{|m| p m; m.reset_column_information}
SiteSetting.refresh!
if SiteSetting.uncategorized_category_id == -1 || !Category.exists?(SiteSetting.uncategorized_category_id)
puts "Seeding uncategorized category!"

View File

@ -1,6 +1,5 @@
# kind of odd, but we need it, we also need to nuke usage of User from inside migrations
# very poor form
User.reset_column_information
user = User.find_by("id <> -1 and username_lower = 'system'")
if user
user.username = UserNameSuggester.suggest("system")