diff --git a/.travis.yml b/.travis.yml index 856be5792aa..544e3041474 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,9 @@ services: - redis-server - memcached script: - - bundle exec rake db:create:all --trace - - bundle exec rake db:schema:load --trace + - rm -f structure.sql + - RAILS_ENV=test bundle exec rake db:create:all --trace + - RAILS_ENV=test bundle exec rake db:schema:load --trace - RAILS_ENV=test bundle exec rake db:migrate --trace - bundle exec $TEST_GROUP before_script: diff --git a/app/controllers/archive_faqs_controller.rb b/app/controllers/archive_faqs_controller.rb index 18ea215f4a7..e9ff6ddd7c3 100644 --- a/app/controllers/archive_faqs_controller.rb +++ b/app/controllers/archive_faqs_controller.rb @@ -119,7 +119,11 @@ def set_locale if params[:language_id] && session[:language_id] != params[:language_id] session[:language_id] = params[:language_id] end - @i18n_locale = session[:language_id] || I18n.default_locale + if current_user.present? && $rollout.active?(:set_locale_preference, current_user) + @i18n_locale = session[:language_id] || Locale.find(current_user.preference.preferred_locale).iso + else + @i18n_locale = session[:language_id] || I18n.default_locale + end end def require_language_id diff --git a/app/controllers/preferences_controller.rb b/app/controllers/preferences_controller.rb index 6a7b59ad19e..795e9635d01 100644 --- a/app/controllers/preferences_controller.rb +++ b/app/controllers/preferences_controller.rb @@ -14,6 +14,7 @@ def index @user = User.find_by_login(params[:user_id]) @preference = @user.preference || Preference.create(:user_id => @user.id) @available_skins = (current_user.skins.site_skins + Skin.approved_skins.site_skins).uniq + @available_locales = Locale.where(email_enabled: true) end def update diff --git a/app/models/locale.rb b/app/models/locale.rb index c4d0180f4dd..b9c955a9b63 100644 --- a/app/models/locale.rb +++ b/app/models/locale.rb @@ -1,7 +1,5 @@ class Locale < ActiveRecord::Base belongs_to :language - # has_many :translations - # has_many :translation_notes validates_presence_of :iso validates_uniqueness_of :iso validates_presence_of :name diff --git a/app/views/locales/_locale_form.html.erb b/app/views/locales/_locale_form.html.erb new file mode 100644 index 00000000000..7168b82001e --- /dev/null +++ b/app/views/locales/_locale_form.html.erb @@ -0,0 +1,32 @@ +<%= form_for(@locale, html: { class: 'post' }) do |f| %> +

* <%= t('.required_notice', :default => "Required information") %>

+ +
+ <%= t('.locale_legend', :default => "Locale") %> +

<%= t('.locale_heading', :default => "Locale") %>

+
+
<%= f.label :name, t('.name', :default => "Name") + '*' %>
+
<%= f.text_field :name %>
+ +
<%= f.label :iso, t('.iso', :default => "ISO code") + '*' %>
+
<%= f.text_field :iso %>
+ +
<%= f.label :language_id, t('.language', :default => "Language") + '*' %>
+
<%= f.select(:language_id, @languages.collect { |language| [ language.name, language.id ] }) %>
+ +
<%= f.check_box :email_enabled %>
+
<%= f.label :email_enabled, t('.enable_email', :default => "Use this locale to send email") %>
+ +
<%= f.check_box :interface_enabled %>
+
<%= f.label :interface_enabled, t('.enable_interface', :default => "Use this locale for the interface") %>
+ +
+
+
+ <%= t('.actions_legend', :default => "Actions") %> +

<%= t('.actions_heading', :default => "Actions") %>

+

+ <%= f.submit @locale.new_record? ? t('.create_button', :default => "Create Locale") : t('.edit_button', :default => "Update Locale") %> +

+
+<% end %> diff --git a/app/views/locales/_navigation.html.erb b/app/views/locales/_navigation.html.erb new file mode 100644 index 00000000000..3693e07acf3 --- /dev/null +++ b/app/views/locales/_navigation.html.erb @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/app/views/locales/edit.html.erb b/app/views/locales/edit.html.erb index 8eea1282283..30d0e1dcbda 100644 --- a/app/views/locales/edit.html.erb +++ b/app/views/locales/edit.html.erb @@ -1,22 +1,13 @@ -

<%= t('.edit_locale', :default => 'Edit a locale:') %>

+

<%= t('.edit_locale', :default => 'Edit Locale') %>

<%= error_messages_for :locale %> +<%= render 'navigation' %> -<%= form_for(@locale) do |f| %> -
-
<%= f.label :language_id, t('.language', :default => "Language:") %>
-
<%= f.select(:language_id, @languages.collect {|l| [ l.name, l.id ] }) %>
-
<%= f.label :name, t('.name', :default => "Name:") %>
-
<%= f.text_field :name %>
-
<%= f.label :iso, t('.iso', :default => "Iso:") %>
-
<%= f.text_field :iso %>
-
-

<%= f.submit t('.forms.submit', :default => "Submit") %>

-<% end %> +<%= render 'locale_form' %> diff --git a/app/views/locales/index.html.erb b/app/views/locales/index.html.erb index cb6980c9c3e..e23d82b2d9d 100644 --- a/app/views/locales/index.html.erb +++ b/app/views/locales/index.html.erb @@ -1,40 +1,50 @@ -

<%= t('.supported_locales', :default => 'The archive supports the following locales:') %>

+

<%= t('.supported_locales', :default => 'Supported Locales') %>

-<% if logged_in_as_admin? || permit?("translation_admin") %> -

- <%= link_to t('.link_to_new', :default => 'Add a new one'), new_locale_path %> -

- -

List of Locales

- - +<% if logged_in_as_admin? || permit?("translation_admin") %> + <%= render 'navigation' %> + +
Locales
+ - - - + + + + + - <% for locale in @locales %> - - <% end %> + <% for locale in @locales %> + + + + + + + + + + <% end %>
<%= t('.locale_table_caption', :default => 'Supported Locales') %>
NameISO codePrimary localeISO CodePrimary LocaleUse for EmailUse for Interface Created atActions
<%= link_to ts('Edit'), {controller: :locales, action: :edit, id: locale.iso} %><%= locale.name %><%=locale.iso%><%=locale.main%><%=locale.updated_at%>
<%= locale.name %><%= locale.iso %><%= locale.main %><%= locale.email_enabled %><%= locale.interface_enabled %><%= locale.updated_at %> + <%= link_to ts('Edit'), {controller: :locales, action: :edit, id: locale.iso} %> +
<% else %> - - <%= link_to t('.suggest_locale', :default => 'Suggest a new one!'), new_feedback_report_path %> + + <% end %> - diff --git a/app/views/locales/new.html.erb b/app/views/locales/new.html.erb index 65ce4cd4679..ddbe831ceda 100644 --- a/app/views/locales/new.html.erb +++ b/app/views/locales/new.html.erb @@ -1,24 +1,13 @@ -

<%= t('.add_new_locale', :default => 'Add a new locale:') %>

+

<%= t('.add_new_locale', :default => 'New Locale') %>

<%= error_messages_for :locale %> +<%= render 'navigation' %> -<%= form_for(@locale) do |f| %> -
-
<%= f.label :language_id, t('.language', :default => "Language:") %>
-
<%= f.select(:language_id, @languages.collect {|l| [ l.name, l.id ] }) %>
- -
<%= f.label :name, t('.name', :default => "Name:") %>
-
<%= f.text_field :name %>
- -
<%= f.label :iso, t('.iso', :default => "Iso:") %>
-
<%= f.text_field :iso %>
-
-

<%= f.submit t('.forms.submit', :default => "Submit") %>

