aboutsummaryrefslogtreecommitdiffstats
path: root/spec/dummy/db/migrate
diff options
context:
space:
mode:
authorJamie Winsor <jamie@enmasse.com>2011-10-26 13:11:54 -0700
committerJamie Winsor <jamie@enmasse.com>2011-10-26 13:11:54 -0700
commit1b3195bf30ac0b6803525e1a4629cb2a5e60ce8b (patch)
tree5e88a516bb86e46f5c7fc945a848dea47b48d258 /spec/dummy/db/migrate
parent4ab9eccdee10b1f0612822d92d23a925b9c84535 (diff)
downloadrefinerycms-blog-1b3195bf30ac0b6803525e1a4629cb2a5e60ce8b.tar.gz
refinerycms-blog-1b3195bf30ac0b6803525e1a4629cb2a5e60ce8b.tar.bz2
refinerycms-blog-1b3195bf30ac0b6803525e1a4629cb2a5e60ce8b.zip
Remove dummy application for testing
Diffstat (limited to 'spec/dummy/db/migrate')
-rw-r--r--spec/dummy/db/migrate/.gitkeep0
-rw-r--r--spec/dummy/db/migrate/20100913234705_create_refinerycms_authentication_schema.rb48
-rw-r--r--spec/dummy/db/migrate/20100913234706_create_refinerycms_core_schema.rb25
-rw-r--r--spec/dummy/db/migrate/20100913234707_create_refinerycms_images_schema.rb23
-rw-r--r--spec/dummy/db/migrate/20100913234708_create_refinerycms_pages_schema.rb56
-rw-r--r--spec/dummy/db/migrate/20100913234709_create_refinerycms_resources_schema.rb21
-rw-r--r--spec/dummy/db/migrate/20100913234710_create_refinerycms_settings_schema.rb26
-rw-r--r--spec/dummy/db/migrate/20100926142529_add_value_type_to_refinery_settings.rb13
-rw-r--r--spec/dummy/db/migrate/20100929035252_add_missing_indexes_to_roles_users.rb11
-rw-r--r--spec/dummy/db/migrate/20101206013505_change_to_devise_users_table.rb31
-rw-r--r--spec/dummy/db/migrate/20101216194133_remove_cached_slug_from_pages.rb17
-rw-r--r--spec/dummy/db/migrate/20101217113424_add_locale_to_slugs.rb15
-rw-r--r--spec/dummy/db/migrate/20101217113425_translate_page_plugin.rb40
-rw-r--r--spec/dummy/db/migrate/20110106184757_add_remember_created_at_to_users.rb7
-rw-r--r--spec/dummy/db/migrate/20110117053357_remove_duplicate_user_image_sizes_setting.rb22
-rw-r--r--spec/dummy/db/migrate/20110307025652_translate_custom_title_on_pages.rb41
-rw-r--r--spec/dummy/db/migrate/20110314213540_remove_translated_fields_from_pages.rb17
-rw-r--r--spec/dummy/db/migrate/20110325213325_remove_password_salt_from_users.rb17
-rw-r--r--spec/dummy/db/migrate/20110329222114_create_seo_meta.rb86
-rw-r--r--spec/dummy/db/migrate/20110714071142_create_add_template_columns.rb11
-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
22 files changed, 0 insertions, 553 deletions
diff --git a/spec/dummy/db/migrate/.gitkeep b/spec/dummy/db/migrate/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/spec/dummy/db/migrate/.gitkeep
+++ /dev/null
diff --git a/spec/dummy/db/migrate/20100913234705_create_refinerycms_authentication_schema.rb b/spec/dummy/db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
deleted file mode 100644
index f9b6c2e..0000000
--- a/spec/dummy/db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-class CreateRefinerycmsAuthenticationSchema < ActiveRecord::Migration
- def self.up
- # Postgres apparently requires the roles_users table to exist before creating the roles table.
- create_table ::Refinery::RolesUsers.table_name, :id => false, :force => true do |t|
- t.integer "user_id"
- t.integer "role_id"
- end unless ::Refinery::RolesUsers.table_exists?
-
- create_table ::Refinery::Role.table_name, :force => true do |t|
- t.string "title"
- end unless ::Refinery::Role.table_exists?
-
- unless ::Refinery::UserPlugin.table_exists?
- create_table ::Refinery::UserPlugin.table_name, :force => true do |t|
- t.integer "user_id"
- t.string "name"
- t.integer "position"
- end
-
- add_index ::Refinery::UserPlugin.table_name, ["name"], :name => "index_#{::Refinery::UserPlugin.table_name}_on_title"
- add_index ::Refinery::UserPlugin.table_name, ["user_id", "name"], :name => "index_unique_#{::Refinery::UserPlugin.table_name}", :unique => true
-
- end
-
- unless ::Refinery::User.table_exists?
- create_table ::Refinery::User.table_name, :force => true do |t|
- t.string "login", :null => false
- t.string "email", :null => false
- t.string "crypted_password", :null => false
- t.string "password_salt", :null => false
- t.string "persistence_token"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "perishable_token"
- end
-
- add_index ::Refinery::User.table_name, ["id"], :name => "index_#{::Refinery::User.table_name}_on_id"
- end
- end
-
- def self.down
- [::User].reject{|m|
- !(defined?(m) and m.respond_to?(:table_name))
- }.each do |model|
- drop_table model.table_name if model.table_exists? if model.table_exists?
- end
- end
-end
diff --git a/spec/dummy/db/migrate/20100913234706_create_refinerycms_core_schema.rb b/spec/dummy/db/migrate/20100913234706_create_refinerycms_core_schema.rb
deleted file mode 100644
index 5061efa..0000000
--- a/spec/dummy/db/migrate/20100913234706_create_refinerycms_core_schema.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-class CreateRefinerycmsCoreSchema < ActiveRecord::Migration
- def self.up
- unless Slug.table_exists?
- create_table ::Slug.table_name, :force => true do |t|
- t.string "name"
- t.integer "sluggable_id"
- t.integer "sequence", :default => 1, :null => false
- t.string "sluggable_type", :limit => 40
- t.string "scope", :limit => 40
- t.datetime "created_at"
- end
-
- add_index ::Slug.table_name, ["name", "sluggable_type", "scope", "sequence"], :name => "index_#{::Slug.table_name}_on_n_s_s_and_s", :unique => true
- add_index ::Slug.table_name, ["sluggable_id"], :name => "index_#{::Slug.table_name}_on_sluggable_id"
- end
- end
-
- def self.down
- [::Slug].reject{|m|
- !(defined?(m) and m.respond_to?(:table_name))
- }.each do |model|
- drop_table model.table_name if model.table_exists?
- end
- end
-end
diff --git a/spec/dummy/db/migrate/20100913234707_create_refinerycms_images_schema.rb b/spec/dummy/db/migrate/20100913234707_create_refinerycms_images_schema.rb
deleted file mode 100644
index 6c4e079..0000000
--- a/spec/dummy/db/migrate/20100913234707_create_refinerycms_images_schema.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-class CreateRefinerycmsImagesSchema < ActiveRecord::Migration
- def self.up
- create_table ::Refinery::Image.table_name, :force => true do |t|
- t.string "image_mime_type"
- t.string "image_name"
- t.integer "image_size"
- t.integer "image_width"
- t.integer "image_height"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "image_uid"
- t.string "image_ext"
- end unless ::Refinery::Image.table_exists?
- end
-
- def self.down
- [::Image].reject{|m|
- !(defined?(m) and m.respond_to?(:table_name))
- }.each do |model|
- drop_table model.table_name if model.table_exists?
- end
- end
-end
diff --git a/spec/dummy/db/migrate/20100913234708_create_refinerycms_pages_schema.rb b/spec/dummy/db/migrate/20100913234708_create_refinerycms_pages_schema.rb
deleted file mode 100644
index 4458726..0000000
--- a/spec/dummy/db/migrate/20100913234708_create_refinerycms_pages_schema.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-class CreateRefinerycmsPagesSchema < ActiveRecord::Migration
- def self.up
- unless ::Refinery::PagePart.table_exists?
- create_table ::Refinery::PagePart.table_name, :force => true do |t|
- t.integer "refinery_page_id"
- t.string "title"
- t.text "body"
- t.integer "position"
- t.datetime "created_at"
- t.datetime "updated_at"
- end
-
- add_index ::Refinery::PagePart.table_name, ["id"], :name => "index_#{::Refinery::PagePart.table_name}_on_id"
- add_index ::Refinery::PagePart.table_name, ["refinery_page_id"], :name => "index_#{::Refinery::PagePart.table_name}_on_page_id"
- end
-
- unless ::Refinery::Page.table_exists?
- create_table ::Refinery::Page.table_name, :force => true do |t|
- t.string "title"
- t.integer "parent_id"
- t.integer "position"
- t.string "path"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "meta_keywords"
- t.text "meta_description"
- t.boolean "show_in_menu", :default => true
- t.string "link_url"
- t.string "menu_match"
- t.boolean "deletable", :default => true
- t.string "custom_title"
- t.string "custom_title_type", :default => "none"
- t.boolean "draft", :default => false
- t.string "browser_title"
- t.boolean "skip_to_first_child", :default => false
- t.integer "lft"
- t.integer "rgt"
- t.integer "depth"
- end
-
- add_index ::Refinery::Page.table_name, ["depth"], :name => "index_#{::Refinery::Page.table_name}_on_depth"
- add_index ::Refinery::Page.table_name, ["id"], :name => "index_#{::Refinery::Page.table_name}_on_id"
- add_index ::Refinery::Page.table_name, ["lft"], :name => "index_#{::Refinery::Page.table_name}_on_lft"
- add_index ::Refinery::Page.table_name, ["parent_id"], :name => "index_#{::Refinery::Page.table_name}_on_parent_id"
- add_index ::Refinery::Page.table_name, ["rgt"], :name => "index_#{::Refinery::Page.table_name}_on_rgt"
- end
- end
-
- def self.down
- [::Page, ::Refinery::PagePart].reject{|m|
- !(defined?(m) and m.respond_to?(:table_name))
- }.each do |model|
- drop_table model.table_name if model.table_exists?
- end
- end
-end
diff --git a/spec/dummy/db/migrate/20100913234709_create_refinerycms_resources_schema.rb b/spec/dummy/db/migrate/20100913234709_create_refinerycms_resources_schema.rb
deleted file mode 100644
index 360f469..0000000
--- a/spec/dummy/db/migrate/20100913234709_create_refinerycms_resources_schema.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-class CreateRefinerycmsResourcesSchema < ActiveRecord::Migration
- def self.up
- create_table ::Refinery::Resource.table_name, :force => true do |t|
- t.string "file_mime_type"
- t.string "file_name"
- t.integer "file_size"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "file_uid"
- t.string "file_ext"
- end unless ::Refinery::Resource.table_exists?
- end
-
- def self.down
- [::Resource].reject{|m|
- !(defined?(m) and m.respond_to?(:table_name))
- }.each do |model|
- drop_table model.table_name if model.table_exists?
- end
- end
-end
diff --git a/spec/dummy/db/migrate/20100913234710_create_refinerycms_settings_schema.rb b/spec/dummy/db/migrate/20100913234710_create_refinerycms_settings_schema.rb
deleted file mode 100644
index 955389f..0000000
--- a/spec/dummy/db/migrate/20100913234710_create_refinerycms_settings_schema.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-class CreateRefinerycmsSettingsSchema < ActiveRecord::Migration
- def self.up
- unless ::Refinery::Setting.table_exists?
- create_table ::Refinery::Setting.table_name, :force => true do |t|
- t.string "name"
- t.text "value"
- t.boolean "destroyable", :default => true
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "scoping"
- t.boolean "restricted", :default => false
- t.string "callback_proc_as_string"
- end
-
- add_index ::Refinery::Setting.table_name, ["name"], :name => "index_#{::Refinery::Setting.table_name}_on_name"
- end
- end
-
- def self.down
- [::Refinery::Setting].reject{|m|
- !(defined?(m) and m.respond_to?(:table_name))
- }.each do |model|
- drop_table model.table_name if model.table_exists?
- end
- end
-end
diff --git a/spec/dummy/db/migrate/20100926142529_add_value_type_to_refinery_settings.rb b/spec/dummy/db/migrate/20100926142529_add_value_type_to_refinery_settings.rb
deleted file mode 100644
index d13aa01..0000000
--- a/spec/dummy/db/migrate/20100926142529_add_value_type_to_refinery_settings.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-class AddValueTypeToRefinerySettings < ActiveRecord::Migration
- def self.up
- add_column ::Refinery::Setting.table_name, :form_value_type, :string
-
- ::Refinery::Setting.reset_column_information
- end
-
- def self.down
- remove_column ::Refinery::Setting.table_name, :form_value_type
-
- ::Refinery::Setting.reset_column_information
- end
-end
diff --git a/spec/dummy/db/migrate/20100929035252_add_missing_indexes_to_roles_users.rb b/spec/dummy/db/migrate/20100929035252_add_missing_indexes_to_roles_users.rb
deleted file mode 100644
index e72d81f..0000000
--- a/spec/dummy/db/migrate/20100929035252_add_missing_indexes_to_roles_users.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-class AddMissingIndexesToRolesUsers < ActiveRecord::Migration
- def self.up
- add_index ::Refinery::RolesUsers.table_name, [:role_id, :user_id]
- add_index ::Refinery::RolesUsers.table_name, [:user_id, :role_id]
- end
-
- def self.down
- remove_index ::Refinery::RolesUsers.table_name, :column => [:role_id, :user_id]
- remove_index ::Refinery::RolesUsers.table_name, :column => [:user_id, :role_id]
- end
-end
diff --git a/spec/dummy/db/migrate/20101206013505_change_to_devise_users_table.rb b/spec/dummy/db/migrate/20101206013505_change_to_devise_users_table.rb
deleted file mode 100644
index 8beef83..0000000
--- a/spec/dummy/db/migrate/20101206013505_change_to_devise_users_table.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-class ChangeToDeviseUsersTable < ActiveRecord::Migration
- def self.up
- add_column ::Refinery::User.table_name, :current_sign_in_at, :datetime
- add_column ::Refinery::User.table_name, :last_sign_in_at, :datetime
- add_column ::Refinery::User.table_name, :current_sign_in_ip, :string
- add_column ::Refinery::User.table_name, :last_sign_in_ip, :string
- add_column ::Refinery::User.table_name, :sign_in_count, :integer
- add_column ::Refinery::User.table_name, :remember_token, :string
- add_column ::Refinery::User.table_name, :reset_password_token, :string
-
- rename_column ::Refinery::User.table_name, :crypted_password, :encrypted_password
- rename_column ::Refinery::User.table_name, :login, :username
-
- ::Refinery::User.reset_column_information
- end
-
- def self.down
- remove_column ::Refinery::User.table_name, :current_sign_in_at
- remove_column ::Refinery::User.table_name, :last_sign_in_at
- remove_column ::Refinery::User.table_name, :current_sign_in_ip
- remove_column ::Refinery::User.table_name, :last_sign_in_ip
- remove_column ::Refinery::User.table_name, :sign_in_count
- remove_column ::Refinery::User.table_name, :remember_token
- remove_column ::Refinery::User.table_name, :reset_password_token
-
- rename_column ::Refinery::User.table_name, :encrypted_password, :crypted_password
- rename_column ::Refinery::User.table_name, :username, :login
-
- ::Refinery::User.reset_column_information
- end
-end
diff --git a/spec/dummy/db/migrate/20101216194133_remove_cached_slug_from_pages.rb b/spec/dummy/db/migrate/20101216194133_remove_cached_slug_from_pages.rb
deleted file mode 100644
index 341bc8f..0000000
--- a/spec/dummy/db/migrate/20101216194133_remove_cached_slug_from_pages.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-class RemoveCachedSlugFromPages < ActiveRecord::Migration
- def self.up
- if ::Refinery::Page.column_names.map(&:to_s).include?('cached_slug')
- say_with_time("Removing cached_slug column from ::Refinery::Page table") do
- remove_column ::Refinery::Page.table_name, :cached_slug
- end
- else
- say "Nothing done, no cached_slug field found in ::Refinery::Page table"
- end
-
- ::Refinery::Page.reset_column_information
- end
-
- def self.down
- # Don't add this column back, it breaks stuff.
- end
-end
diff --git a/spec/dummy/db/migrate/20101217113424_add_locale_to_slugs.rb b/spec/dummy/db/migrate/20101217113424_add_locale_to_slugs.rb
deleted file mode 100644
index 4b56f03..0000000
--- a/spec/dummy/db/migrate/20101217113424_add_locale_to_slugs.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-class AddLocaleToSlugs < ActiveRecord::Migration
- def self.up
- add_column ::Slug.table_name, :locale, :string, :limit => 5
-
- add_index ::Slug.table_name, :locale
-
- ::Slug.reset_column_information
- end
-
- def self.down
- remove_column :slugs, :locale
-
- ::Slug.reset_column_information
- end
-end
diff --git a/spec/dummy/db/migrate/20101217113425_translate_page_plugin.rb b/spec/dummy/db/migrate/20101217113425_translate_page_plugin.rb
deleted file mode 100644
index 1280e88..0000000
--- a/spec/dummy/db/migrate/20101217113425_translate_page_plugin.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-class TranslatePagePlugin < ActiveRecord::Migration
- def self.up
- say_with_time("Creating ::Refinery::PagePart translation table") do
- ::Refinery::PagePart.create_translation_table!({
- :body => :text
- }, {
- :migrate_data => true
- })
- end
-
- say_with_time("Creating ::Refinery::Page translation table") do
- ::Refinery::Page.create_translation_table!({
- :title => :string,
- :meta_keywords => :string,
- :meta_description => :text,
- :browser_title => :string,
- :custom_slug => :string,
- :menu_title => :string
- }, {
- :migrate_data => true
- })
- end
-
- puts "seeds pages"
- if (seed_file = Rails.root.join('db', 'seeds', 'pages.rb')).file?
- load seed_file.to_s unless ::Refinery::Page.where(:link_url => '/').any?
- end
-
- say_with_time("Updating slugs") do
- ::Slug.update_all(:locale => I18n.locale)
- end
- end
-
- def self.down
- say_with_time("Dropping ::Refinery::Page and ::Refinery::PagePart translation tables") do
- ::Refinery::Page.drop_translation_table! :migrate_data => true
- ::Refinery::PagePart.drop_translation_table! :migrate_data => true
- end
- end
-end
diff --git a/spec/dummy/db/migrate/20110106184757_add_remember_created_at_to_users.rb b/spec/dummy/db/migrate/20110106184757_add_remember_created_at_to_users.rb
deleted file mode 100644
index 78c9f68..0000000
--- a/spec/dummy/db/migrate/20110106184757_add_remember_created_at_to_users.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-class AddRememberCreatedAtToUsers < ActiveRecord::Migration
- def change
- add_column ::Refinery::User.table_name, :remember_created_at, :datetime
-
- ::Refinery::User.reset_column_information
- end
-end
diff --git a/spec/dummy/db/migrate/20110117053357_remove_duplicate_user_image_sizes_setting.rb b/spec/dummy/db/migrate/20110117053357_remove_duplicate_user_image_sizes_setting.rb
deleted file mode 100644
index 9b6db2b..0000000
--- a/spec/dummy/db/migrate/20110117053357_remove_duplicate_user_image_sizes_setting.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-class RemoveDuplicateUserImageSizesSetting < ActiveRecord::Migration
- def self.up
- if (settings = ::Refinery::Setting.where(:name => :user_image_sizes)).count > 1
- default_value = { :small => '110x110>', :medium => '225x255>', :large => '450x450>' }
-
- if (non_default_setting = settings.detect { |setting| setting[:value] != default_value })
- settings.detect { |setting| setting[:value] == default_value }.destroy
- non_default_setting[:destroyable] = false
- non_default_setting.save
- else
- settings.detect { |setting| setting[:destroyable] == true }.destroy
- end
- say "Removed duplicate user image sizes settings"
- else
- say "Nothing done, no duplicate settings found"
- end
- end
-
- def self.down
- # there is no step down ...
- end
-end
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
deleted file mode 100644
index 7d87d84..0000000
--- a/spec/dummy/db/migrate/20110307025652_translate_custom_title_on_pages.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-class TranslateCustomTitleOnPages < ActiveRecord::Migration
- def self.up
- 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 menu_title") do
- ::Refinery::Page.all.each do |page|
- 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 menu_title field"
- end
-
- ::Refinery::Page.translation_class.reset_column_information
- end
-
- def self.down
- say_with_time("Re-save menu_title") do
- ::Refinery::Page.all.each do |page|
- if page.attributes['menu_title'].nil?
- say "Nothing done, page##{page.id} menu_title field is nil"
- else
- say "updating menu_title field for page #{page.id}"
- ::Refinery::Page.update_all({
- :menu_title => page.attributes['menu_title']
- }, {
- :id => page.id.to_s
- })
- end
- end
- end
-
- remove_column ::Refinery::Page.translation_class.table_name, :menu_title
-
- ::Refinery::Page.translated_attribute_names.delete(:menu_title)
-
- ::Refinery::Page.translation_class.reset_column_information
- end
-end
diff --git a/spec/dummy/db/migrate/20110314213540_remove_translated_fields_from_pages.rb b/spec/dummy/db/migrate/20110314213540_remove_translated_fields_from_pages.rb
deleted file mode 100644
index 452daee..0000000
--- a/spec/dummy/db/migrate/20110314213540_remove_translated_fields_from_pages.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-class RemoveTranslatedFieldsFromPages < ActiveRecord::Migration
- def self.up
- ::Refinery::Page.translated_attribute_names.map(&:to_sym).each do |column_name|
- remove_column ::Refinery::Page.table_name, column_name if ::Refinery::Page.column_names.map(&:to_sym).include?(column_name)
- end
-
- ::Refinery::Page.reset_column_information
- end
-
- def self.down
- ::Refinery::Page.translated_attribute_names.map(&:to_sym).each do |column_name|
- add_column ::Refinery::Page.table_name, column_name, Page::Translation.columns.detect{|c| c.name.to_sym == column_name}.type
- end
-
- ::Refinery::Page.reset_column_information
- end
-end
diff --git a/spec/dummy/db/migrate/20110325213325_remove_password_salt_from_users.rb b/spec/dummy/db/migrate/20110325213325_remove_password_salt_from_users.rb
deleted file mode 100644
index 4197125..0000000
--- a/spec/dummy/db/migrate/20110325213325_remove_password_salt_from_users.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-class RemovePasswordSaltFromUsers < ActiveRecord::Migration
- def self.up
- remove_column ::Refinery::User.table_name, :password_salt
- # Make the current password invalid :(
- ::Refinery::User.all.each do |u|
- u.update_attribute(:encrypted_password, u.encrypted_password[29..-1])
- end
-
- ::Refinery::User.reset_column_information
- end
-
- def self.down
- add_column ::Refinery::User.table_name, :password_salt, :string
-
- ::Refinery::User.reset_column_information
- end
-end
diff --git a/spec/dummy/db/migrate/20110329222114_create_seo_meta.rb b/spec/dummy/db/migrate/20110329222114_create_seo_meta.rb
deleted file mode 100644
index cb8c268..0000000
--- a/spec/dummy/db/migrate/20110329222114_create_seo_meta.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-class CreateSeoMeta < ActiveRecord::Migration
-
- def self.up
- create_table :seo_meta do |t|
- t.integer :seo_meta_id
- t.string :seo_meta_type
-
- t.string :browser_title
- t.string :meta_keywords
- t.text :meta_description
-
- t.timestamps
- end
-
- add_index :seo_meta, :id
- add_index :seo_meta, [:seo_meta_id, :seo_meta_type]
-
- # Grab the attributes of the records that currently exist
- existing_translations = ::Refinery::Page.translation_class.all.map(&:attributes)
-
- # Remove columns
- ::SeoMeta.attributes.keys.each do |field|
- if ::Refinery::Page.translation_class.column_names.map(&:to_sym).include?(field)
- remove_column ::Refinery::Page.translation_class.table_name, field
- end
- end
-
- # Reset column information because otherwise the old columns will still exist.
- ::Refinery::Page.translation_class.reset_column_information
-
- # Re-attach seo_meta
- ::Refinery::Page.translation_class.send :is_seo_meta
-
- # Migrate data
- existing_translations.each do |translation|
- ::Refinery::Page.translation_class.find(translation['id']).update_attributes(
- ::SeoMeta.attributes.keys.inject({}) {|attributes, name|
- attributes.merge(name => translation[name.to_s])
- }
- )
- end
-
- # Reset column information again because otherwise the old columns will still exist.
- ::Refinery::Page.reset_column_information
- end
-
- def self.down
- # Grab the attributes of the records that currently exist
- existing_translations = ::Refinery::Page.translation_class.all.map(&:attributes)
-
- # Add columns back to your model
- ::Refinery::SeoMeta.attributes.each do |field, field_type|
- unless ::Refinery::Page.translation_class.column_names.map(&:to_sym).include?(field)
- add_column ::Refinery::Page.translation_class.table_name, field, field_type
- end
- end
-
- # Reset column information because otherwise the new columns won't exist yet.
- ::Refinery::Page.translation_class.reset_column_information
-
- # Migrate data
- existing_translations.each do |translation|
- ::Refinery::Page.translation_class.update_all(
- ::Refinery::SeoMeta.attributes.keys.inject({}) {|attributes, name|
- attributes.merge(name => translation[name.to_s])
- }, :id => translation['id']
- )
- end
-
- ::Refinery::SeoMeta.attributes.keys.each do |k|
- ::Refinery::Page.translation_class.module_eval %{
- def #{k}
- end
-
- def #{k}=(*args)
- end
- }
- end
-
- # Reset column information again because otherwise the old columns will still exist.
- ::Refinery::Page.reset_column_information
-
- drop_table :seo_meta
- end
-
-end
diff --git a/spec/dummy/db/migrate/20110714071142_create_add_template_columns.rb b/spec/dummy/db/migrate/20110714071142_create_add_template_columns.rb
deleted file mode 100644
index eb98ed1..0000000
--- a/spec/dummy/db/migrate/20110714071142_create_add_template_columns.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-class CreateAddTemplateColumns < ActiveRecord::Migration
- def self.up
- add_column ::Refinery::Page.table_name, :view_template, :string
- add_column ::Refinery::Page.table_name, :layout_template, :string
- end
-
- def self.down
- remove_column ::Refinery::Page.table_name, :layout_template
- remove_column ::Refinery::Page.table_name, :view_template
- end
-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
deleted file mode 100644
index 2feb837..0000000
--- a/spec/dummy/db/migrate/20110810070753_add_custom_slug_to_refinery_page_translations.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-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
deleted file mode 100644
index 0ce6cb2..0000000
--- a/spec/dummy/db/migrate/20110812055013_rename_custom_title_to_menu_title_in_refinery_pages.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-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