aboutsummaryrefslogtreecommitdiffstats
path: root/spec/dummy/db/migrate
diff options
context:
space:
mode:
authorJamie Winsor <jamie@enmasse.com>2011-09-02 13:34:06 -0700
committerJamie Winsor <jamie@enmasse.com>2011-09-02 13:35:25 -0700
commitfc68f22858fc485b99836d6b5ce254c67cdabe50 (patch)
tree21122ece4efa97bd3025071344fb1a582ac574d1 /spec/dummy/db/migrate
parent177927497131abc1e860e381e0139cab0a8c60d6 (diff)
downloadrefinerycms-blog-fc68f22858fc485b99836d6b5ce254c67cdabe50.tar.gz
refinerycms-blog-fc68f22858fc485b99836d6b5ce254c67cdabe50.tar.bz2
refinerycms-blog-fc68f22858fc485b99836d6b5ce254c67cdabe50.zip
update and import refinerycms migrations and seeds
update Guardfile, spec_helper, and support files to match those generated by refinerycms-testing
Diffstat (limited to 'spec/dummy/db/migrate')
-rw-r--r--spec/dummy/db/migrate/20100913234706_create_refinerycms_core_schema.rb2
-rw-r--r--spec/dummy/db/migrate/20101217113425_translate_page_plugin.rb4
-rw-r--r--spec/dummy/db/migrate/20110307025652_translate_custom_title_on_pages.rb26
-rw-r--r--spec/dummy/db/migrate/20110810070753_add_custom_slug_to_refinery_page_translations.rb11
-rw-r--r--spec/dummy/db/migrate/20110812055013_rename_custom_title_to_menu_title_in_refinery_pages.rb15
5 files changed, 43 insertions, 15 deletions
diff --git a/spec/dummy/db/migrate/20100913234706_create_refinerycms_core_schema.rb b/spec/dummy/db/migrate/20100913234706_create_refinerycms_core_schema.rb
index c2dd42c..5061efa 100644
--- a/spec/dummy/db/migrate/20100913234706_create_refinerycms_core_schema.rb
+++ b/spec/dummy/db/migrate/20100913234706_create_refinerycms_core_schema.rb
@@ -4,7 +4,7 @@ class CreateRefinerycmsCoreSchema < ActiveRecord::Migration
create_table ::Slug.table_name, :force => true do |t|
t.string "name"
t.integer "sluggable_id"
- t.integer "sequence", :default => 1, :null => false
+ t.integer "sequence", :default => 1, :null => false
t.string "sluggable_type", :limit => 40
t.string "scope", :limit => 40
t.datetime "created_at"
diff --git a/spec/dummy/db/migrate/20101217113425_translate_page_plugin.rb b/spec/dummy/db/migrate/20101217113425_translate_page_plugin.rb
index bdb0a43..1280e88 100644
--- a/spec/dummy/db/migrate/20101217113425_translate_page_plugin.rb
+++ b/spec/dummy/db/migrate/20101217113425_translate_page_plugin.rb
@@ -13,7 +13,9 @@ class TranslatePagePlugin < ActiveRecord::Migration
:title => :string,
:meta_keywords => :string,
:meta_description => :text,
- :browser_title => :string
+ :browser_title => :string,
+ :custom_slug => :string,
+ :menu_title => :string
}, {
:migrate_data => true
})
diff --git a/spec/dummy/db/migrate/20110307025652_translate_custom_title_on_pages.rb b/spec/dummy/db/migrate/20110307025652_translate_custom_title_on_pages.rb
index 2bcecc7..7d87d84 100644
--- a/spec/dummy/db/migrate/20110307025652_translate_custom_title_on_pages.rb
+++ b/spec/dummy/db/migrate/20110307025652_translate_custom_title_on_pages.rb
@@ -1,30 +1,30 @@
class TranslateCustomTitleOnPages < ActiveRecord::Migration
def self.up
- unless ::Refinery::Page.translation_class.column_names.map(&:to_sym).include?(:custom_title)
- add_column ::Refinery::Page.translation_class.table_name, :custom_title, :string
+ unless ::Refinery::Page.translation_class.column_names.map(&:to_sym).include?(:menu_title)
+ add_column ::Refinery::Page.translation_class.table_name, :menu_title, :string
- say_with_time("Re-save custom_title") do
+ say_with_time("Re-save menu_title") do
::Refinery::Page.all.each do |page|
- say "updating custom_title field for page##{page.id}"
- page.update_attribute(:custom_title, page.untranslated_attributes['custom_title'])
+ say "updating menu_title field for page##{page.id}"
+ page.update_attribute(:menu_title, page.untranslated_attributes['menu_title'])
end
end
else
- say "Nothing done, ::Refinery::Page.translation_class table already includes a custom_title field"
+ say "Nothing done, ::Refinery::Page.translation_class table already includes a menu_title field"
end
::Refinery::Page.translation_class.reset_column_information
end
def self.down
- say_with_time("Re-save custom_title") do
+ say_with_time("Re-save menu_title") do
::Refinery::Page.all.each do |page|
- if page.attributes['custom_title'].nil?
- say "Nothing done, page##{page.id} custom_title field is nil"
+ if page.attributes['menu_title'].nil?
+ say "Nothing done, page##{page.id} menu_title field is nil"
else
- say "updating custom_title field for page #{page.id}"
+ say "updating menu_title field for page #{page.id}"
::Refinery::Page.update_all({
- :custom_title => page.attributes['custom_title']
+ :menu_title => page.attributes['menu_title']
}, {
:id => page.id.to_s
})
@@ -32,9 +32,9 @@ class TranslateCustomTitleOnPages < ActiveRecord::Migration
end
end
- remove_column ::Refinery::Page.translation_class.table_name, :custom_title
+ remove_column ::Refinery::Page.translation_class.table_name, :menu_title
- ::Refinery::Page.translated_attribute_names.delete(:custom_title)
+ ::Refinery::Page.translated_attribute_names.delete(:menu_title)
::Refinery::Page.translation_class.reset_column_information
end
diff --git a/spec/dummy/db/migrate/20110810070753_add_custom_slug_to_refinery_page_translations.rb b/spec/dummy/db/migrate/20110810070753_add_custom_slug_to_refinery_page_translations.rb
new file mode 100644
index 0000000..2feb837
--- /dev/null
+++ b/spec/dummy/db/migrate/20110810070753_add_custom_slug_to_refinery_page_translations.rb
@@ -0,0 +1,11 @@
+class AddCustomSlugToRefineryPageTranslations < ActiveRecord::Migration
+ def up
+ if ::Refinery::Page::Translation.column_names.map(&:to_sym).exclude?(:custom_slug)
+ add_column ::Refinery::Page::Translation.table_name, :custom_slug, :string, :default => nil
+ end
+ end
+
+ def down
+ remove_column ::Refinery::Page::Translation.table_name, :custom_slug
+ end
+end
diff --git a/spec/dummy/db/migrate/20110812055013_rename_custom_title_to_menu_title_in_refinery_pages.rb b/spec/dummy/db/migrate/20110812055013_rename_custom_title_to_menu_title_in_refinery_pages.rb
new file mode 100644
index 0000000..0ce6cb2
--- /dev/null
+++ b/spec/dummy/db/migrate/20110812055013_rename_custom_title_to_menu_title_in_refinery_pages.rb
@@ -0,0 +1,15 @@
+class RenameCustomTitleToMenuTitleInRefineryPages < ActiveRecord::Migration
+ def up
+ if ::Refinery::Page::Translation.column_names.map(&:to_sym).include?(:custom_title)
+ rename_column ::Refinery::Page::Translation.table_name, :custom_title, :menu_title
+ end
+ remove_column ::Refinery::Page.table_name, :custom_title_type
+ end
+
+ def down
+ if ::Refinery::Page::Translation.column_names.map(&:to_sym).include?(:menu_title)
+ rename_column ::Refinery::Page::Translation.table_name, :menu_title, :custom_title
+ end
+ add_column ::Refinery::Page.table_name, :custom_title_type, :string
+ end
+end