-<% end %> +<%= render 'locale_form' %> diff --git a/app/views/preferences/index.html.erb b/app/views/preferences/index.html.erb index 116e2497f7e..3d625d86a06 100644 --- a/app/views/preferences/index.html.erb +++ b/app/views/preferences/index.html.erb @@ -63,28 +63,31 @@ <%= f.check_box :hide_freeform %> <%= f.label :hide_freeform, ts('Hide additional tags (you can still choose to show them).') %> -
  • <%= f.check_box :disable_work_skins %> <%= f.label :disable_work_skins, ts('Hide work skins (you can still choose to show them).') %> <%= link_to_help 'skins-basics' %>
  • - -
    -
    -
    <%= f.label :skin_id, ts('Your site skin')%> <%= link_to_help 'skins-basics' %>:
    -
    - <%= link_to ts('Public Site Skins'), skins_path %> - <%= f.select :skin_id, @available_skins.collect{|s| [s.title, s.id]} %> -
    - -
    <%= f.label :time_zone, ts('Your time zone: ')%>
    -
    <%= f.time_zone_select :time_zone, nil, :default => Time.zone.name %>
    - -
    <%= f.label :work_title_format, ts('Browser page title format') %> <%= link_to_help 'work_title_format' %>:
    -
    <%= f.text_field :work_title_format %>
    -
    -
    + +
    +
    +
    <%= f.label :skin_id, ts('Your site skin') %> <%= link_to_help 'skins-basics' %>:
    +
    + <%= link_to ts('Public Site Skins'), skins_path %> + <%= f.select :skin_id, @available_skins.collect{|s| [s.title, s.id]} %> +
    + +
    <%= f.label :time_zone, ts('Your time zone: ') %>
    +
    <%= f.time_zone_select :time_zone, nil, :default => Time.zone.name %>
    + + <% if Rails.env.test? || Rails.env.development? || $rollout.active?(:set_locale_preference, @user) %> +
    <%= f.label :preferred_locale, ts('Your locale')%> <%= link_to_help 'locale-preferences' %>
    +
    <%= f.select :preferred_locale, @available_locales.collect{|locale| [locale.name, locale.id]}, :default => @preference.preferred_locale %>
    + <% end %> + +
    <%= f.label :work_title_format, ts('Browser page title format') %> <%= link_to_help 'work_title_format' %>:
    +
    <%= f.text_field :work_title_format %>
    +
    diff --git a/db/migrate/20100929044155_add_persistence_token_to_users_and_admins.rb b/db/migrate/20100929044155_add_persistence_token_to_users_and_admins.rb deleted file mode 100644 index 8c143286ba2..00000000000 --- a/db/migrate/20100929044155_add_persistence_token_to_users_and_admins.rb +++ /dev/null @@ -1,13 +0,0 @@ -class AddPersistenceTokenToUsersAndAdmins < ActiveRecord::Migration - def self.up - add_column :users, :persistence_token, :string, :null => false - add_column :admins, :persistence_token, :string, :null => false - remove_column :users, :remember_token - remove_column :users, :remember_token_expires_at - end - - def self.down - remove_column :users, :persistence_token - remove_column :admins, :persistence_token - end -end diff --git a/db/migrate/20101015053927_add_sanitizer_version_fields.rb b/db/migrate/20101015053927_add_sanitizer_version_fields.rb deleted file mode 100644 index 1417a44eb33..00000000000 --- a/db/migrate/20101015053927_add_sanitizer_version_fields.rb +++ /dev/null @@ -1,86 +0,0 @@ -class AddSanitizerVersionFields < ActiveRecord::Migration - def self.up - # add columns for sanitizer_version for any fields which are allowed to contain HTML. - add_column :abuse_reports, :comment_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - add_column :admin_posts, :content_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - add_column :archive_faqs, :content_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - add_column :bookmarks, :notes_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - - # call mysql directly so only copy table once - # add_column :chapters, :content_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - # add_column :chapters, :notes_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - # add_column :chapters, :summary_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - # add_column :chapters, :endnotes_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - execute "ALTER TABLE `chapters` ADD `content_sanitizer_version` smallint DEFAULT 0 NOT NULL, ADD `notes_sanitizer_version` smallint DEFAULT 0 NOT NULL, ADD `summary_sanitizer_version` smallint DEFAULT 0 NOT NULL, ADD `endnotes_sanitizer_version` smallint DEFAULT 0 NOT NULL" - - # add_column :collection_profiles, :intro_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - # add_column :collection_profiles, :faq_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - # add_column :collection_profiles, :rules_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - execute "ALTER TABLE `collection_profiles` ADD `intro_sanitizer_version` smallint DEFAULT 0 NOT NULL, ADD `faq_sanitizer_version` smallint DEFAULT 0 NOT NULL, ADD `rules_sanitizer_version` smallint DEFAULT 0 NOT NULL" - - add_column :collections, :description_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - add_column :comments, :content_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - add_column :external_works, :summary_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - - # add_column :feedbacks, :comment_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - # add_column :feedbacks, :summary_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - execute "ALTER TABLE `feedbacks` ADD `comment_sanitizer_version` smallint DEFAULT 0 NOT NULL, ADD `summary_sanitizer_version` smallint DEFAULT 0 NOT NULL" - - # add_column :gift_exchanges, :signup_instructions_general_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - # add_column :gift_exchanges, :signup_instructions_requests_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - # add_column :gift_exchanges, :signup_instructions_offers_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - execute "ALTER TABLE `gift_exchanges` ADD `signup_instructions_general_sanitizer_version` smallint DEFAULT 0 NOT NULL, ADD `signup_instructions_requests_sanitizer_version` smallint DEFAULT 0 NOT NULL, ADD `signup_instructions_offers_sanitizer_version` smallint DEFAULT 0 NOT NULL" - - add_column :known_issues, :content_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - add_column :log_items, :note_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - add_column :profiles, :about_me_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - add_column :prompts, :description_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - add_column :pseuds, :description_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - - # add_column :series, :summary_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - # add_column :series, :notes_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - execute "ALTER TABLE `series` ADD `summary_sanitizer_version` smallint DEFAULT 0 NOT NULL, ADD `notes_sanitizer_version` smallint DEFAULT 0 NOT NULL" - - add_column :skins, :description_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - add_column :translation_notes, :note_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - - # add_column :works, :summary_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - # add_column :works, :notes_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - # add_column :works, :endnotes_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - execute "ALTER TABLE `works` ADD `summary_sanitizer_version` smallint DEFAULT 0 NOT NULL, ADD `notes_sanitizer_version` smallint DEFAULT 0 NOT NULL, ADD `endnotes_sanitizer_version` smallint DEFAULT 0 NOT NULL" - end - - def self.down - remove_column :abuse_reports, :comment_sanitizer_version - remove_column :admin_posts, :content_sanitizer_version - remove_column :archive_faqs, :content_sanitizer_version - remove_column :bookmarks, :notes_sanitizer_version - remove_column :chapters, :content_sanitizer_version - remove_column :chapters, :notes_sanitizer_version - remove_column :chapters, :summary_sanitizer_version - remove_column :chapters, :endnotes_sanitizer_version - remove_column :collection_profiles, :intro_sanitizer_version - remove_column :collection_profiles, :faq_sanitizer_version - remove_column :collection_profiles, :rules_sanitizer_version - remove_column :collections, :description_sanitizer_version - remove_column :comments, :content_sanitizer_version - remove_column :external_works, :summary_sanitizer_version - remove_column :feedbacks, :comment_sanitizer_version - remove_column :feedbacks, :summary_sanitizer_version - remove_column :gift_exchanges, :signup_instructions_general_sanitizer_version - remove_column :gift_exchanges, :signup_instructions_requests_sanitizer_version - remove_column :gift_exchanges, :signup_instructions_offers_sanitizer_version - remove_column :known_issues, :content_sanitizer_version - remove_column :log_items, :note_sanitizer_version - remove_column :profiles, :about_me_sanitizer_version - remove_column :prompts, :description_sanitizer_version - remove_column :pseuds, :description_sanitizer_version - remove_column :series, :summary_sanitizer_version - remove_column :series, :notes_sanitizer_version - remove_column :skins, :description_sanitizer_version - remove_column :translation_notes, :note_sanitizer_version - remove_column :works, :summary_sanitizer_version - remove_column :works, :notes_sanitizer_version - remove_column :works, :endnotes_sanitizer_version - end -end diff --git a/db/migrate/20101016131743_add_inherited_to_filter_taggings.rb b/db/migrate/20101016131743_add_inherited_to_filter_taggings.rb deleted file mode 100644 index cab8e139c5d..00000000000 --- a/db/migrate/20101016131743_add_inherited_to_filter_taggings.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddInheritedToFilterTaggings < ActiveRecord::Migration - def self.up - add_column :filter_taggings, :inherited, :boolean, :default => false, :null => false - end - - def self.down - remove_column :filter_taggings, :inherited - end -end diff --git a/db/migrate/20101022002353_add_tag_wrangling_freeze.rb b/db/migrate/20101022002353_add_tag_wrangling_freeze.rb deleted file mode 100644 index 7c2373d2103..00000000000 --- a/db/migrate/20101022002353_add_tag_wrangling_freeze.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddTagWranglingFreeze < ActiveRecord::Migration - def self.up - add_column :admin_settings, :tag_wrangling_off, :boolean, :default => false, :null => false - end - - def self.down - remove_column :admin_settings, :tag_wrangling_off - end -end diff --git a/db/migrate/20101022160603_add_restrict_to_fandom_to_tag_set.rb b/db/migrate/20101022160603_add_restrict_to_fandom_to_tag_set.rb deleted file mode 100644 index 79b6e6a6907..00000000000 --- a/db/migrate/20101022160603_add_restrict_to_fandom_to_tag_set.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddRestrictToFandomToTagSet < ActiveRecord::Migration - def self.up - add_column :tag_sets, :character_restrict_to_fandom, :boolean, :null => false, :default => false - add_column :tag_sets, :relationship_restrict_to_fandom, :boolean, :null => false, :default => false - end - - def self.down - remove_column :tag_sets, :relationship_restrict_to_fandom - remove_column :tag_sets, :character_restrict_to_fandom - end -end diff --git a/db/migrate/20101024232837_add_any_to_prompts.rb b/db/migrate/20101024232837_add_any_to_prompts.rb deleted file mode 100644 index c54896048b4..00000000000 --- a/db/migrate/20101024232837_add_any_to_prompts.rb +++ /dev/null @@ -1,35 +0,0 @@ -class AddAnyToPrompts < ActiveRecord::Migration - def self.up - add_column :prompts, :any_fandom, :boolean, :null => false, :default => false - add_column :prompts, :any_character, :boolean, :null => false, :default => false - add_column :prompts, :any_rating, :boolean, :null => false, :default => false - add_column :prompts, :any_relationship, :boolean, :null => false, :default => false - add_column :prompts, :any_category, :boolean, :null => false, :default => false - add_column :prompts, :any_warning, :boolean, :null => false, :default => false - add_column :prompts, :any_freeform, :boolean, :null => false, :default => false - add_column :prompt_restrictions, :allow_any_fandom, :boolean, :null => false, :default => false - add_column :prompt_restrictions, :allow_any_character, :boolean, :null => false, :default => false - add_column :prompt_restrictions, :allow_any_rating, :boolean, :null => false, :default => false - add_column :prompt_restrictions, :allow_any_relationship, :boolean, :null => false, :default => false - add_column :prompt_restrictions, :allow_any_category, :boolean, :null => false, :default => false - add_column :prompt_restrictions, :allow_any_warning, :boolean, :null => false, :default => false - add_column :prompt_restrictions, :allow_any_freeform, :boolean, :null => false, :default => false - end - - def self.down - remove_column :prompts, :any_freeform - remove_column :prompts, :any_warning - remove_column :prompts, :any_category - remove_column :prompts, :any_relationship - remove_column :prompts, :any_rating - remove_column :prompts, :any_character - remove_column :prompts, :any_fandom - remove_column :prompt_restrictions, :allow_any_fandom - remove_column :prompt_restrictions, :allow_any_character - remove_column :prompt_restrictions, :allow_any_rating - remove_column :prompt_restrictions, :allow_any_relationship - remove_column :prompt_restrictions, :allow_any_category - remove_column :prompt_restrictions, :allow_any_warning - remove_column :prompt_restrictions, :allow_any_freeform - end -end diff --git a/db/migrate/20101025022733_add_unique_to_prompt_restriction.rb b/db/migrate/20101025022733_add_unique_to_prompt_restriction.rb deleted file mode 100644 index 9416b4987ac..00000000000 --- a/db/migrate/20101025022733_add_unique_to_prompt_restriction.rb +++ /dev/null @@ -1,21 +0,0 @@ -class AddUniqueToPromptRestriction < ActiveRecord::Migration - def self.up - add_column :prompt_restrictions, :require_unique_fandom, :boolean, :null => false, :default => false - add_column :prompt_restrictions, :require_unique_character, :boolean, :null => false, :default => false - add_column :prompt_restrictions, :require_unique_rating, :boolean, :null => false, :default => false - add_column :prompt_restrictions, :require_unique_relationship, :boolean, :null => false, :default => false - add_column :prompt_restrictions, :require_unique_category, :boolean, :null => false, :default => false - add_column :prompt_restrictions, :require_unique_warning, :boolean, :null => false, :default => false - add_column :prompt_restrictions, :require_unique_freeform, :boolean, :null => false, :default => false - end - - def self.down - remove_column :prompt_restrictions, :require_unique_freeform - remove_column :prompt_restrictions, :require_unique_warning - remove_column :prompt_restrictions, :require_unique_category - remove_column :prompt_restrictions, :require_unique_relationship - remove_column :prompt_restrictions, :require_unique_rating - remove_column :prompt_restrictions, :require_unique_character - remove_column :prompt_restrictions, :require_unique_fandom - end -end diff --git a/db/migrate/20101103185307_tagging_indexes.rb b/db/migrate/20101103185307_tagging_indexes.rb deleted file mode 100644 index b07c6b5968a..00000000000 --- a/db/migrate/20101103185307_tagging_indexes.rb +++ /dev/null @@ -1,13 +0,0 @@ -class TaggingIndexes < ActiveRecord::Migration - def self.up - add_index "common_taggings", ["filterable_id"] - add_index "meta_taggings", ["meta_tag_id"] - add_index "meta_taggings", ["sub_tag_id"] - end - - def self.down - drop_index "common_taggings", ["filterable_id"] - drop_index "meta_taggings", ["meta_tag_id"] - drop_index "meta_taggings", ["sub_tag_id"] - end -end diff --git a/db/migrate/20101107005107_add_restrict_to_fandom_to_prompt_restriction.rb b/db/migrate/20101107005107_add_restrict_to_fandom_to_prompt_restriction.rb deleted file mode 100644 index 3b7841f179d..00000000000 --- a/db/migrate/20101107005107_add_restrict_to_fandom_to_prompt_restriction.rb +++ /dev/null @@ -1,15 +0,0 @@ -class AddRestrictToFandomToPromptRestriction < ActiveRecord::Migration - def self.up - remove_column :tag_sets, :relationship_restrict_to_fandom - remove_column :tag_sets, :character_restrict_to_fandom - add_column :prompt_restrictions, :character_restrict_to_fandom, :boolean, :null => false, :default => false - add_column :prompt_restrictions, :relationship_restrict_to_fandom, :boolean, :null => false, :default => false - end - - def self.down - remove_column :prompt_restrictions, :relationship_restrict_to_fandom - remove_column :prompt_restrictions, :character_restrict_to_fandom - add_column :tag_sets, :character_restrict_to_fandom, :boolean, :null => false, :default => false - add_column :tag_sets, :relationship_restrict_to_fandom, :boolean, :null => false, :default => false - end -end diff --git a/db/migrate/20101107212421_add_guest_download_freeze.rb b/db/migrate/20101107212421_add_guest_download_freeze.rb deleted file mode 100644 index 2f49c8e0be2..00000000000 --- a/db/migrate/20101107212421_add_guest_download_freeze.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddGuestDownloadFreeze < ActiveRecord::Migration - def self.up - add_column :admin_settings, :guest_downloading_off, :boolean, :default => false, :null => false - end - - def self.down - remove_column :admin_settings, :guest_downloading_off - end -end diff --git a/db/migrate/20101108003021_add_assignment_notification_to_collection_profile.rb b/db/migrate/20101108003021_add_assignment_notification_to_collection_profile.rb deleted file mode 100644 index e419256367e..00000000000 --- a/db/migrate/20101108003021_add_assignment_notification_to_collection_profile.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddAssignmentNotificationToCollectionProfile < ActiveRecord::Migration - def self.up - add_column :collection_profiles, :assignment_notification, :text - end - - def self.down - remove_column :collection_profiles, :assignment_notification - end -end diff --git a/db/migrate/20101109204730_create_missing_work_indexes.rb b/db/migrate/20101109204730_create_missing_work_indexes.rb deleted file mode 100644 index a243ae3d542..00000000000 --- a/db/migrate/20101109204730_create_missing_work_indexes.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateMissingWorkIndexes < ActiveRecord::Migration - def self.up - add_index "works", "restricted" - add_index "works", "hidden_by_admin" - add_index "works", "posted" - add_index "works", "revised_at" - end - - def self.down - drop_index "works", "restricted" - drop_index "works", "hidden_by_admin" - drop_index "works", "posted" - drop_index "works", "revised_at" - end -end diff --git a/db/migrate/20101128051309_add_approved_and_ip_address_to_feedbacks.rb b/db/migrate/20101128051309_add_approved_and_ip_address_to_feedbacks.rb deleted file mode 100644 index 699b4f45a19..00000000000 --- a/db/migrate/20101128051309_add_approved_and_ip_address_to_feedbacks.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddApprovedAndIpAddressToFeedbacks < ActiveRecord::Migration - def self.up - add_column :feedbacks, :approved, :boolean, :default => false, :null => false - add_column :feedbacks, :ip_address, :string - end - - def self.down - remove_column :feedbacks, :approved - remove_column :feedbacks, :ip_address - end -end diff --git a/db/migrate/20101130074147_create_kudos.rb b/db/migrate/20101130074147_create_kudos.rb deleted file mode 100644 index affc7aa4482..00000000000 --- a/db/migrate/20101130074147_create_kudos.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateKudos < ActiveRecord::Migration - def self.up - create_table :kudos do |t| - t.integer :pseud_id - t.integer :commentable_id - t.string :commentable_type - - t.timestamps - end - end - - def self.down - drop_table :kudos - end -end diff --git a/db/migrate/20101204042756_add_type_to_skin.rb b/db/migrate/20101204042756_add_type_to_skin.rb deleted file mode 100644 index 422a963756c..00000000000 --- a/db/migrate/20101204042756_add_type_to_skin.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddTypeToSkin < ActiveRecord::Migration - def self.up - add_column :skins, :type, :string - end - - def self.down - remove_column :skins, :type - end -end diff --git a/db/migrate/20101204061318_rename_disable_ugs.rb b/db/migrate/20101204061318_rename_disable_ugs.rb deleted file mode 100644 index 178fbf7634d..00000000000 --- a/db/migrate/20101204061318_rename_disable_ugs.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RenameDisableUgs < ActiveRecord::Migration - def self.up - rename_column :preferences, :disable_ugs, :disable_work_skins - end - - def self.down - rename_column :preferences, :disable_work_skins, :disable_ugs - end -end diff --git a/db/migrate/20101204062558_add_work_skin_id_to_works.rb b/db/migrate/20101204062558_add_work_skin_id_to_works.rb deleted file mode 100644 index 673e2ed7a5d..00000000000 --- a/db/migrate/20101204062558_add_work_skin_id_to_works.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddWorkSkinIdToWorks < ActiveRecord::Migration - def self.up - add_column :works, :work_skin_id, :integer - end - - def self.down - remove_column :works, :work_skin_id - end -end diff --git a/db/migrate/20101205015909_add_ip_address_to_kudos.rb b/db/migrate/20101205015909_add_ip_address_to_kudos.rb deleted file mode 100644 index c4f6d002938..00000000000 --- a/db/migrate/20101205015909_add_ip_address_to_kudos.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddIpAddressToKudos < ActiveRecord::Migration - def self.up - add_column :kudos, :ip_address, :string - end - - def self.down - remove_column :kudos, :ip_address - end -end diff --git a/db/migrate/20101216165336_add_translation_and_language_to_admin_posts.rb b/db/migrate/20101216165336_add_translation_and_language_to_admin_posts.rb deleted file mode 100644 index f6b28f963ed..00000000000 --- a/db/migrate/20101216165336_add_translation_and_language_to_admin_posts.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddTranslationAndLanguageToAdminPosts < ActiveRecord::Migration - def self.up - add_column :admin_posts, :translated_post_id, :integer - add_column :admin_posts, :language_id, :integer - end - - def self.down - remove_column :admin_posts, :translated_post_id - remove_column :admin_posts, :language_id - end -end diff --git a/db/migrate/20101219191929_add_kudo_indexes.rb b/db/migrate/20101219191929_add_kudo_indexes.rb deleted file mode 100644 index d42bc591e3f..00000000000 --- a/db/migrate/20101219191929_add_kudo_indexes.rb +++ /dev/null @@ -1,17 +0,0 @@ -class AddKudoIndexes < ActiveRecord::Migration - def self.up - add_index "kudos", ["commentable_id", "commentable_type"] - add_index "kudos", "pseud_id" - add_index "kudos", "ip_address" - add_index "works", "delta" - add_index "tags", "type" - end - - def self.down - drop_index "kudos", ["commentable_id", "commentable_type"] - drop_index "kudos", "pseud_id" - drop_index "kudos", "ip_address" - drop_index "works", "delta" - drop_index "tags", "type" - end -end diff --git a/db/migrate/20101231171104_add_kudos_emails_off_to_preferences.rb b/db/migrate/20101231171104_add_kudos_emails_off_to_preferences.rb deleted file mode 100644 index 52bdc836b1f..00000000000 --- a/db/migrate/20101231171104_add_kudos_emails_off_to_preferences.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddKudosEmailsOffToPreferences < ActiveRecord::Migration - def self.up - add_column :preferences, :kudos_emails_off, :boolean, :null => false, :default => false - end - - def self.down - remove_column :preferences, :kudos_emails_off - end -end diff --git a/db/migrate/20101231174606_add_disable_share_links_to_preferences.rb b/db/migrate/20101231174606_add_disable_share_links_to_preferences.rb deleted file mode 100644 index edb52403274..00000000000 --- a/db/migrate/20101231174606_add_disable_share_links_to_preferences.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddDisableShareLinksToPreferences < ActiveRecord::Migration - def self.up - add_column :preferences, :disable_share_links, :boolean, :null => false, :default => false - end - - def self.down - remove_column :preferences, :disable_share_links - end -end diff --git a/db/migrate/20110130093600_add_prompt_meme_to_collection_preference.rb b/db/migrate/20110130093600_add_prompt_meme_to_collection_preference.rb deleted file mode 100644 index d0ea2a82321..00000000000 --- a/db/migrate/20110130093600_add_prompt_meme_to_collection_preference.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddPromptMemeToCollectionPreference < ActiveRecord::Migration - def self.up - add_column :collection_preferences, :prompt_meme, :boolean, :default => false, :null => false - end - - def self.down - remove_column :collection_preferences, :prompt_meme - end -end diff --git a/db/migrate/20110130093601_create_prompt_memes.rb b/db/migrate/20110130093601_create_prompt_memes.rb deleted file mode 100644 index 91114348f1f..00000000000 --- a/db/migrate/20110130093601_create_prompt_memes.rb +++ /dev/null @@ -1,30 +0,0 @@ -class CreatePromptMemes < ActiveRecord::Migration - def self.up - create_table :prompt_memes do |t| - t.references :prompt_restriction - t.integer :request_restriction_id - - t.integer :requests_num_required, :null => false, :default => 1 - t.integer :requests_num_allowed, :null => false, :default => 1 - t.boolean :signup_open, :null => false, :default => false - t.datetime :signups_open_at - t.datetime :signups_close_at - t.datetime :assignments_due_at - t.datetime :works_reveal_at - t.datetime :authors_reveal_at - t.text :signup_instructions_general - t.text :signup_instructions_requests - t.string :request_url_label - t.string :request_description_label - t.string :time_zone - t.integer :signup_instructions_general_sanitizer_version, :limit => 2, :default => 0, :null => false - t.integer :signup_instructions_requests_sanitizer_version, :limit => 2, :default => 0, :null => false - - t.timestamps - end - end - - def self.down - drop_table :prompt_memes - end -end diff --git a/db/migrate/20110130093602_add_anon_prompts.rb b/db/migrate/20110130093602_add_anon_prompts.rb deleted file mode 100644 index fa81bc010df..00000000000 --- a/db/migrate/20110130093602_add_anon_prompts.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddAnonPrompts < ActiveRecord::Migration - def self.up - add_column :prompts, :anonymous, :boolean, :default => false, :null => false - end - - def self.down - remove_column :prompts, :anonymous - end -end diff --git a/db/migrate/20110130093604_create_challenge_claims.rb b/db/migrate/20110130093604_create_challenge_claims.rb deleted file mode 100644 index 9d29d580f27..00000000000 --- a/db/migrate/20110130093604_create_challenge_claims.rb +++ /dev/null @@ -1,22 +0,0 @@ -class CreateChallengeClaims < ActiveRecord::Migration - def self.up - create_table :challenge_claims do |t| - t.integer :collection_id - t.integer :creation_id - t.string :creation_type - - t.integer :request_signup_id - t.integer :request_prompt_id - t.integer :claiming_user_id - t.datetime :sent_at - t.datetime :fulfilled_at - t.datetime :defaulted_at - - t.timestamps - end - end - - def self.down - drop_table :challenge_claims - end -end diff --git a/db/migrate/20110212162042_add_admin_post_tags.rb b/db/migrate/20110212162042_add_admin_post_tags.rb deleted file mode 100644 index 9e3e544c8c9..00000000000 --- a/db/migrate/20110212162042_add_admin_post_tags.rb +++ /dev/null @@ -1,19 +0,0 @@ -class AddAdminPostTags < ActiveRecord::Migration - def self.up - create_table :admin_post_tags do |t| - t.string :name - t.integer :language_id - t.timestamps - end - create_table :admin_post_taggings do |t| - t.integer :admin_post_tag_id - t.integer :admin_post_id - t.timestamps - end - end - - def self.down - drop_table :admin_post_tags - drop_table :admin_post_taggings - end -end diff --git a/db/migrate/20110214171104_add_requests_summary_to_challenges.rb b/db/migrate/20110214171104_add_requests_summary_to_challenges.rb deleted file mode 100644 index 478197b5a42..00000000000 --- a/db/migrate/20110214171104_add_requests_summary_to_challenges.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddRequestsSummaryToChallenges < ActiveRecord::Migration - def self.up - add_column :gift_exchanges, :requests_summary_visible, :boolean, :null => false, :default => false - end - - def self.down - remove_column :gift_exchanges, :requests_summary_visible - end -end diff --git a/db/migrate/20110222093602_add_anon_prompt_memes.rb b/db/migrate/20110222093602_add_anon_prompt_memes.rb deleted file mode 100644 index f0f097905f9..00000000000 --- a/db/migrate/20110222093602_add_anon_prompt_memes.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddAnonPromptMemes < ActiveRecord::Migration - def self.up - add_column :prompt_memes, :anonymous, :boolean, :default => false, :null => false - end - - def self.down - remove_column :prompt_memes, :anonymous - end -end diff --git a/db/migrate/20110223031701_stop_restricted_being_null.rb b/db/migrate/20110223031701_stop_restricted_being_null.rb deleted file mode 100644 index a3a58fb32c2..00000000000 --- a/db/migrate/20110223031701_stop_restricted_being_null.rb +++ /dev/null @@ -1,9 +0,0 @@ -class StopRestrictedBeingNull < ActiveRecord::Migration - def self.up - change_column :works, :restricted, :boolean, :default => false, :null => false - end - - def self.down - change_column :works, :restricted, :boolean, :default => false - end -end diff --git a/db/migrate/20110304042756_add_paragraph_margin_to_skin.rb b/db/migrate/20110304042756_add_paragraph_margin_to_skin.rb deleted file mode 100644 index 4404cfdb1fc..00000000000 --- a/db/migrate/20110304042756_add_paragraph_margin_to_skin.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddParagraphMarginToSkin < ActiveRecord::Migration - def self.up - add_column :skins, :paragraph_margin, :float - end - - def self.down - remove_column :skins, :paragraph_margin - end -end diff --git a/db/migrate/20110312174241_create_subscriptions.rb b/db/migrate/20110312174241_create_subscriptions.rb deleted file mode 100644 index 6d1f11eb093..00000000000 --- a/db/migrate/20110312174241_create_subscriptions.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateSubscriptions < ActiveRecord::Migration - def self.up - create_table :subscriptions do |t| - t.references :user - t.integer :subscribable_id - t.string :subscribable_type - - t.timestamps - end - end - - def self.down - drop_table :subscriptions - end -end diff --git a/db/migrate/20110401185831_add_banner_unseen_to_preferences.rb b/db/migrate/20110401185831_add_banner_unseen_to_preferences.rb deleted file mode 100644 index 50e7e8ca9be..00000000000 --- a/db/migrate/20110401185831_add_banner_unseen_to_preferences.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddBannerUnseenToPreferences < ActiveRecord::Migration - def self.up - add_column :preferences, :banner_seen, :boolean, :default => false, :null => false - end - - def self.down - remove_column :preferences, :banner_seen - end -end diff --git a/db/migrate/20110401201033_add_banner_to_admin_settings.rb b/db/migrate/20110401201033_add_banner_to_admin_settings.rb deleted file mode 100644 index 1abe7931bc9..00000000000 --- a/db/migrate/20110401201033_add_banner_to_admin_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddBannerToAdminSettings < ActiveRecord::Migration - def self.up - add_column :admin_settings, :banner_text, :string, :default => "" - end - - def self.down - remove_column :admin_settings, :banner_text - end -end diff --git a/db/migrate/20110513145847_create_owned_tag_sets.rb b/db/migrate/20110513145847_create_owned_tag_sets.rb deleted file mode 100644 index 482058de8f2..00000000000 --- a/db/migrate/20110513145847_create_owned_tag_sets.rb +++ /dev/null @@ -1,26 +0,0 @@ -class CreateOwnedTagSets < ActiveRecord::Migration - def self.up - create_table :owned_tag_sets do |t| - t.references :tag_set - t.boolean :visible, :default => false, :null => false - t.boolean :nominated, :default => false, :null => false - t.string :title - t.string :description - - t.timestamps - end - - create_table :tag_set_ownerships do |t| - t.references :pseud - t.references :owned_tag_set - t.boolean :owner, :default => false, :null => false - - t.timestamps - end - end - - def self.down - drop_table :tag_set_ownerships - drop_table :owned_tag_sets - end -end diff --git a/db/migrate/20110515182045_add_featured_to_owned_tag_sets.rb b/db/migrate/20110515182045_add_featured_to_owned_tag_sets.rb deleted file mode 100644 index 8d153acd31f..00000000000 --- a/db/migrate/20110515182045_add_featured_to_owned_tag_sets.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddFeaturedToOwnedTagSets < ActiveRecord::Migration - def self.up - add_column :owned_tag_sets, :featured, :boolean, :default => false, :null => false - add_column :owned_tag_sets, :description_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - end - - def self.down - remove_column :owned_tag_sets, :featured - remove_column :owned_tag_sets, :description_sanitizer_version - end -end diff --git a/db/migrate/20110526203419_add_header_color_to_skins.rb b/db/migrate/20110526203419_add_header_color_to_skins.rb deleted file mode 100644 index 00ed28f4b85..00000000000 --- a/db/migrate/20110526203419_add_header_color_to_skins.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddHeaderColorToSkins < ActiveRecord::Migration - def self.up - add_column :skins, :headercolor, :string - end - - def self.down - remove_column :skins, :headercolor - end -end diff --git a/db/migrate/20110601200556_add_accent_to_skins.rb b/db/migrate/20110601200556_add_accent_to_skins.rb deleted file mode 100644 index ec43b02e131..00000000000 --- a/db/migrate/20110601200556_add_accent_to_skins.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddAccentToSkins < ActiveRecord::Migration - def self.up - add_column :skins, :accent_color, :string - end - - def self.down - remove_column :skins, :accent_color - end -end diff --git a/db/migrate/20110619091214_update_prompt_meme_defaults.rb b/db/migrate/20110619091214_update_prompt_meme_defaults.rb deleted file mode 100644 index a8e12312fe2..00000000000 --- a/db/migrate/20110619091214_update_prompt_meme_defaults.rb +++ /dev/null @@ -1,11 +0,0 @@ -class UpdatePromptMemeDefaults < ActiveRecord::Migration - def self.up - change_column :prompt_memes, :requests_num_allowed, :integer, :default => 5, :null => false - change_column :prompt_memes, :signup_open, :boolean, :default => true, :null => false - end - - def self.down - change_column :prompt_memes, :requests_num_allowed, :integer, :default => 1, :null => false - change_column :prompt_memes, :signup_open, :boolean, :default => false, :null => false - end -end diff --git a/db/migrate/20110619091342_update_challenge_defaults.rb b/db/migrate/20110619091342_update_challenge_defaults.rb deleted file mode 100644 index f414371c657..00000000000 --- a/db/migrate/20110619091342_update_challenge_defaults.rb +++ /dev/null @@ -1,13 +0,0 @@ -class UpdateChallengeDefaults < ActiveRecord::Migration - def self.up - change_column :prompt_restrictions, :fandom_num_allowed, :integer, :default => 1, :null => false - change_column :prompt_restrictions, :character_num_allowed, :integer, :default => 1, :null => false - change_column :prompt_restrictions, :relationship_num_allowed, :integer, :default => 1, :null => false - end - - def self.down - change_column :prompt_restrictions, :fandom_num_allowed, :integer, :default => 0, :null => false - change_column :prompt_restrictions, :character_num_allowed, :integer, :default => 0, :null => false - change_column :prompt_restrictions, :relationship_num_allowed, :integer, :default => 0, :null => false - end -end diff --git a/db/migrate/20110621015359_add_language_to_external_works.rb b/db/migrate/20110621015359_add_language_to_external_works.rb deleted file mode 100644 index 8c6433801cf..00000000000 --- a/db/migrate/20110621015359_add_language_to_external_works.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddLanguageToExternalWorks < ActiveRecord::Migration - def self.up - add_column :external_works, :language_id, :integer - end - - def self.down - remove_column :external_works, :language_id - end -end diff --git a/db/migrate/20110710033732_create_owned_set_taggings.rb b/db/migrate/20110710033732_create_owned_set_taggings.rb deleted file mode 100644 index d59d8f7dbfd..00000000000 --- a/db/migrate/20110710033732_create_owned_set_taggings.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateOwnedSetTaggings < ActiveRecord::Migration - def self.up - create_table :owned_set_taggings do |t| - t.references :owned_tag_set - t.integer "set_taggable_id" - t.string "set_taggable_type", :limit => 100 - - t.timestamps - end - end - - def self.down - drop_table :owned_set_taggings - end -end diff --git a/db/migrate/20110712003637_add_nomination_limits_to_owned_tag_set.rb b/db/migrate/20110712003637_add_nomination_limits_to_owned_tag_set.rb deleted file mode 100644 index 5ec6ffd5320..00000000000 --- a/db/migrate/20110712003637_add_nomination_limits_to_owned_tag_set.rb +++ /dev/null @@ -1,15 +0,0 @@ -class AddNominationLimitsToOwnedTagSet < ActiveRecord::Migration - def self.up - add_column :owned_tag_sets, :fandom_nomination_limit, :integer, :default => 0, :null => false - add_column :owned_tag_sets, :character_nomination_limit, :integer, :default => 0, :null => false - add_column :owned_tag_sets, :relationship_nomination_limit, :integer, :default => 0, :null => false - add_column :owned_tag_sets, :freeform_nomination_limit, :integer, :default => 0, :null => false - end - - def self.down - remove_column :owned_tag_sets, :fandom_nomination_limit - remove_column :owned_tag_sets, :character_nomination_limit - remove_column :owned_tag_sets, :relationship_nomination_limit - remove_column :owned_tag_sets, :freeform_nomination_limit - end -end diff --git a/db/migrate/20110712140002_create_tag_set_nominations.rb b/db/migrate/20110712140002_create_tag_set_nominations.rb deleted file mode 100644 index f8d63f22c7c..00000000000 --- a/db/migrate/20110712140002_create_tag_set_nominations.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateTagSetNominations < ActiveRecord::Migration - def self.up - create_table :tag_set_nominations do |t| - t.references :pseud - t.references :owned_tag_set - - t.timestamps - end - end - - def self.down - drop_table :tag_set_nominations - end -end diff --git a/db/migrate/20110713013317_add_tag_set_restriction_to_prompt_restrictions.rb b/db/migrate/20110713013317_add_tag_set_restriction_to_prompt_restrictions.rb deleted file mode 100644 index c9f0bfa2cff..00000000000 --- a/db/migrate/20110713013317_add_tag_set_restriction_to_prompt_restrictions.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddTagSetRestrictionToPromptRestrictions < ActiveRecord::Migration - def self.up - add_column :prompt_restrictions, :character_restrict_to_tag_set, :boolean, :default => false, :null => false - add_column :prompt_restrictions, :relationship_restrict_to_tag_set, :boolean, :default => false, :null => false - end - - def self.down - remove_column :prompt_restrictions, :relationship_restrict_to_tag_set - remove_column :prompt_restrictions, :character_restrict_to_tag_set - end -end diff --git a/db/migrate/20110801134913_create_tag_nominations.rb b/db/migrate/20110801134913_create_tag_nominations.rb deleted file mode 100644 index 2218d9335eb..00000000000 --- a/db/migrate/20110801134913_create_tag_nominations.rb +++ /dev/null @@ -1,22 +0,0 @@ -class CreateTagNominations < ActiveRecord::Migration - def self.up - create_table :tag_nominations do |t| - t.string :type - t.references :tag_set_nomination - t.references :fandom_nomination - t.string :tagname - t.string :parent_tagname - t.text :tagnotes - t.boolean :approved, :default => false, :null => false - t.boolean :rejected, :default => false, :null => false - t.boolean :wrangled, :default => false, :null => false - t.boolean :ignored, :default => false, :null => false - - t.timestamps - end - end - - def self.down - drop_table :tag_nominations - end -end diff --git a/db/migrate/20110810012317_add_usable_to_owned_tag_sets.rb b/db/migrate/20110810012317_add_usable_to_owned_tag_sets.rb deleted file mode 100644 index b0048408a83..00000000000 --- a/db/migrate/20110810012317_add_usable_to_owned_tag_sets.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddUsableToOwnedTagSets < ActiveRecord::Migration - def self.up - add_column :owned_tag_sets, :usable, :boolean, :default => false, :null => false - end - - def self.down - remove_column :owned_tag_sets, :usable - end -end diff --git a/db/migrate/20110810150044_add_last_viewed_to_reading.rb b/db/migrate/20110810150044_add_last_viewed_to_reading.rb deleted file mode 100644 index 7a34d805d32..00000000000 --- a/db/migrate/20110810150044_add_last_viewed_to_reading.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddLastViewedToReading < ActiveRecord::Migration - #this moves updated_at from an automatic timestamp to - #one which can be backdated - def self.up - rename_column :readings, :updated_at, :last_viewed - end - - def self.down - rename_column :readings, :last_viewed, :updated_at - end -end diff --git a/db/migrate/20110812012725_add_canonical_to_tag_nominations.rb b/db/migrate/20110812012725_add_canonical_to_tag_nominations.rb deleted file mode 100644 index 2283812706f..00000000000 --- a/db/migrate/20110812012725_add_canonical_to_tag_nominations.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddCanonicalToTagNominations < ActiveRecord::Migration - def self.up - add_column :tag_nominations, :canonical, :boolean, :default => false, :null => false - add_column :tag_nominations, :exists, :boolean, :default => false, :null => false - add_column :tag_nominations, :parented, :boolean, :default => false, :null => false - end - - def self.down - remove_column :tag_nominations, :canonical - end -end diff --git a/db/migrate/20110823015903_add_synonym_to_tag_nominations.rb b/db/migrate/20110823015903_add_synonym_to_tag_nominations.rb deleted file mode 100644 index 7cb20939e2a..00000000000 --- a/db/migrate/20110823015903_add_synonym_to_tag_nominations.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddSynonymToTagNominations < ActiveRecord::Migration - def self.up - add_column :tag_nominations, :synonym, :string - end - - def self.down - remove_column :tag_nominations, :synonym - end -end diff --git a/db/migrate/20110827153658_remove_fields_from_tag_nominations.rb b/db/migrate/20110827153658_remove_fields_from_tag_nominations.rb deleted file mode 100644 index 673ddcc3c45..00000000000 --- a/db/migrate/20110827153658_remove_fields_from_tag_nominations.rb +++ /dev/null @@ -1,13 +0,0 @@ -class RemoveFieldsFromTagNominations < ActiveRecord::Migration - def self.up - remove_column :tag_nominations, :wrangled - remove_column :tag_nominations, :ignored - remove_column :tag_nominations, :tagnotes - end - - def self.down - add_column :tag_nominations, :wrangled, :boolean, :default => false, :null => false - add_column :tag_nominations, :ignored, :boolean, :default => false, :null => false - add_column :tag_nominations, :tagnotes, :text - end -end diff --git a/db/migrate/20110827185228_change_banner_text_type.rb b/db/migrate/20110827185228_change_banner_text_type.rb deleted file mode 100644 index 1e04a5bde97..00000000000 --- a/db/migrate/20110827185228_change_banner_text_type.rb +++ /dev/null @@ -1,13 +0,0 @@ -class ChangeBannerTextType < ActiveRecord::Migration - def self.up - change_table :admin_settings do |t| - t.change :banner_text, :text - end - end - - def self.down - change_table :admin_settings do |t| - t.change :banner_text, :string - end - end -end diff --git a/db/migrate/20110828172403_add_banner_text_sanitiser.rb b/db/migrate/20110828172403_add_banner_text_sanitiser.rb deleted file mode 100644 index 16b678433dd..00000000000 --- a/db/migrate/20110828172403_add_banner_text_sanitiser.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddBannerTextSanitiser < ActiveRecord::Migration - def self.up - add_column :admin_settings, :banner_text_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - end - - def self.down - remove_column :admin_settings, :banner_text_sanitizer_version - end -end diff --git a/db/migrate/20110829125505_add_failed_login_count_to_users.rb b/db/migrate/20110829125505_add_failed_login_count_to_users.rb deleted file mode 100644 index df015099e9d..00000000000 --- a/db/migrate/20110829125505_add_failed_login_count_to_users.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddFailedLoginCountToUsers < ActiveRecord::Migration - def self.up - add_column :users, :failed_login_count, :integer - end - - def self.down - remove_column :users, :failed_login_count - end -end diff --git a/db/migrate/20110905184626_create_skin_parents.rb b/db/migrate/20110905184626_create_skin_parents.rb deleted file mode 100644 index 50b5696f4bf..00000000000 --- a/db/migrate/20110905184626_create_skin_parents.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateSkinParents < ActiveRecord::Migration - def self.up - create_table :skin_parents do |t| - t.integer :child_skin_id - t.integer :parent_skin_id - t.integer :position - - t.timestamps - end - end - - def self.down - drop_table :skin_parents - end -end diff --git a/db/migrate/20110908191743_create_tag_set_associations.rb b/db/migrate/20110908191743_create_tag_set_associations.rb deleted file mode 100644 index 6443a53ef34..00000000000 --- a/db/migrate/20110908191743_create_tag_set_associations.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateTagSetAssociations < ActiveRecord::Migration - def self.up - create_table :tag_set_associations do |t| - t.references :owned_tag_set - t.references :tag - t.references :parent_tag - - t.timestamps - end - end - - def self.down - drop_table :tag_set_associations - end -end diff --git a/db/migrate/20111006032145_add_features_to_skins.rb b/db/migrate/20111006032145_add_features_to_skins.rb deleted file mode 100644 index e5207919156..00000000000 --- a/db/migrate/20111006032145_add_features_to_skins.rb +++ /dev/null @@ -1,23 +0,0 @@ -class AddFeaturesToSkins < ActiveRecord::Migration - def self.up - add_column :skins, :role, :string - add_column :skins, :media, :string - add_column :skins, :ie_condition, :string - add_column :skins, :filename, :string - add_column :skins, :do_not_upgrade, :boolean, :default => false, :null => false - add_column :skins, :cached, :boolean, :default => false, :null => false - - add_column :admin_settings, :default_skin_id, :integer - end - - def self.down - remove_column :skins, :filename - remove_column :skins, :media - remove_column :skins, :role - remove_column :skins, :ie_condition - remove_column :skins, :do_not_upgrade - remove_column :skins, :cached - - remove_column :admin_settings, :default_skin_id - end -end diff --git a/db/migrate/20111007235357_add_unusable_to_skins.rb b/db/migrate/20111007235357_add_unusable_to_skins.rb deleted file mode 100644 index cd11ef91797..00000000000 --- a/db/migrate/20111007235357_add_unusable_to_skins.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddUnusableToSkins < ActiveRecord::Migration - def self.up - add_column :skins, :unusable, :boolean, :default => false, :null => false - end - - def self.down - remove_column :skins, :unusable - end -end diff --git a/db/migrate/20111013010307_add_title_options_to_prompt_restrictions.rb b/db/migrate/20111013010307_add_title_options_to_prompt_restrictions.rb deleted file mode 100644 index 52df3f590a9..00000000000 --- a/db/migrate/20111013010307_add_title_options_to_prompt_restrictions.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddTitleOptionsToPromptRestrictions < ActiveRecord::Migration - def self.up - add_column :prompt_restrictions, :title_required, :boolean, :default => false, :null => false - add_column :prompt_restrictions, :title_allowed, :boolean, :default => false, :null => false - end - - def self.down - remove_column :prompt_restrictions, :title_required - remove_column :prompt_restrictions, :title_allowed - end -end diff --git a/db/migrate/20111027173425_add_featured_and_in_chooser_to_skins.rb b/db/migrate/20111027173425_add_featured_and_in_chooser_to_skins.rb deleted file mode 100644 index 310f266ba11..00000000000 --- a/db/migrate/20111027173425_add_featured_and_in_chooser_to_skins.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddFeaturedAndInChooserToSkins < ActiveRecord::Migration - def self.up - add_column :skins, :featured, :boolean, :default => false, :null => false - add_column :skins, :in_chooser, :boolean, :default => false, :null => false - end - - def self.down - remove_column :skins, :in_chooser - remove_column :skins, :featured - end -end diff --git a/db/migrate/20111122225340_add_comment_to_pseuds.rb b/db/migrate/20111122225340_add_comment_to_pseuds.rb deleted file mode 100644 index 991164faa1b..00000000000 --- a/db/migrate/20111122225340_add_comment_to_pseuds.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddCommentToPseuds < ActiveRecord::Migration - def self.up - add_column :pseuds, :icon_comment_text, :string, :default => "" - end - - def self.down - remove_column :pseuds, :icon_comment_text - end -end diff --git a/db/migrate/20111122225341_add_icontext_to_collections.rb b/db/migrate/20111122225341_add_icontext_to_collections.rb deleted file mode 100644 index 599aa58ad6b..00000000000 --- a/db/migrate/20111122225341_add_icontext_to_collections.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddIcontextToCollections < ActiveRecord::Migration - def self.up - add_column :collections, :icon_alt_text, :string, :default => "" - end - - def self.down - remove_column :collections, :icon_alt_text - end -end diff --git a/db/migrate/20111123011929_add_login_unique_index_to_users.rb b/db/migrate/20111123011929_add_login_unique_index_to_users.rb deleted file mode 100644 index 483b741a99a..00000000000 --- a/db/migrate/20111123011929_add_login_unique_index_to_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddLoginUniqueIndexToUsers < ActiveRecord::Migration - def self.up - remove_index :users, :login - add_index :users, :login, :unique => true - end - - def self.down - remove_index :users, :login - add_index :users, :login, :unique => false - end -end diff --git a/db/migrate/20111206225341_add_iconcomment_to_collections.rb b/db/migrate/20111206225341_add_iconcomment_to_collections.rb deleted file mode 100644 index 85afd132087..00000000000 --- a/db/migrate/20111206225341_add_iconcomment_to_collections.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddIconcommentToCollections < ActiveRecord::Migration - def self.up - add_column :collections, :icon_comment_text, :string, :default => "" - end - - def self.down - remove_column :collections, :icon_comment_text - end -end diff --git a/db/migrate/20120131225520_filter_tagging_primary_key.rb b/db/migrate/20120131225520_filter_tagging_primary_key.rb deleted file mode 100644 index 5513a017748..00000000000 --- a/db/migrate/20120131225520_filter_tagging_primary_key.rb +++ /dev/null @@ -1,11 +0,0 @@ -class FilterTaggingPrimaryKey < ActiveRecord::Migration - def self.up - # execute "ALTER TABLE `filter_taggings` DROP INDEX `primary`, ADD PRIMARY KEY (`id`,`filter_id`);" -# execute "ALTER TABLE `filter_taggings` PARTITION BY KEY(`filter_id`) PARTITIONS 16;" - end - - def self.down -# execute "ALTER TABLE `filter_taggings` REMOVE PARTITIONING;" - # execute "ALTER TABLE `filter_taggings` DROP INDEX `primary`, ADD PRIMARY KEY (`id`);" - end -end diff --git a/db/migrate/20120206034312_create_work_links.rb b/db/migrate/20120206034312_create_work_links.rb deleted file mode 100644 index 10695b2728c..00000000000 --- a/db/migrate/20120206034312_create_work_links.rb +++ /dev/null @@ -1,18 +0,0 @@ -class CreateWorkLinks < ActiveRecord::Migration - def self.up - create_table :work_links do |t| - t.references :work - t.string :url - t.integer :count - - t.timestamps - end - - add_index "work_links", ["work_id", "url"], :name => "work_links_work_id_url", :unique => true - - end - - def self.down - drop_table :work_links - end -end diff --git a/db/migrate/20120226024139_add_stats_updated_at_to_admin_settings.rb b/db/migrate/20120226024139_add_stats_updated_at_to_admin_settings.rb deleted file mode 100644 index c7176df09ab..00000000000 --- a/db/migrate/20120226024139_add_stats_updated_at_to_admin_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddStatsUpdatedAtToAdminSettings < ActiveRecord::Migration - def self.up - add_column :admin_settings, :stats_updated_at, :datetime - end - - def self.down - remove_column :admin_settings, :stats_updated_at - end -end diff --git a/db/migrate/20120415134615_add_unwrangleable_to_tags.rb b/db/migrate/20120415134615_add_unwrangleable_to_tags.rb deleted file mode 100644 index 7d2bbe8b768..00000000000 --- a/db/migrate/20120415134615_add_unwrangleable_to_tags.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddUnwrangleableToTags < ActiveRecord::Migration - def self.up - add_column :tags, :unwrangleable, :boolean, :default => false, :null => false - end - - def self.down - remove_column :tags, :unwrangleable - end -end diff --git a/db/migrate/20120501210459_add_unique_index_filter_id_to_filter_count.rb b/db/migrate/20120501210459_add_unique_index_filter_id_to_filter_count.rb deleted file mode 100644 index 1108c798a54..00000000000 --- a/db/migrate/20120501210459_add_unique_index_filter_id_to_filter_count.rb +++ /dev/null @@ -1,32 +0,0 @@ -class AddUniqueIndexFilterIdToFilterCount < ActiveRecord::Migration - def self.up - # first get rid of duplicates! - invalid_filter_counts = FilterCount.group(:filter_id).having("COUNT(filter_id) > 1") - invalid_filter_counts.each do |ifc| - # identify duplicates - filter_counts_to_remove = FilterCount.where(:filter_id => ifc.filter_id) - # preserve one of them - filter_counts_to_remove.shift - # delete the others - filter_counts_to_remove.each {|fc| fc.destroy } - - # refresh the affected filter tags to be up to date - Tag.where(:id => ifc.filter_id).each do |filter_tag| - begin - filter_tag.reset_filter_count - rescue - puts "Problem resetting #{filter_tag.name}" - end - end - end - - # replace the index with a unique index, which will not allow duplicates in the future - remove_index :filter_counts, :filter_id - add_index :filter_counts, :filter_id, :unique => true - end - - def self.down - remove_index :filter_counts, :filter_id - add_index :filter_counts, :filter_id, :unique => false - end -end diff --git a/db/migrate/20120809161528_add_collection_info_to_works.rb b/db/migrate/20120809161528_add_collection_info_to_works.rb deleted file mode 100644 index 38b6f146600..00000000000 --- a/db/migrate/20120809161528_add_collection_info_to_works.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddCollectionInfoToWorks < ActiveRecord::Migration - def self.up - add_column :works, :in_anon_collection, :boolean, :default => false, :null => false - add_column :works, :in_unrevealed_collection, :boolean, :default => false, :null => false - end - - def self.down - remove_column :works, :in_unrevealed_collection - remove_column :works, :in_anon_collection - end -end diff --git a/db/migrate/20120809164434_change_hit_counters_to_stat_counters.rb b/db/migrate/20120809164434_change_hit_counters_to_stat_counters.rb deleted file mode 100644 index 7e9cc6b98f0..00000000000 --- a/db/migrate/20120809164434_change_hit_counters_to_stat_counters.rb +++ /dev/null @@ -1,15 +0,0 @@ -class ChangeHitCountersToStatCounters < ActiveRecord::Migration - def self.up - rename_table :hit_counters, :stat_counters - add_column :stat_counters, :comments_count, :integer, :default => 0, :null => false - add_column :stat_counters, :kudos_count, :integer, :default => 0, :null => false - add_column :stat_counters, :bookmarks_count, :integer, :default => 0, :null => false - end - - def self.down - remove_column :stat_counters, :bookmarks_count - remove_column :stat_counters, :kudos_count - remove_column :stat_counters, :comments_count - rename_table :stat_counters, :hit_counters - end -end diff --git a/db/migrate/20120825165632_create_searches.rb b/db/migrate/20120825165632_create_searches.rb deleted file mode 100644 index 1af77d4cd5b..00000000000 --- a/db/migrate/20120825165632_create_searches.rb +++ /dev/null @@ -1,16 +0,0 @@ -class CreateSearches < ActiveRecord::Migration - def self.up - create_table :searches do |t| - t.references :user - t.string :name - t.text :options - t.string :type - - t.timestamps - end - end - - def self.down - drop_table :searches - end -end diff --git a/db/migrate/20120901113344_add_filter_control_to_admin_settings.rb b/db/migrate/20120901113344_add_filter_control_to_admin_settings.rb deleted file mode 100644 index 40f69a7fad9..00000000000 --- a/db/migrate/20120901113344_add_filter_control_to_admin_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddFilterControlToAdminSettings < ActiveRecord::Migration - def self.up - add_column :admin_settings, :disable_filtering, :boolean, :null => false, :default => false - end - - def self.down - remove_column :admin_settings, :disable_filtering - end -end diff --git a/db/migrate/20120913222728_remove_openid_from_users.rb b/db/migrate/20120913222728_remove_openid_from_users.rb deleted file mode 100644 index 2a6f9f19e82..00000000000 --- a/db/migrate/20120913222728_remove_openid_from_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class RemoveOpenidFromUsers < ActiveRecord::Migration - def self.up - remove_index :users, :identity_url - remove_column :users, :identity_url - end - - def self.down - add_column :users, :identity_url, :text, :limit => 191 - add_index :users, :identity_url, :unique => true - end -end diff --git a/db/migrate/20120921094037_add_email_notifications_to_collection_preferences.rb b/db/migrate/20120921094037_add_email_notifications_to_collection_preferences.rb deleted file mode 100644 index e4171e11f71..00000000000 --- a/db/migrate/20120921094037_add_email_notifications_to_collection_preferences.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddEmailNotificationsToCollectionPreferences < ActiveRecord::Migration - def self.up - add_column :collection_preferences, :email_notify, :boolean, :default => false, :null => false - end - - def self.down - remove_column :collection_preferences, :email_notify - end -end diff --git a/db/migrate/20121023221449_remove_old_translation_systems.rb b/db/migrate/20121023221449_remove_old_translation_systems.rb deleted file mode 100644 index 758cea4313f..00000000000 --- a/db/migrate/20121023221449_remove_old_translation_systems.rb +++ /dev/null @@ -1,12 +0,0 @@ -class RemoveOldTranslationSystems < ActiveRecord::Migration - def self.up - drop_table :tolk_locales - drop_table :tolk_phrases - drop_table :tolk_translations - drop_table :translation_notes - drop_table :translations - end - - def self.down - end -end diff --git a/db/migrate/20121102002223_add_request_invite_enabled_field.rb b/db/migrate/20121102002223_add_request_invite_enabled_field.rb deleted file mode 100644 index ffad1f5db38..00000000000 --- a/db/migrate/20121102002223_add_request_invite_enabled_field.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddRequestInviteEnabledField < ActiveRecord::Migration - def self.up - add_column :admin_settings, :request_invite_enabled, :boolean, :null => false, :default => false - end - - def self.down - remove_column :admin_settings, :request_invite_enabled - end -end diff --git a/db/migrate/20121129192353_add_sortable_name_to_tags.rb b/db/migrate/20121129192353_add_sortable_name_to_tags.rb deleted file mode 100644 index 191845e4b4d..00000000000 --- a/db/migrate/20121129192353_add_sortable_name_to_tags.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddSortableNameToTags < ActiveRecord::Migration - def self.up - add_column :tags, :sortable_name, :string, :null => false, :default => '' - add_index :tags, :sortable_name - end - - def self.down - remove_column :tags, :sortable_name - end -end diff --git a/db/migrate/20121205215503_add_account_creation_options.rb b/db/migrate/20121205215503_add_account_creation_options.rb deleted file mode 100644 index 18caf86ab46..00000000000 --- a/db/migrate/20121205215503_add_account_creation_options.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddAccountCreationOptions < ActiveRecord::Migration - def self.up - add_column :admin_settings, :creation_requires_invite, :boolean, :null => false, :default => false - end - - def self.down - remove_column :admin_settings, :creation_requires_invite - end -end diff --git a/db/migrate/20121220012746_add_anon_commenting_preference.rb b/db/migrate/20121220012746_add_anon_commenting_preference.rb deleted file mode 100644 index 961e3d6ef0a..00000000000 --- a/db/migrate/20121220012746_add_anon_commenting_preference.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddAnonCommentingPreference < ActiveRecord::Migration - def self.up - add_column :works, :anon_commenting_enabled, :boolean, :null => true, :default => true - end - - def self.down - remove_column :works, :anon_commenting_enabled - end -end diff --git a/db/migrate/20130113003307_create_admin_activities.rb b/db/migrate/20130113003307_create_admin_activities.rb deleted file mode 100644 index c29095f91f6..00000000000 --- a/db/migrate/20130113003307_create_admin_activities.rb +++ /dev/null @@ -1,18 +0,0 @@ -class CreateAdminActivities < ActiveRecord::Migration - def self.up - create_table :admin_activities do |t| - t.references :admin - t.integer :target_id - t.string :target_type - t.string :action - t.text :summary - t.integer :summary_sanitizer_version, :limit => 2, :default => 0, :null => false - - t.timestamps - end - end - - def self.down - drop_table :admin_activities - end -end diff --git a/db/migrate/20130327164311_anonymous_commenting_default_state_change.rb b/db/migrate/20130327164311_anonymous_commenting_default_state_change.rb deleted file mode 100644 index e1466b1788e..00000000000 --- a/db/migrate/20130327164311_anonymous_commenting_default_state_change.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AnonymousCommentingDefaultStateChange < ActiveRecord::Migration - def self.up - remove_column :works, :anon_commenting_enabled - add_column :works, :anon_commenting_disabled, :boolean, :null => false, :default => false - end - - def self.down - add_column :works, :anon_commenting_enabled, :boolean, :null => true, :default => true - remove_column :works, :anon_commenting_disabled - end -end diff --git a/db/migrate/20130707160714_remove_duplicate_indexes.rb b/db/migrate/20130707160714_remove_duplicate_indexes.rb deleted file mode 100644 index 6a2e85b08bc..00000000000 --- a/db/migrate/20130707160714_remove_duplicate_indexes.rb +++ /dev/null @@ -1,18 +0,0 @@ -## Database Changes in reference to issue 3428 -## Last Updated 10-29-2013 - Stephanie -class RemoveDuplicateIndexes < ActiveRecord::Migration - def self.up - remove_index(:challenge_claims , :name => 'index_challenge_claims_on_creation_id') - remove_index(:creatorships, :name => 'index_creatorships_creation') - remove_index(:kudos, :name => 'index_kudos_on_commentable_id_and_commentable_type') - remove_index(:bookmarks, :name => 'index_bookmarkable') - end - - def self.down - add_index(:challenge_claims, [:creation_id], :name => 'index_challenge_claims_on_creation_id') - add_index(:creatorships, [:creation_id,:creation_type], :name => 'index_creatorships_creation') - add_index(:kudos, [:commentable_id,:commentable_type], :name => 'index_kudos_on_commentable_id_and_commentable_type') - add_index(:bookmarks, [:bookmarkable_id,:bookmarkable_type], :name => 'index_bookmarkable') - end -end - diff --git a/db/migrate/20130707160814_revert_filter_taggings_primary_key.rb b/db/migrate/20130707160814_revert_filter_taggings_primary_key.rb deleted file mode 100644 index 1d82d45076a..00000000000 --- a/db/migrate/20130707160814_revert_filter_taggings_primary_key.rb +++ /dev/null @@ -1,15 +0,0 @@ -class RevertFilterTaggingsPrimaryKey < ActiveRecord::Migration - def self.up - # We want to handle this differently for staging/production due to the size of the table - # if Rails.env.development? - # execute "ALTER TABLE `filter_taggings` DROP INDEX `primary`, ADD PRIMARY KEY (`id`);" - # end - end - - def self.down - # if Rails.env.development? - # execute "ALTER TABLE `filter_taggings` DROP INDEX `primary`, ADD PRIMARY KEY (`id`,`filter_id`);" - # end - end -end - diff --git a/db/migrate/20140208200234_create_api_keys.rb b/db/migrate/20140208200234_create_api_keys.rb deleted file mode 100644 index d92cfa1cabc..00000000000 --- a/db/migrate/20140208200234_create_api_keys.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateApiKeys < ActiveRecord::Migration - def change - create_table :api_keys do |t| - t.string :name, null: false - t.string :access_token, null: false - t.boolean :banned, default: false, null: false - - t.timestamps - end - add_index :api_keys, :name, unique: true - add_index :api_keys, :access_token, unique: true - end -end diff --git a/db/migrate/20140326130206_add_potential_match_indexes.rb b/db/migrate/20140326130206_add_potential_match_indexes.rb deleted file mode 100644 index 9624eaba487..00000000000 --- a/db/migrate/20140326130206_add_potential_match_indexes.rb +++ /dev/null @@ -1,19 +0,0 @@ -class AddPotentialMatchIndexes < ActiveRecord::Migration - def up - add_index :potential_matches, :collection_id - add_index :potential_matches, :offer_signup_id - add_index :potential_matches, :request_signup_id - add_index :potential_prompt_matches, :potential_match_id - add_index :potential_prompt_matches, :offer_id - add_index :potential_prompt_matches, :request_id - end - - def down - remove_index :potential_matches, :collection_id - remove_index :potential_matches, :offer_signup_id - remove_index :potential_matches, :request_signup_id - remove_index :potential_prompt_matches, :potential_match_id - remove_index :potential_prompt_matches, :offer_id - remove_index :potential_prompt_matches, :request_id - end -end diff --git a/db/migrate/20140327111111_doc_faq_rework.rb b/db/migrate/20140327111111_doc_faq_rework.rb deleted file mode 100644 index 5e22cdf61ac..00000000000 --- a/db/migrate/20140327111111_doc_faq_rework.rb +++ /dev/null @@ -1,47 +0,0 @@ -class DocFaqRework < ActiveRecord::Migration - def self.up - # Create new questions table and add the variables - create_table :questions do |t| - t.integer :archive_faq_id - t.string :question - t.text :content - t.string :anchor - t.text :screencast - t.timestamps - end - # Create new columns for content and screencast sanitizer and position for reordering - #add_column :questions, :content_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - #add_column :questions, :screencast_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - add_column :questions, :position, :integer, :default => 1 - - # add a language_id variable to the archive_faqs table - # add_column :archive_faqs, :translated_faq_id, :integer - # add_column :archive_faqs, :language_id, :integer - - # Remove the old archive_faqs table's column called 'content', as it is being moved inside the Questions table - remove_column :archive_faqs, :content - remove_column :archive_faqs, :content_sanitizer_version - - # Globalize gem translation table - Question.create_translation_table! :question => :string, :content => :text - #ArchiveFaq.create_translation_table! :title => :string - ArchiveFaq.create_translation_table!({ - :title => :string - }, { - :migrate_data => true - }) - # Here goes nothing - add_column :question_translations, :content_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - add_column :question_translations, :screencast_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - end - - def self.down - drop_table :questions - add_column :archive_faqs, :content, :text - add_column :archive_faqs, :content_sanitizer_version, :integer, :default => 0, :null => false, :limit => 2 - # remove_column :archive_faqs, :translated_faq_id - # remove_column :archive_faqs, :language_id - Question.drop_translation_table! - ArchiveFaq.drop_translation_table! - end -end diff --git a/db/migrate/20140406043239_create_admin_banners.rb b/db/migrate/20140406043239_create_admin_banners.rb deleted file mode 100644 index 05313f37f08..00000000000 --- a/db/migrate/20140406043239_create_admin_banners.rb +++ /dev/null @@ -1,20 +0,0 @@ -class CreateAdminBanners < ActiveRecord::Migration - def self.up - create_table :admin_banners do |t| - t.text :content - t.integer :content_sanitizer_version, :limit => 2, :default => 0, :null => false - t.string :banner_type - t.boolean :active, :default => false, :null => false - end - - remove_column :admin_settings, :banner_text - remove_column :admin_settings, :banner_text_sanitizer_version - end - - def self.down - add_column :admin_settings, :banner_text_sanitizer_version, :integer, :limit => 2, :default => 0, :null => false - add_column :admin_settings, :banner_text, :text - - drop_table :admin_banners - end -end diff --git a/db/migrate/20140808220904_create_favorite_tags.rb b/db/migrate/20140808220904_create_favorite_tags.rb deleted file mode 100644 index b5abec302e0..00000000000 --- a/db/migrate/20140808220904_create_favorite_tags.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateFavoriteTags < ActiveRecord::Migration - def change - create_table :favorite_tags do |t| - t.integer :user_id - t.integer :tag_id - end - add_index :favorite_tags, :user_id - end -end diff --git a/db/migrate/20140922024405_add_slug_to_faqs.rb b/db/migrate/20140922024405_add_slug_to_faqs.rb deleted file mode 100644 index 1ca592fd274..00000000000 --- a/db/migrate/20140922024405_add_slug_to_faqs.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddSlugToFaqs < ActiveRecord::Migration - def change - add_column :archive_faqs, :slug, :string, null: false, default: '' - ArchiveFaq.all.each do |f| - f.update_attributes(slug: f.title.parameterize) - end - add_index :archive_faqs, :slug, unique: true - end -end diff --git a/db/migrate/20140922025054_add_indices_to_faqs.rb b/db/migrate/20140922025054_add_indices_to_faqs.rb deleted file mode 100644 index 74acb334f07..00000000000 --- a/db/migrate/20140922025054_add_indices_to_faqs.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddIndicesToFaqs < ActiveRecord::Migration - def change - add_index :archive_faqs, :position - add_index :questions, [:archive_faq_id, :position] - end -end diff --git a/db/migrate/20140924023950_create_wrangling_guidelines.rb b/db/migrate/20140924023950_create_wrangling_guidelines.rb deleted file mode 100644 index 6e33e586355..00000000000 --- a/db/migrate/20140924023950_create_wrangling_guidelines.rb +++ /dev/null @@ -1,17 +0,0 @@ -class CreateWranglingGuidelines < ActiveRecord::Migration - def up - create_table :wrangling_guidelines do |t| - t.integer :admin_id - t.string :title - t.text :content - t.datetime :created_at - t.datetime :updated_at - t.integer :position - t.integer :content_sanitizer_version, :limit => 2, :default => 0, :null => false - end - end - - def down - drop_table :wrangling_guidelines - end -end diff --git a/db/migrate/20141003204623_add_interface_enabled_to_locale.rb b/db/migrate/20141003204623_add_interface_enabled_to_locale.rb new file mode 100644 index 00000000000..85936d9f9ec --- /dev/null +++ b/db/migrate/20141003204623_add_interface_enabled_to_locale.rb @@ -0,0 +1,5 @@ +class AddInterfaceEnabledToLocale < ActiveRecord::Migration + def change + add_column :locales, :interface_enabled, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20141003205439_add_email_enabled_to_locale.rb b/db/migrate/20141003205439_add_email_enabled_to_locale.rb new file mode 100644 index 00000000000..27939fb4a36 --- /dev/null +++ b/db/migrate/20141003205439_add_email_enabled_to_locale.rb @@ -0,0 +1,5 @@ +class AddEmailEnabledToLocale < ActiveRecord::Migration + def change + add_column :locales, :email_enabled, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20141004123421_add_locale_to_preferences.rb b/db/migrate/20141004123421_add_locale_to_preferences.rb new file mode 100644 index 00000000000..dd962ac3cfe --- /dev/null +++ b/db/migrate/20141004123421_add_locale_to_preferences.rb @@ -0,0 +1,5 @@ +class AddLocaleToPreferences < ActiveRecord::Migration + def change + add_column :preferences, :preferred_locale, :integer, default: 1, null: false + end +end diff --git a/db/migrate/20150106211421_add_ip_address_to_works.rb b/db/migrate/20150106211421_add_ip_address_to_works.rb deleted file mode 100644 index f28c3db09f7..00000000000 --- a/db/migrate/20150106211421_add_ip_address_to_works.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddIpAddressToWorks < ActiveRecord::Migration - def self.up - add_column :works, :ip_address, :string - add_index "works", "ip_address" - end - - def self.down - remove_index "works", "ip_address" - remove_column :works, :ip_address - end -end diff --git a/db/migrate/20150111203000_add_akismet_score_to_works.rb b/db/migrate/20150111203000_add_akismet_score_to_works.rb deleted file mode 100644 index f3f043d2fa6..00000000000 --- a/db/migrate/20150111203000_add_akismet_score_to_works.rb +++ /dev/null @@ -1,13 +0,0 @@ -class AddAkismetScoreToWorks < ActiveRecord::Migration - def self.up - add_column :works, :spam, :boolean, default: false, null: false - add_column :works, :spam_checked_at, :datetime - add_index "works", "spam" - end - - def self.down - remove_index "works", "spam" - remove_column :works, :spam - remove_column :works, :spam_checked_at - end -end diff --git a/db/migrate/20150217034225_change_favorite_tags_index.rb b/db/migrate/20150217034225_change_favorite_tags_index.rb deleted file mode 100644 index ddcdd2e3020..00000000000 --- a/db/migrate/20150217034225_change_favorite_tags_index.rb +++ /dev/null @@ -1,11 +0,0 @@ -class ChangeFavoriteTagsIndex < ActiveRecord::Migration - def self.up - remove_index :favorite_tags, :user_id - add_index :favorite_tags, [:user_id, :tag_id], unique: true - end - - def self.down - remove_index :favorite_tags, [:user_id, :tag_id] - add_index :favorite_tags, :user_id - end -end diff --git a/db/schema.rb b/db/schema.rb index 4d5af6a212e..090f9be1772 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150217034225) do +ActiveRecord::Schema.define(:version => 20010101010101) do create_table "abuse_reports", :force => true do |t| t.string "email" diff --git a/features/other_a/admin_tasks.feature b/features/other_a/admin_tasks.feature index 86a3bfde686..282ed938c21 100755 --- a/features/other_a/admin_tasks.feature +++ b/features/other_a/admin_tasks.feature @@ -342,24 +342,27 @@ Feature: Admin tasks When I edit known issues Then I should see "Known issue was successfully updated" - Scenario: Add a locale + Scenario: Add and edit a locale Given the following language exists | name | short | | Dutch | nl | And I am logged in as an admin When I go to the locales page Then I should see "English (US)" - And I follow "Add a new one" + When I follow "New Locale" And I select "Dutch" from "Language" And I fill in "locale_name" with "Dutch - Netherlands" And I fill in "locale_iso" with "nl-nl" - And I press "Submit" - Then I should see "Dutch" - And I follow "Edit" + And I check "Use this locale to send email" + And I press "Create Locale" + Then I should see "Dutch" + When I follow "Edit" And I select "English" from "Language" And I fill in "locale_name" with "English (GB)" And I fill in "locale_iso" with "en-gb" - And I press "Submit" - Then I should see "Your locale was successfully updated." + And I check "Use this locale to send email" + And I check "Use this locale for the interface" + And I press "Update Locale" + Then I should see "Your locale was successfully updated." diff --git a/public/help/locale-preferences.html b/public/help/locale-preferences.html new file mode 100644 index 00000000000..64d881c79ae --- /dev/null +++ b/public/help/locale-preferences.html @@ -0,0 +1,8 @@ +

    Locale Preferences

    + +
    +
    Set preferred locale
    +
    +This preference allows you to select your preferred language for email messages that the Archive sends to you. The templates for these messages are currently being updated and translated by our volunteers. This is a work in progress; not all messages will be available in languages other than English at this time. If the template for that email has not yet been translated to your language, it will be sent in English. +
    +