From c6668ccdf2c36013aa0492c1bbb1b7e6e37e0b8e Mon Sep 17 00:00:00 2001 From: james_ Date: Fri, 3 Oct 2014 21:36:05 +0000 Subject: [PATCH 01/30] Add fields for locales to allow emails to be sent and the user interface to be used in different locales ( adds the admin preferences ) --- app/models/locale.rb | 4 +--- app/views/locales/edit.html.erb | 4 ++++ app/views/locales/index.html.erb | 4 +++- app/views/locales/new.html.erb | 7 +++++++ .../20141003204623_add_interface_enabled_to_locale.rb | 5 +++++ db/migrate/20141003205439_add_email_enabled_to_locale.rb | 5 +++++ features/other/admin_tasks.feature | 3 +++ 7 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 db/migrate/20141003204623_add_interface_enabled_to_locale.rb create mode 100644 db/migrate/20141003205439_add_email_enabled_to_locale.rb diff --git a/app/models/locale.rb b/app/models/locale.rb index c4d0180f4dd..fb5cfaeb615 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 @@ -19,7 +17,7 @@ def self.default def self.set_base_locale(locale={:iso => "en", :name => "English"}) language = Language.find_by_short(ArchiveConfig.DEFAULT_LANGUAGE_SHORT) - Locale.find_by_iso(locale[:iso].to_s) || language.locales.create(:iso => locale[:iso].to_s, :name => locale[:name].to_s, :main => 1) + Locale.find_by_iso(locale[:iso].to_s) || language.locales.create(:iso => locale[:iso].to_s, :name => locale[:name].to_s, :main => 1, :email_enabled => 1, :interface_enabled => 1) end end diff --git a/app/views/locales/edit.html.erb b/app/views/locales/edit.html.erb index 8eea1282283..181c99b83b8 100644 --- a/app/views/locales/edit.html.erb +++ b/app/views/locales/edit.html.erb @@ -15,6 +15,10 @@
<%= f.text_field :name %>
<%= f.label :iso, t('.iso', :default => "Iso:") %>
<%= f.text_field :iso %>
+
<%= f.label :email_enabled, ts('Is the locale used to send email')%>
+
<%= f.check_box :email_enabled %>
+
<%= f.label :interface_enabled, ts('Is the locale used in the interface')%>
+
<%= f.check_box :interface_enabled %>

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

<% end %> diff --git a/app/views/locales/index.html.erb b/app/views/locales/index.html.erb index cb6980c9c3e..9c7d072a8ed 100644 --- a/app/views/locales/index.html.erb +++ b/app/views/locales/index.html.erb @@ -17,12 +17,14 @@ Name ISO code Primary locale + Allow the locale to be used for email + Allow the locale to be used for the user interface Created at <% for locale in @locales %> - <%= link_to ts('Edit'), {controller: :locales, action: :edit, id: locale.iso} %><%= locale.name %><%=locale.iso%><%=locale.main%><%=locale.updated_at%> + <%= link_to ts('Edit'), {controller: :locales, action: :edit, id: locale.iso} %><%= locale.name %><%=locale.iso%><%=locale.main%><%=locale.email_enabled%><%=locale.interface_enabled%><%=locale.updated_at%> <% end %> diff --git a/app/views/locales/new.html.erb b/app/views/locales/new.html.erb index 65ce4cd4679..29a5493e7c6 100644 --- a/app/views/locales/new.html.erb +++ b/app/views/locales/new.html.erb @@ -17,6 +17,13 @@
<%= f.label :iso, t('.iso', :default => "Iso:") %>
<%= f.text_field :iso %>
+ +
<%= f.label :email_enabled, ts('Is the locale used to send email')%>
+
<%= f.check_box :email_enabled %>
+ +
<%= f.label :interface_enabled, ts('Is the locale used in the interface')%>
+
<%= f.check_box :interface_enabled %>
+

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

<% 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/features/other/admin_tasks.feature b/features/other/admin_tasks.feature index 6f8358fcb10..ed23b477db0 100755 --- a/features/other/admin_tasks.feature +++ b/features/other/admin_tasks.feature @@ -451,12 +451,15 @@ Feature: Admin tasks 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 check "Locale enabled for email alerts" And I press "Submit" Then I should see "Dutch" And 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 check "Locale enabled for email alerts" + And I check "Locale enabled for Interface" And I press "Submit" Then I should see "Your locale was successfully updated." From 756b9c77da2cee5744c8bc2d7879dae40cfa3967 Mon Sep 17 00:00:00 2001 From: james_ Date: Fri, 3 Oct 2014 22:08:23 +0000 Subject: [PATCH 02/30] Make test not go bang --- app/models/locale.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/locale.rb b/app/models/locale.rb index fb5cfaeb615..b9c955a9b63 100644 --- a/app/models/locale.rb +++ b/app/models/locale.rb @@ -17,7 +17,7 @@ def self.default def self.set_base_locale(locale={:iso => "en", :name => "English"}) language = Language.find_by_short(ArchiveConfig.DEFAULT_LANGUAGE_SHORT) - Locale.find_by_iso(locale[:iso].to_s) || language.locales.create(:iso => locale[:iso].to_s, :name => locale[:name].to_s, :main => 1, :email_enabled => 1, :interface_enabled => 1) + Locale.find_by_iso(locale[:iso].to_s) || language.locales.create(:iso => locale[:iso].to_s, :name => locale[:name].to_s, :main => 1) end end From 89d803782b861e5a641c7581a53cb15e351dcc14 Mon Sep 17 00:00:00 2001 From: james_ Date: Sat, 4 Oct 2014 21:33:36 +0000 Subject: [PATCH 03/30] The ability to change the prefered locale is now controlled by roll out --- app/controllers/preferences_controller.rb | 1 + app/views/locales/index.html.erb | 6 ++++-- app/views/preferences/index.html.erb | 14 +++++++++++++- .../20141004123421_add_locale_to_preferences.rb | 5 +++++ public/help/locale-preferences.html | 10 ++++++++++ 5 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20141004123421_add_locale_to_preferences.rb create mode 100644 public/help/locale-preferences.html diff --git a/app/controllers/preferences_controller.rb b/app/controllers/preferences_controller.rb index 6a7b59ad19e..676a20dd46f 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/views/locales/index.html.erb b/app/views/locales/index.html.erb index 9c7d072a8ed..7f8cadadd5c 100644 --- a/app/views/locales/index.html.erb +++ b/app/views/locales/index.html.erb @@ -4,7 +4,7 @@ <% if logged_in_as_admin? || permit?("translation_admin") %> -

+

@@ -24,7 +24,7 @@ <% for locale in @locales %> - <%= link_to ts('Edit'), {controller: :locales, action: :edit, id: locale.iso} %><%= 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} %><%= locale.name %><%=locale.iso%><%=locale.main%><%=locale.email_enabled%><%=locale.interface_enabled%><%=locale.updated_at%> <% end %> @@ -34,7 +34,9 @@
  • <%= locale.name%>
  • <% end %> + <% end %> diff --git a/app/views/preferences/index.html.erb b/app/views/preferences/index.html.erb index 116e2497f7e..c4602f3e878 100644 --- a/app/views/preferences/index.html.erb +++ b/app/views/preferences/index.html.erb @@ -41,6 +41,16 @@ +<% if $rollout.active?(:set_locale_preference, @user) then %> +
    +
    +
    <%= f.label :prefered_locale, ts('Prefered Locale')%> <%= link_to_help 'locale-preferences' %>
    +
    + <%= f.select :prefered_locale, @available_locales.collect{|l| [l.name, l.id]}, :default => @preference.prefered_locale %> +
    +
    +
    +<% end %>
    <%= ts('Display') %>

    <%= ts('Display') %> <%= link_to_help 'display-preferences' %>

      @@ -68,8 +78,10 @@ <%= 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' %>:
    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..10b6bc08037 --- /dev/null +++ b/db/migrate/20141004123421_add_locale_to_preferences.rb @@ -0,0 +1,5 @@ +class AddLocaleToPreferences < ActiveRecord::Migration + def change + add_column :preferences, :prefered_locale, :integer, default: 1, null: false + end +end diff --git a/public/help/locale-preferences.html b/public/help/locale-preferences.html new file mode 100644 index 00000000000..3fe0429807d --- /dev/null +++ b/public/help/locale-preferences.html @@ -0,0 +1,10 @@ +

    Locale Preferences

    + +
    +
    Set prefered locale
    +
    +

    +This preference allows you to select your prefered 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. +

    +
    +
    From da94fdfec9fc80c38eb5df9e8a8b2d549e95c8fd Mon Sep 17 00:00:00 2001 From: james_ Date: Sat, 4 Oct 2014 22:05:56 +0000 Subject: [PATCH 04/30] If the user has a locale preference then honor it in the FAQ's --- app/controllers/archive_faqs_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/archive_faqs_controller.rb b/app/controllers/archive_faqs_controller.rb index 18ea215f4a7..3ad0ab7da02 100644 --- a/app/controllers/archive_faqs_controller.rb +++ b/app/controllers/archive_faqs_controller.rb @@ -119,7 +119,12 @@ 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) then + @i18n_locale = session[:language_id] || Locale.find(current_user.preference.prefered_locale).iso + else + @i18n_locale = session[:language_id] || I18n.default_locale + @i18n_locale = session[:language_id] || 'de' + end end def require_language_id From 34fe64dd16143d7243f121798a8f6a92a927c303 Mon Sep 17 00:00:00 2001 From: james_ Date: Sat, 4 Oct 2014 22:12:31 +0000 Subject: [PATCH 05/30] remove debugging code --- app/controllers/archive_faqs_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/archive_faqs_controller.rb b/app/controllers/archive_faqs_controller.rb index 3ad0ab7da02..741b44908c6 100644 --- a/app/controllers/archive_faqs_controller.rb +++ b/app/controllers/archive_faqs_controller.rb @@ -120,10 +120,9 @@ def set_locale session[:language_id] = params[:language_id] end if current_user.present? && $rollout.active?(:set_locale_preference, current_user) then - @i18n_locale = session[:language_id] || Locale.find(current_user.preference.prefered_locale).iso + @i18n_locale = session[:language_id] || Locale.find(current_user.preference.prefered_locale).iso else @i18n_locale = session[:language_id] || I18n.default_locale - @i18n_locale = session[:language_id] || 'de' end end From 4367bd513719b7b9e69a0fc3df5931ba5ada72ec Mon Sep 17 00:00:00 2001 From: james_ Date: Sun, 5 Oct 2014 07:41:32 +0000 Subject: [PATCH 06/30] Make the preference visible in the testing enviroment --- app/views/preferences/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/preferences/index.html.erb b/app/views/preferences/index.html.erb index c4602f3e878..6567b639c5b 100644 --- a/app/views/preferences/index.html.erb +++ b/app/views/preferences/index.html.erb @@ -41,7 +41,7 @@
    -<% if $rollout.active?(:set_locale_preference, @user) then %> +<% if Rails.env.test? || $rollout.active?(:set_locale_preference, @user) then %>
    <%= f.label :prefered_locale, ts('Prefered Locale')%> <%= link_to_help 'locale-preferences' %>
    From 8be49cf4e9ff38917eb793cedf9d36c6d5dbcdea Mon Sep 17 00:00:00 2001 From: james_ Date: Sun, 5 Oct 2014 11:21:01 +0000 Subject: [PATCH 07/30] Update text used in label --- features/other/admin_tasks.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/features/other/admin_tasks.feature b/features/other/admin_tasks.feature index ed23b477db0..08beacebdc3 100755 --- a/features/other/admin_tasks.feature +++ b/features/other/admin_tasks.feature @@ -451,15 +451,15 @@ Feature: Admin tasks 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 check "Locale enabled for email alerts" + And I check "Is the locale used to send email" And I press "Submit" Then I should see "Dutch" And 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 check "Locale enabled for email alerts" - And I check "Locale enabled for Interface" + And I check "Is the locale used to send email" + And I check "Is the locale used in the interface" And I press "Submit" Then I should see "Your locale was successfully updated." From 1c09f7e97140a237271e3968fcefaeaa6f8eb147 Mon Sep 17 00:00:00 2001 From: sarken Date: Mon, 17 Nov 2014 00:45:15 -0500 Subject: [PATCH 08/30] 4099 Locales front end suggestions --- app/views/locales/_locale_form.html.erb | 32 ++++++++++++++ app/views/locales/_navigation.html.erb | 4 ++ app/views/locales/edit.html.erb | 19 ++------ app/views/locales/index.html.erb | 58 ++++++++++++++----------- app/views/locales/new.html.erb | 24 ++-------- features/other_a/admin_tasks.feature | 22 +++++----- 6 files changed, 85 insertions(+), 74 deletions(-) create mode 100644 app/views/locales/_locale_form.html.erb create mode 100644 app/views/locales/_navigation.html.erb diff --git a/app/views/locales/_locale_form.html.erb b/app/views/locales/_locale_form.html.erb new file mode 100644 index 00000000000..d11380d07ee --- /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 {|l| [ l.name, l.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 181c99b83b8..30d0e1dcbda 100644 --- a/app/views/locales/edit.html.erb +++ b/app/views/locales/edit.html.erb @@ -1,26 +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.label :email_enabled, ts('Is the locale used to send email')%>
    -
    <%= f.check_box :email_enabled %>
    -
    <%= f.label :interface_enabled, ts('Is the locale used in the interface')%>
    -
    <%= f.check_box :interface_enabled %>
    -
    -

    <%= 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 7f8cadadd5c..e23d82b2d9d 100644 --- a/app/views/locales/index.html.erb +++ b/app/views/locales/index.html.erb @@ -1,44 +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") %> - - -

    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 localeAllow the locale to be used for emailAllow the locale to be used for the user interfaceISO CodePrimary LocaleUse for EmailUse for Interface Created atActions
    <%= locale.name %><%=locale.iso%><%=locale.main%><%=locale.email_enabled%><%=locale.interface_enabled%><%=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 %> -
      -<% for locale in @locales %> -
    • <%= locale.name%>
    • -<% end %> -
    - +
      + <% for locale in @locales %> +
    • <%= locale.name %>
    • + <% end %> +
    + <% end %> - diff --git a/app/views/locales/new.html.erb b/app/views/locales/new.html.erb index 29a5493e7c6..ddbe831ceda 100644 --- a/app/views/locales/new.html.erb +++ b/app/views/locales/new.html.erb @@ -1,31 +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.label :email_enabled, ts('Is the locale used to send email')%>
    -
    <%= f.check_box :email_enabled %>
    - -
    <%= f.label :interface_enabled, ts('Is the locale used in the interface')%>
    -
    <%= f.check_box :interface_enabled %>
    - -
    -

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

    -<% end %> +<%= render 'locale_form' %> diff --git a/features/other_a/admin_tasks.feature b/features/other_a/admin_tasks.feature index 08beacebdc3..0bb021db476 100755 --- a/features/other_a/admin_tasks.feature +++ b/features/other_a/admin_tasks.feature @@ -440,27 +440,27 @@ Feature: Admin tasks And I should see "Forgot password?" within "div#small_login" And I should not see "Get an Invite" within "div#small_login" - 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 + 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 check "Is the locale used to send email" - 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 check "Is the locale used to send email" - And I check "Is the locale used in the interface" - 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." From 753b43f1897aa9b6082fe4d72ac074d35914f648 Mon Sep 17 00:00:00 2001 From: james_ Date: Tue, 18 Nov 2014 17:59:32 +0000 Subject: [PATCH 09/30] Following Sarken's comments --- app/controllers/archive_faqs_controller.rb | 2 +- app/views/preferences/index.html.erb | 44 ++++++++++------------ public/help/locale-preferences.html | 2 - 3 files changed, 20 insertions(+), 28 deletions(-) diff --git a/app/controllers/archive_faqs_controller.rb b/app/controllers/archive_faqs_controller.rb index 741b44908c6..c7d95e91818 100644 --- a/app/controllers/archive_faqs_controller.rb +++ b/app/controllers/archive_faqs_controller.rb @@ -119,7 +119,7 @@ def set_locale if params[:language_id] && session[:language_id] != params[:language_id] session[:language_id] = params[:language_id] end - if current_user.present? && $rollout.active?(:set_locale_preference, current_user) then + if current_user.present? && $rollout.active?(:set_locale_preference, current_user) @i18n_locale = session[:language_id] || Locale.find(current_user.preference.prefered_locale).iso else @i18n_locale = session[:language_id] || I18n.default_locale diff --git a/app/views/preferences/index.html.erb b/app/views/preferences/index.html.erb index 6567b639c5b..02007bf9ffb 100644 --- a/app/views/preferences/index.html.erb +++ b/app/views/preferences/index.html.erb @@ -41,16 +41,6 @@
    -<% if Rails.env.test? || $rollout.active?(:set_locale_preference, @user) then %> -
    -
    -
    <%= f.label :prefered_locale, ts('Prefered Locale')%> <%= link_to_help 'locale-preferences' %>
    -
    - <%= f.select :prefered_locale, @available_locales.collect{|l| [l.name, l.id]}, :default => @preference.prefered_locale %> -
    -
    -
    -<% end %>
    <%= ts('Display') %>

    <%= ts('Display') %> <%= link_to_help 'display-preferences' %>

      @@ -82,21 +72,25 @@
    -
    -
    -
    <%= 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 :prefered_locale, ts('Your Locale')%> <%= link_to_help 'locale-preferences' %>
    +
    <%= f.select :prefered_locale, @available_locales.collect{|l| [l.name, l.id]}, :default => @preference.prefered_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/public/help/locale-preferences.html b/public/help/locale-preferences.html index 3fe0429807d..b83749408a7 100644 --- a/public/help/locale-preferences.html +++ b/public/help/locale-preferences.html @@ -3,8 +3,6 @@

    Locale Preferences

    Set prefered locale
    -

    This preference allows you to select your prefered 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. -

    From b68ac08ce02a55830f9543267134412b72785c33 Mon Sep 17 00:00:00 2001 From: james_ Date: Fri, 21 Nov 2014 08:43:28 +0000 Subject: [PATCH 10/30] I think that is what saren wished --- app/views/preferences/index.html.erb | 31 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/app/views/preferences/index.html.erb b/app/views/preferences/index.html.erb index 6567b639c5b..8c6eea02ba3 100644 --- a/app/views/preferences/index.html.erb +++ b/app/views/preferences/index.html.erb @@ -81,22 +81,21 @@
  • - -
    -
    -
    <%= 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 %>
    + +
    <%= f.label :work_title_format, ts('Browser page title format') %> <%= link_to_help 'work_title_format' %>:
    +
    <%= f.text_field :work_title_format %>
    +
    +
    From f7ebf1346dbf33786056cff75000a7604bb99d03 Mon Sep 17 00:00:00 2001 From: james_ Date: Fri, 21 Nov 2014 09:02:21 +0000 Subject: [PATCH 11/30] opening in
  • removed --- app/views/preferences/index.html.erb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/views/preferences/index.html.erb b/app/views/preferences/index.html.erb index 1abbb7ce0e3..f2de670baba 100644 --- a/app/views/preferences/index.html.erb +++ b/app/views/preferences/index.html.erb @@ -68,7 +68,6 @@ <%= 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' %>
  • -
  • From d1453a380c7a14c981cb57556aebe33712812237 Mon Sep 17 00:00:00 2001 From: james_ Date: Fri, 21 Nov 2014 15:24:48 +0000 Subject: [PATCH 12/30] fix from Sarken --- app/views/preferences/index.html.erb | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/app/views/preferences/index.html.erb b/app/views/preferences/index.html.erb index f2de670baba..57d0a49341c 100644 --- a/app/views/preferences/index.html.erb +++ b/app/views/preferences/index.html.erb @@ -63,36 +63,32 @@ <%= 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.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) %> + + <% if Rails.env.test? || Rails.env.development? || $rollout.active?(:set_locale_preference, @user) %> +
    <%= f.label :prefered_locale, ts('Your Locale')%> <%= link_to_help 'locale-preferences' %>
    +
    <%= f.select :prefered_locale, @available_locales.collect{|l| [l.name, l.id]}, :default => @preference.prefered_locale %>
    + <% end %> -
    <%= f.label :prefered_locale, ts('Your Locale')%> <%= link_to_help 'locale-preferences' %>
    -
    <%= f.select :prefered_locale, @available_locales.collect{|l| [l.name, l.id]}, :default => @preference.prefered_locale %>
    -<% end %>
    <%= f.label :work_title_format, ts('Browser page title format') %> <%= link_to_help 'work_title_format' %>:
    ->>>>>>> fb64249456489dd391b7cf45905b066035989f7e
    <%= f.text_field :work_title_format %>
    -
    <%= ts('Statistics') %> From d04cac4c826759c2c6735485fd2f96ae3b7979cd Mon Sep 17 00:00:00 2001 From: james_ Date: Sun, 11 Jan 2015 19:47:12 +0000 Subject: [PATCH 13/30] Listen to the hound --- app/controllers/archive_faqs_controller.rb | 2 +- app/controllers/preferences_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/archive_faqs_controller.rb b/app/controllers/archive_faqs_controller.rb index c7d95e91818..02d63133856 100644 --- a/app/controllers/archive_faqs_controller.rb +++ b/app/controllers/archive_faqs_controller.rb @@ -119,7 +119,7 @@ def set_locale if params[:language_id] && session[:language_id] != params[:language_id] session[:language_id] = params[:language_id] end - if current_user.present? && $rollout.active?(:set_locale_preference, current_user) + if current_user.present? && $rollout.active?(:set_locale_preference, current_user) @i18n_locale = session[:language_id] || Locale.find(current_user.preference.prefered_locale).iso else @i18n_locale = session[:language_id] || I18n.default_locale diff --git a/app/controllers/preferences_controller.rb b/app/controllers/preferences_controller.rb index 676a20dd46f..795e9635d01 100644 --- a/app/controllers/preferences_controller.rb +++ b/app/controllers/preferences_controller.rb @@ -14,7 +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) + @available_locales = Locale.where(email_enabled: true) end def update From 3e6d0f089264e90378ddfb52350d6a76cfd0819a Mon Sep 17 00:00:00 2001 From: james_ Date: Sun, 26 Apr 2015 06:15:29 +0000 Subject: [PATCH 14/30] Follow the hound --- app/controllers/archive_faqs_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/archive_faqs_controller.rb b/app/controllers/archive_faqs_controller.rb index 02d63133856..227209578ad 100644 --- a/app/controllers/archive_faqs_controller.rb +++ b/app/controllers/archive_faqs_controller.rb @@ -119,7 +119,7 @@ def set_locale if params[:language_id] && session[:language_id] != params[:language_id] session[:language_id] = params[:language_id] end - if current_user.present? && $rollout.active?(:set_locale_preference, current_user) + if current_user.present? && $rollout.active?(:set_locale_preference, current_user) @i18n_locale = session[:language_id] || Locale.find(current_user.preference.prefered_locale).iso else @i18n_locale = session[:language_id] || I18n.default_locale From 6e8c6dbe5f8c67f8382e2db033f7b0a7db5ced99 Mon Sep 17 00:00:00 2001 From: james_ Date: Thu, 30 Apr 2015 22:27:42 +0000 Subject: [PATCH 15/30] language not l --- app/views/locales/_locale_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/locales/_locale_form.html.erb b/app/views/locales/_locale_form.html.erb index d11380d07ee..6784dc8e3c5 100644 --- a/app/views/locales/_locale_form.html.erb +++ b/app/views/locales/_locale_form.html.erb @@ -12,7 +12,7 @@
    <%= f.text_field :iso %>
    <%= f.label :language_id, t('.language', :default => "Language") + '*' %>
    -
    <%= f.select(:language_id, @languages.collect {|l| [ l.name, l.id ] }) %>
    +
    <%= 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")%>
    From 2c6788f0b119bc462ac0876058e4b5a87d98480a Mon Sep 17 00:00:00 2001 From: james_ Date: Thu, 30 Apr 2015 22:29:10 +0000 Subject: [PATCH 16/30] Fix spaces --- app/views/locales/_locale_form.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/locales/_locale_form.html.erb b/app/views/locales/_locale_form.html.erb index 6784dc8e3c5..7168b82001e 100644 --- a/app/views/locales/_locale_form.html.erb +++ b/app/views/locales/_locale_form.html.erb @@ -15,10 +15,10 @@
    <%= 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.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")%>
    +
    <%= f.label :interface_enabled, t('.enable_interface', :default => "Use this locale for the interface") %>
    From 9c26565f2698fd89427a3e7837cf56ca5f1fd92f Mon Sep 17 00:00:00 2001 From: james_ Date: Thu, 30 Apr 2015 22:29:59 +0000 Subject: [PATCH 17/30] s/L/l/; --- app/views/preferences/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/preferences/index.html.erb b/app/views/preferences/index.html.erb index 57d0a49341c..b543a7d1e0a 100644 --- a/app/views/preferences/index.html.erb +++ b/app/views/preferences/index.html.erb @@ -81,7 +81,7 @@
    <%= 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 :prefered_locale, ts('Your Locale')%> <%= link_to_help 'locale-preferences' %>
    +
    <%= f.label :prefered_locale, ts('Your locale')%> <%= link_to_help 'locale-preferences' %>
    <%= f.select :prefered_locale, @available_locales.collect{|l| [l.name, l.id]}, :default => @preference.prefered_locale %>
    <% end %> From 4056207a1734d6ba5895991438d3216dcb807569 Mon Sep 17 00:00:00 2001 From: james_ Date: Thu, 30 Apr 2015 22:31:28 +0000 Subject: [PATCH 18/30] locale not l --- app/views/preferences/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/preferences/index.html.erb b/app/views/preferences/index.html.erb index b543a7d1e0a..17dc8b09f45 100644 --- a/app/views/preferences/index.html.erb +++ b/app/views/preferences/index.html.erb @@ -82,7 +82,7 @@ <% if Rails.env.test? || Rails.env.development? || $rollout.active?(:set_locale_preference, @user) %>
    <%= f.label :prefered_locale, ts('Your locale')%> <%= link_to_help 'locale-preferences' %>
    -
    <%= f.select :prefered_locale, @available_locales.collect{|l| [l.name, l.id]}, :default => @preference.prefered_locale %>
    +
    <%= f.select :prefered_locale, @available_locales.collect{|locale| [locale.name, locale.id]}, :default => @preference.prefered_locale %>
    <% end %>
    <%= f.label :work_title_format, ts('Browser page title format') %> <%= link_to_help 'work_title_format' %>:
    From 07080f2a041d28d3daab8ab8cefd0546498fd832 Mon Sep 17 00:00:00 2001 From: james_ Date: Thu, 30 Apr 2015 22:32:29 +0000 Subject: [PATCH 19/30] Change the text --- public/help/locale-preferences.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/help/locale-preferences.html b/public/help/locale-preferences.html index b83749408a7..fd8fb4aaf6c 100644 --- a/public/help/locale-preferences.html +++ b/public/help/locale-preferences.html @@ -1,7 +1,7 @@

    Locale Preferences

    -
    Set prefered locale
    +
    Set preferred locale
    This preference allows you to select your prefered 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.
    From 81d76a7b0f68693eb0ecd51720511cd368873766 Mon Sep 17 00:00:00 2001 From: james_ Date: Thu, 30 Apr 2015 22:35:33 +0000 Subject: [PATCH 20/30] Clear up tests --- features/other_a/admin_tasks.feature | 99 ---------------------------- 1 file changed, 99 deletions(-) diff --git a/features/other_a/admin_tasks.feature b/features/other_a/admin_tasks.feature index 3677ce89366..282ed938c21 100755 --- a/features/other_a/admin_tasks.feature +++ b/features/other_a/admin_tasks.feature @@ -342,105 +342,6 @@ Feature: Admin tasks When I edit known issues Then I should see "Known issue was successfully updated" -<<<<<<< HEAD - - Scenario: Admin can set invite from queue number to a number greater than or equal to 1 - - Given I am logged in as an admin - And I go to the admin-settings page - And I fill in "admin_setting_invite_from_queue_number" with "0" - And I press "Update" - Then I should see "Invite from queue number must be greater than 0. To disable invites, uncheck the appropriate setting." - When I fill in "admin_setting_invite_from_queue_number" with "1" - And I press "Update" - Then I should not see "Invite from queue number must be greater than 0." - - Scenario: Account creation enabled - Given the following admin exists - | login | password | - | Scott | password | - When I go to the admin_login page - And I fill in "admin_session_login" with "Scott" - And I fill in "admin_session_password" with "password" - And I press "Log in as admin" - And I follow "Settings" - And I check "Account creation enabled" - And I uncheck "Account creation requires invitation" - And I uncheck "admin_setting_invite_from_queue_enabled" - And I press "Update" - When I am logged out as an admin - And I go to account creation page - And I should be on account creation page - And I should see "Create Account" - - - Scenario: Account creation disabled - Given the following admin exists - | login | password | - | Scott | password | - When I go to the admin_login page - And I fill in "admin_session_login" with "Scott" - And I fill in "admin_session_password" with "password" - And I press "Log in as admin" - And I follow "Settings" - And I uncheck "Account creation enabled" - And I press "Update" - When I am logged out as an admin - And I go to account creation page - Then I should be on the home page - And I should see "Account creation is suspended at the moment. Please check back with us later." - # Check to see if the buttons are correct on the main page - And I should see "Log in or Get an Invite" - # Check to see if the buttons are correct in the login popup - And I should see "Forgot password? Get an Invite" within "div#small_login" - - Scenario: Account creation enabled, Invite required, Queue enabled - Given the following admin exists - | login | password | - | Scott | password | - When I go to the admin_login page - And I fill in "admin_session_login" with "Scott" - And I fill in "admin_session_password" with "password" - And I press "Log in as admin" - And I follow "Settings" - And I check "Account creation enabled" - And I check "Account creation requires invitation" - And I check "admin_setting_invite_from_queue_enabled" - And I press "Update" - When I am logged out as an admin - And I go to account creation page - Then I should be on invite requests page - And I should see "To create an account, you'll need an invitation. One option is to add your name to the automatic queue below." - Then I go to the home page - # Check to see if the buttons are correct on the main page - And I should see "Log in or Get an Invite" - # Check to see if the buttons are correct in the login popup - And I should see "Forgot password? Get an Invite" within "div#small_login" - - Scenario: Account creation enabled, Invite is required, Queue is disabled - Given the following admin exists - | login | password | - | Scott | password | - When I go to the admin_login page - And I fill in "admin_session_login" with "Scott" - And I fill in "admin_session_password" with "password" - And I press "Log in as admin" - And I follow "Settings" - And I check "Account creation enabled" - And I check "Account creation requires invitation" - And I uncheck "admin_setting_invite_from_queue_enabled" - And I press "Update" - When I am logged out as an admin - And I go to account creation page - Then I should be on the home page - And I should see "Account creation currently requires an invitation. We are unable to give out additional invitations at present, but existing invitations can still be used to create an account." - # Check to see if the buttons are correct on the main page - And I should see "Log in" within "p#signup" - And I should not see "Get an Invite" within "p#signup" - # Check to see if the buttons are correct in the login popup - And I should see "Forgot password?" within "div#small_login" - And I should not see "Get an Invite" within "div#small_login" - Scenario: Add and edit a locale Given the following language exists | name | short | From 066f36d1de17e27e1b99b47ade14e47149cf0c68 Mon Sep 17 00:00:00 2001 From: james_ Date: Thu, 30 Apr 2015 22:39:20 +0000 Subject: [PATCH 21/30] preferred not prefered --- app/controllers/archive_faqs_controller.rb | 2 +- app/views/preferences/index.html.erb | 4 ++-- db/migrate/20141004123421_add_locale_to_preferences.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/archive_faqs_controller.rb b/app/controllers/archive_faqs_controller.rb index 227209578ad..e9ff6ddd7c3 100644 --- a/app/controllers/archive_faqs_controller.rb +++ b/app/controllers/archive_faqs_controller.rb @@ -120,7 +120,7 @@ def set_locale session[:language_id] = params[:language_id] end if current_user.present? && $rollout.active?(:set_locale_preference, current_user) - @i18n_locale = session[:language_id] || Locale.find(current_user.preference.prefered_locale).iso + @i18n_locale = session[:language_id] || Locale.find(current_user.preference.preferred_locale).iso else @i18n_locale = session[:language_id] || I18n.default_locale end diff --git a/app/views/preferences/index.html.erb b/app/views/preferences/index.html.erb index 17dc8b09f45..3d625d86a06 100644 --- a/app/views/preferences/index.html.erb +++ b/app/views/preferences/index.html.erb @@ -81,8 +81,8 @@
    <%= 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 :prefered_locale, ts('Your locale')%> <%= link_to_help 'locale-preferences' %>
    -
    <%= f.select :prefered_locale, @available_locales.collect{|locale| [locale.name, locale.id]}, :default => @preference.prefered_locale %>
    +
    <%= 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' %>:
    diff --git a/db/migrate/20141004123421_add_locale_to_preferences.rb b/db/migrate/20141004123421_add_locale_to_preferences.rb index 10b6bc08037..dd962ac3cfe 100644 --- a/db/migrate/20141004123421_add_locale_to_preferences.rb +++ b/db/migrate/20141004123421_add_locale_to_preferences.rb @@ -1,5 +1,5 @@ class AddLocaleToPreferences < ActiveRecord::Migration def change - add_column :preferences, :prefered_locale, :integer, default: 1, null: false + add_column :preferences, :preferred_locale, :integer, default: 1, null: false end end From f6cecc30443ef3f0726854c7d293f5eb81e1d530 Mon Sep 17 00:00:00 2001 From: james_ Date: Wed, 6 May 2015 16:35:30 +0000 Subject: [PATCH 22/30] One last typo --- public/help/locale-preferences.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/help/locale-preferences.html b/public/help/locale-preferences.html index fd8fb4aaf6c..64d881c79ae 100644 --- a/public/help/locale-preferences.html +++ b/public/help/locale-preferences.html @@ -3,6 +3,6 @@

    Locale Preferences

    Set preferred locale
    -This preference allows you to select your prefered 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. +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.
    From e5754af9e878d303c091754a733b5e4883a013f4 Mon Sep 17 00:00:00 2001 From: james_ Date: Thu, 7 May 2015 16:37:23 +0000 Subject: [PATCH 23/30] Ensure the database is correct --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 856be5792aa..ad0ad7e4b4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,8 @@ services: - redis-server - memcached script: - - bundle exec rake db:create:all --trace - - bundle exec rake db:schema:load --trace + - 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: From d45b418ad96a18f8221d9bff14198f809a6e8db3 Mon Sep 17 00:00:00 2001 From: james_ Date: Thu, 7 May 2015 18:00:59 +0000 Subject: [PATCH 24/30] Update the sructure --- db/schema.rb | 30 +-- db/structure.sql | 671 ++++++++++++----------------------------------- 2 files changed, 173 insertions(+), 528 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 4d5af6a212e..1f8d54e8de4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -31,8 +31,8 @@ t.string "action" t.text "summary" t.integer "summary_sanitizer_version", :limit => 2, :default => 0, :null => false - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "admin_banners", :force => true do |t| @@ -287,15 +287,15 @@ create_table "collection_profiles", :force => true do |t| t.integer "collection_id" - t.text "intro", :limit => 16777215 - t.text "faq", :limit => 16777215 - t.text "rules", :limit => 16777215 + t.text "intro", :limit => 2147483647 + t.text "faq", :limit => 2147483647 + t.text "rules", :limit => 2147483647 t.datetime "created_at" t.datetime "updated_at" t.text "gift_notification" - t.integer "intro_sanitizer_version", :limit => 2, :default => 0, :null => false - t.integer "faq_sanitizer_version", :limit => 2, :default => 0, :null => false - t.integer "rules_sanitizer_version", :limit => 2, :default => 0, :null => false + t.integer "intro_sanitizer_version", :limit => 2, :default => 0, :null => false + t.integer "faq_sanitizer_version", :limit => 2, :default => 0, :null => false + t.integer "rules_sanitizer_version", :limit => 2, :default => 0, :null => false t.text "assignment_notification" end @@ -608,7 +608,9 @@ t.string "name" t.boolean "main" t.datetime "updated_at" - t.integer "language_id", :null => false + t.integer "language_id", :null => false + t.boolean "interface_enabled", :default => false, :null => false + t.boolean "email_enabled", :default => false, :null => false end add_index "locales", ["iso"], :name => "index_locales_on_iso" @@ -768,6 +770,7 @@ t.boolean "kudos_emails_off", :default => false, :null => false t.boolean "disable_share_links", :default => false, :null => false t.boolean "banner_seen", :default => false, :null => false + t.integer "preferred_locale", :default => 1, :null => false end add_index "preferences", ["user_id"], :name => "index_preferences_on_user_id" @@ -980,15 +983,6 @@ add_index "roles_users", ["role_id", "user_id"], :name => "index_roles_users_on_role_id_and_user_id" add_index "roles_users", ["user_id", "role_id"], :name => "index_roles_users_on_user_id_and_role_id" - create_table "saved_works", :force => true do |t| - t.integer "user_id", :null => false - t.integer "work_id", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "saved_works", ["user_id", "work_id"], :name => "index_saved_works_on_user_id_and_work_id", :unique => true - create_table "searches", :force => true do |t| t.integer "user_id" t.string "name" diff --git a/db/structure.sql b/db/structure.sql index 0478dae9987..16f4ee7b368 100755 --- a/db/structure.sql +++ b/db/structure.sql @@ -9,7 +9,7 @@ CREATE TABLE `abuse_reports` ( `category` varchar(255) DEFAULT NULL, `comment_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2222 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `admin_activities` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -19,10 +19,10 @@ CREATE TABLE `admin_activities` ( `action` varchar(255) DEFAULT NULL, `summary` text, `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `created_at` datetime DEFAULT NULL, - `updated_at` datetime DEFAULT NULL, + `created_at` datetime NOT NULL, + `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=844 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `admin_banners` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -31,7 +31,7 @@ CREATE TABLE `admin_banners` ( `banner_type` varchar(255) DEFAULT NULL, `active` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `admin_post_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -41,7 +41,7 @@ CREATE TABLE `admin_post_taggings` ( `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_admin_post_taggings_on_admin_post_id` (`admin_post_id`) -) ENGINE=InnoDB AUTO_INCREMENT=957 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `admin_post_tags` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -50,7 +50,7 @@ CREATE TABLE `admin_post_tags` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=114 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `admin_posts` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -63,9 +63,9 @@ CREATE TABLE `admin_posts` ( `translated_post_id` int(11) DEFAULT NULL, `language_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `index_admin_posts_on_post_id` (`translated_post_id`), - KEY `index_admin_posts_on_created_at` (`created_at`) -) ENGINE=InnoDB AUTO_INCREMENT=410 DEFAULT CHARSET=utf8; + KEY `index_admin_posts_on_created_at` (`created_at`), + KEY `index_admin_posts_on_post_id` (`translated_post_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `admin_settings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -91,7 +91,7 @@ CREATE TABLE `admin_settings` ( `creation_requires_invite` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `index_admin_settings_on_last_updated_by` (`last_updated_by`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; CREATE TABLE `admins` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -103,7 +103,7 @@ CREATE TABLE `admins` ( `salt` varchar(255) DEFAULT NULL, `persistence_token` varchar(255) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=145 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `api_keys` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -115,7 +115,7 @@ CREATE TABLE `api_keys` ( PRIMARY KEY (`id`), UNIQUE KEY `index_api_keys_on_name` (`name`), UNIQUE KEY `index_api_keys_on_access_token` (`access_token`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `archive_faq_translations` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -127,7 +127,7 @@ CREATE TABLE `archive_faq_translations` ( PRIMARY KEY (`id`), KEY `index_archive_faq_translations_on_archive_faq_id` (`archive_faq_id`), KEY `index_archive_faq_translations_on_locale` (`locale`) -) ENGINE=InnoDB AUTO_INCREMENT=132 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `archive_faqs` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -140,7 +140,7 @@ CREATE TABLE `archive_faqs` ( PRIMARY KEY (`id`), UNIQUE KEY `index_archive_faqs_on_slug` (`slug`), KEY `index_archive_faqs_on_position` (`position`) -) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `bookmarks` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -157,11 +157,11 @@ CREATE TABLE `bookmarks` ( `delta` tinyint(1) DEFAULT '1', `notes_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `fk_bookmarks_user` (`user_id`), - KEY `index_bookmarks_on_pseud_id` (`pseud_id`), KEY `index_bookmarkable_pseud` (`bookmarkable_id`,`bookmarkable_type`,`pseud_id`), - KEY `index_bookmarks_on_private_and_hidden_by_admin_and_created_at` (`private`,`hidden_by_admin`,`created_at`) -) ENGINE=InnoDB AUTO_INCREMENT=6784931 DEFAULT CHARSET=utf8; + KEY `index_bookmarks_on_private_and_hidden_by_admin_and_created_at` (`private`,`hidden_by_admin`,`created_at`), + KEY `index_bookmarks_on_pseud_id` (`pseud_id`), + KEY `fk_bookmarks_user` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `challenge_assignments` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -179,14 +179,14 @@ CREATE TABLE `challenge_assignments` ( `pinch_request_signup_id` int(11) DEFAULT NULL, `covered_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), + KEY `index_challenge_assignments_on_collection_id` (`collection_id`), KEY `assignments_on_creation_id` (`creation_id`), KEY `assignments_on_creation_type` (`creation_type`), + KEY `assignments_on_defaulted_at` (`defaulted_at`), KEY `assignments_on_offer_signup_id` (`offer_signup_id`), - KEY `assignments_on_offer_sent_at` (`sent_at`), KEY `assignments_on_pinch_hitter_id` (`pinch_hitter_id`), - KEY `assignments_on_defaulted_at` (`defaulted_at`), - KEY `index_challenge_assignments_on_collection_id` (`collection_id`) -) ENGINE=InnoDB AUTO_INCREMENT=104826 DEFAULT CHARSET=utf8; + KEY `assignments_on_offer_sent_at` (`sent_at`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `challenge_claims` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -202,11 +202,11 @@ CREATE TABLE `challenge_claims` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), - KEY `creations` (`creation_id`,`creation_type`), KEY `index_challenge_claims_on_claiming_user_id` (`claiming_user_id`), - KEY `index_challenge_claims_on_request_signup_id` (`request_signup_id`), - KEY `index_challenge_claims_on_collection_id` (`collection_id`) -) ENGINE=InnoDB AUTO_INCREMENT=795 DEFAULT CHARSET=utf8; + KEY `index_challenge_claims_on_collection_id` (`collection_id`), + KEY `creations` (`creation_id`,`creation_type`), + KEY `index_challenge_claims_on_request_signup_id` (`request_signup_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `challenge_signups` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -217,9 +217,9 @@ CREATE TABLE `challenge_signups` ( `assigned_as_request` tinyint(1) DEFAULT '0', `assigned_as_offer` tinyint(1) DEFAULT '0', PRIMARY KEY (`id`), - KEY `signups_on_pseud_id` (`pseud_id`), - KEY `index_challenge_signups_on_collection_id` (`collection_id`) -) ENGINE=InnoDB AUTO_INCREMENT=14135 DEFAULT CHARSET=utf8; + KEY `index_challenge_signups_on_collection_id` (`collection_id`), + KEY `signups_on_pseud_id` (`pseud_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `chapters` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -241,9 +241,9 @@ CREATE TABLE `chapters` ( `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', `endnotes_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `works_chapter_index` (`work_id`), - KEY `index_chapters_on_work_id` (`work_id`) -) ENGINE=InnoDB AUTO_INCREMENT=2124653 DEFAULT CHARSET=utf8; + KEY `index_chapters_on_work_id` (`work_id`), + KEY `works_chapter_index` (`work_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `collection_items` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -258,11 +258,11 @@ CREATE TABLE `collection_items` ( `unrevealed` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `by collection and item` (`collection_id`,`item_id`,`item_type`), - KEY `index_collection_items_approval_status` (`collection_id`,`user_approval_status`,`collection_approval_status`), - KEY `collection_items_unrevealed` (`unrevealed`), KEY `collection_items_anonymous` (`anonymous`), - KEY `collection_items_item_id` (`item_id`) -) ENGINE=InnoDB AUTO_INCREMENT=181250 DEFAULT CHARSET=utf8; + KEY `index_collection_items_approval_status` (`collection_id`,`user_approval_status`,`collection_approval_status`), + KEY `collection_items_item_id` (`item_id`), + KEY `collection_items_unrevealed` (`unrevealed`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `collection_participants` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -275,7 +275,7 @@ CREATE TABLE `collection_participants` ( UNIQUE KEY `by collection and pseud` (`collection_id`,`pseud_id`), KEY `participants_by_collection_and_role` (`collection_id`,`participant_role`), KEY `participants_pseud_id` (`pseud_id`) -) ENGINE=InnoDB AUTO_INCREMENT=11976 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `collection_preferences` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -292,14 +292,14 @@ CREATE TABLE `collection_preferences` ( `email_notify` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `index_collection_preferences_on_collection_id` (`collection_id`) -) ENGINE=InnoDB AUTO_INCREMENT=6075 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `collection_profiles` ( `id` int(11) NOT NULL AUTO_INCREMENT, `collection_id` int(11) DEFAULT NULL, - `intro` mediumtext, - `faq` mediumtext, - `rules` mediumtext, + `intro` longtext, + `faq` longtext, + `rules` longtext, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `gift_notification` text, @@ -309,7 +309,7 @@ CREATE TABLE `collection_profiles` ( `assignment_notification` text, PRIMARY KEY (`id`), KEY `index_collection_profiles_on_collection_id` (`collection_id`) -) ENGINE=InnoDB AUTO_INCREMENT=6075 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `collections` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -333,7 +333,7 @@ CREATE TABLE `collections` ( PRIMARY KEY (`id`), KEY `index_collections_on_name` (`name`), KEY `index_collections_on_parent_id` (`parent_id`) -) ENGINE=InnoDB AUTO_INCREMENT=6078 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `comments` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -360,10 +360,10 @@ CREATE TABLE `comments` ( `content_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `index_comments_commentable` (`commentable_id`,`commentable_type`), - KEY `index_comments_on_pseud_id` (`pseud_id`), KEY `index_comments_parent` (`parent_id`,`parent_type`), + KEY `index_comments_on_pseud_id` (`pseud_id`), KEY `comments_by_thread` (`thread`) -) ENGINE=InnoDB AUTO_INCREMENT=5203688 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `common_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -375,7 +375,7 @@ CREATE TABLE `common_taggings` ( PRIMARY KEY (`id`), UNIQUE KEY `index_common_tags` (`common_tag_id`,`filterable_type`,`filterable_id`), KEY `index_common_taggings_on_filterable_id` (`filterable_id`) -) ENGINE=InnoDB AUTO_INCREMENT=2655022 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `creatorships` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -387,7 +387,7 @@ CREATE TABLE `creatorships` ( PRIMARY KEY (`id`), UNIQUE KEY `creation_id_creation_type_pseud_id` (`creation_id`,`creation_type`,`pseud_id`), KEY `index_creatorships_pseud` (`pseud_id`) -) ENGINE=InnoDB AUTO_INCREMENT=3395285 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `delayed_jobs` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -402,11 +402,11 @@ CREATE TABLE `delayed_jobs` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), - KEY `delayed_jobs_run_at` (`run_at`), + KEY `delayed_jobs_failed_at` (`failed_at`), KEY `delayed_jobs_locked_at` (`locked_at`), KEY `delayed_jobs_locked_by` (`locked_by`), - KEY `delayed_jobs_failed_at` (`failed_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + KEY `delayed_jobs_run_at` (`run_at`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `external_author_names` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -416,7 +416,7 @@ CREATE TABLE `external_author_names` ( `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_external_author_names_on_external_author_id` (`external_author_id`) -) ENGINE=InnoDB AUTO_INCREMENT=4199 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `external_authors` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -428,9 +428,9 @@ CREATE TABLE `external_authors` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), - KEY `index_external_authors_on_user_id` (`user_id`), - KEY `index_external_authors_on_email` (`email`) -) ENGINE=InnoDB AUTO_INCREMENT=1910 DEFAULT CHARSET=utf8; + KEY `index_external_authors_on_email` (`email`), + KEY `index_external_authors_on_user_id` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `external_creatorships` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -441,10 +441,10 @@ CREATE TABLE `external_creatorships` ( `archivist_id` int(11) DEFAULT NULL, `external_author_name_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), + KEY `index_external_creatorships_on_archivist_id` (`archivist_id`), KEY `index_external_creatorships_on_creation_id_and_creation_type` (`creation_id`,`creation_type`), - KEY `index_external_creatorships_on_external_author_name_id` (`external_author_name_id`), - KEY `index_external_creatorships_on_archivist_id` (`archivist_id`) -) ENGINE=InnoDB AUTO_INCREMENT=12402 DEFAULT CHARSET=utf8; + KEY `index_external_creatorships_on_external_author_name_id` (`external_author_name_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `external_works` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -459,7 +459,7 @@ CREATE TABLE `external_works` ( `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', `language_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=31332 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `favorite_tags` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -467,7 +467,7 @@ CREATE TABLE `favorite_tags` ( `tag_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `index_favorite_tags_on_user_id_and_tag_id` (`user_id`,`tag_id`) -) ENGINE=InnoDB AUTO_INCREMENT=588 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `feedbacks` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -483,7 +483,7 @@ CREATE TABLE `feedbacks` ( `approved` tinyint(1) NOT NULL DEFAULT '0', `ip_address` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=14688 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `filter_counts` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -494,9 +494,9 @@ CREATE TABLE `filter_counts` ( `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `index_filter_counts_on_filter_id` (`filter_id`), - KEY `index_unhidden_works_count` (`unhidden_works_count`), - KEY `index_public_works_count` (`public_works_count`) -) ENGINE=InnoDB AUTO_INCREMENT=244850 DEFAULT CHARSET=utf8; + KEY `index_public_works_count` (`public_works_count`), + KEY `index_unhidden_works_count` (`unhidden_works_count`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `filter_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -507,9 +507,9 @@ CREATE TABLE `filter_taggings` ( `updated_at` datetime DEFAULT NULL, `inherited` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `index_filter_taggings_filterable` (`filterable_id`,`filterable_type`), - KEY `index_filter_taggings_on_filter_id_and_filterable_type` (`filter_id`,`filterable_type`) -) ENGINE=InnoDB AUTO_INCREMENT=19391996 DEFAULT CHARSET=utf8; + KEY `index_filter_taggings_on_filter_id_and_filterable_type` (`filter_id`,`filterable_type`), + KEY `index_filter_taggings_filterable` (`filterable_id`,`filterable_type`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `gift_exchanges` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -543,7 +543,7 @@ CREATE TABLE `gift_exchanges` ( `signup_instructions_offers_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', `requests_summary_visible` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=390 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `gifts` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -553,10 +553,10 @@ CREATE TABLE `gifts` ( `updated_at` datetime DEFAULT NULL, `pseud_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), + KEY `index_gifts_on_pseud_id` (`pseud_id`), KEY `index_gifts_on_recipient_name` (`recipient_name`), - KEY `index_gifts_on_work_id` (`work_id`), - KEY `index_gifts_on_pseud_id` (`pseud_id`) -) ENGINE=InnoDB AUTO_INCREMENT=102594 DEFAULT CHARSET=utf8; + KEY `index_gifts_on_work_id` (`work_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `inbox_comments` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -567,10 +567,10 @@ CREATE TABLE `inbox_comments` ( `read` tinyint(1) NOT NULL DEFAULT '0', `replied_to` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `index_inbox_comments_on_read_and_user_id` (`read`,`user_id`), KEY `index_inbox_comments_on_feedback_comment_id` (`feedback_comment_id`), + KEY `index_inbox_comments_on_read_and_user_id` (`read`,`user_id`), KEY `index_inbox_comments_on_user_id` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=4752479 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `invitations` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -588,11 +588,11 @@ CREATE TABLE `invitations` ( `from_queue` tinyint(1) NOT NULL DEFAULT '0', `external_author_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `index_invitations_on_invitee_id_and_invitee_type` (`invitee_id`,`invitee_type`), - KEY `index_invitations_on_external_author_id` (`external_author_id`), KEY `index_invitations_on_creator_id_and_creator_type` (`creator_id`,`creator_type`), + KEY `index_invitations_on_external_author_id` (`external_author_id`), + KEY `index_invitations_on_invitee_id_and_invitee_type` (`invitee_id`,`invitee_type`), KEY `index_invitations_on_token` (`token`) -) ENGINE=InnoDB AUTO_INCREMENT=355011 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `invite_requests` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -602,7 +602,7 @@ CREATE TABLE `invite_requests` ( `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_invite_requests_on_email` (`email`) -) ENGINE=InnoDB AUTO_INCREMENT=298136 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `known_issues` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -613,7 +613,7 @@ CREATE TABLE `known_issues` ( `created_at` datetime DEFAULT NULL, `content_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `kudos` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -624,10 +624,10 @@ CREATE TABLE `kudos` ( `updated_at` datetime DEFAULT NULL, `ip_address` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `index_kudos_on_pseud_id` (`pseud_id`), + KEY `index_kudos_on_commentable_id_and_commentable_type_and_pseud_id` (`commentable_id`,`commentable_type`,`pseud_id`), KEY `index_kudos_on_ip_address` (`ip_address`), - KEY `index_kudos_on_commentable_id_and_commentable_type_and_pseud_id` (`commentable_id`,`commentable_type`,`pseud_id`) -) ENGINE=InnoDB AUTO_INCREMENT=26291856 DEFAULT CHARSET=utf8; + KEY `index_kudos_on_pseud_id` (`pseud_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `languages` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -635,7 +635,7 @@ CREATE TABLE `languages` ( `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_languages_on_short` (`short`) -) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; CREATE TABLE `locales` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -645,11 +645,13 @@ CREATE TABLE `locales` ( `main` tinyint(1) DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `language_id` int(11) NOT NULL, + `interface_enabled` tinyint(1) NOT NULL DEFAULT '0', + `email_enabled` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `index_locales_on_iso` (`iso`), - KEY `index_locales_on_short` (`short`), - KEY `index_locales_on_language_id` (`language_id`) -) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=utf8; + KEY `index_locales_on_language_id` (`language_id`), + KEY `index_locales_on_short` (`short`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; CREATE TABLE `log_items` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -663,10 +665,10 @@ CREATE TABLE `log_items` ( `updated_at` datetime DEFAULT NULL, `note_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `index_log_items_on_user_id` (`user_id`), KEY `index_log_items_on_admin_id` (`admin_id`), - KEY `index_log_items_on_role_id` (`role_id`) -) ENGINE=InnoDB AUTO_INCREMENT=539553 DEFAULT CHARSET=utf8; + KEY `index_log_items_on_role_id` (`role_id`), + KEY `index_log_items_on_user_id` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `meta_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -678,7 +680,7 @@ CREATE TABLE `meta_taggings` ( PRIMARY KEY (`id`), KEY `index_meta_taggings_on_meta_tag_id` (`meta_tag_id`), KEY `index_meta_taggings_on_sub_tag_id` (`sub_tag_id`) -) ENGINE=InnoDB AUTO_INCREMENT=87824 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `open_id_authentication_associations` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -689,7 +691,7 @@ CREATE TABLE `open_id_authentication_associations` ( `server_url` blob, `secret` blob, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=232 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `open_id_authentication_nonces` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -697,7 +699,7 @@ CREATE TABLE `open_id_authentication_nonces` ( `server_url` varchar(255) DEFAULT NULL, `salt` varchar(255) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=3953 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `owned_set_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -707,7 +709,7 @@ CREATE TABLE `owned_set_taggings` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1605 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `owned_tag_sets` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -726,7 +728,7 @@ CREATE TABLE `owned_tag_sets` ( `freeform_nomination_limit` int(11) NOT NULL DEFAULT '0', `usable` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=333 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `potential_match_settings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -748,7 +750,7 @@ CREATE TABLE `potential_match_settings` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=387 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `potential_matches` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -763,7 +765,7 @@ CREATE TABLE `potential_matches` ( KEY `index_potential_matches_on_collection_id` (`collection_id`), KEY `index_potential_matches_on_offer_signup_id` (`offer_signup_id`), KEY `index_potential_matches_on_request_signup_id` (`request_signup_id`) -) ENGINE=InnoDB AUTO_INCREMENT=5623257 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `potential_prompt_matches` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -783,7 +785,7 @@ CREATE TABLE `potential_prompt_matches` ( KEY `index_potential_prompt_matches_on_potential_match_id` (`potential_match_id`), KEY `index_potential_prompt_matches_on_offer_id` (`offer_id`), KEY `index_potential_prompt_matches_on_request_id` (`request_id`) -) ENGINE=InnoDB AUTO_INCREMENT=6339834 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `preferences` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -819,9 +821,10 @@ CREATE TABLE `preferences` ( `kudos_emails_off` tinyint(1) NOT NULL DEFAULT '0', `disable_share_links` tinyint(1) NOT NULL DEFAULT '0', `banner_seen` tinyint(1) NOT NULL DEFAULT '0', + `preferred_locale` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `index_preferences_on_user_id` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=237581 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `profiles` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -835,7 +838,7 @@ CREATE TABLE `profiles` ( `about_me_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `index_profiles_on_user_id` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=237581 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `prompt_memes` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -860,7 +863,7 @@ CREATE TABLE `prompt_memes` ( `updated_at` datetime DEFAULT NULL, `anonymous` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=290 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `prompt_restrictions` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -907,7 +910,7 @@ CREATE TABLE `prompt_restrictions` ( `title_required` tinyint(1) NOT NULL DEFAULT '0', `title_allowed` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1133 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `prompts` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -933,12 +936,12 @@ CREATE TABLE `prompts` ( `any_freeform` tinyint(1) NOT NULL DEFAULT '0', `anonymous` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `index_prompts_on_tag_set_id` (`tag_set_id`), - KEY `index_prompts_on_type` (`type`), + KEY `index_prompts_on_challenge_signup_id` (`challenge_signup_id`), KEY `index_prompts_on_collection_id` (`collection_id`), KEY `index_prompts_on_optional_tag_set_id` (`optional_tag_set_id`), - KEY `index_prompts_on_challenge_signup_id` (`challenge_signup_id`) -) ENGINE=InnoDB AUTO_INCREMENT=109268 DEFAULT CHARSET=utf8; + KEY `index_prompts_on_tag_set_id` (`tag_set_id`), + KEY `index_prompts_on_type` (`type`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `pseuds` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -957,9 +960,9 @@ CREATE TABLE `pseuds` ( `description_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', `icon_comment_text` varchar(255) DEFAULT '', PRIMARY KEY (`id`), - KEY `index_pseuds_on_user_id_and_name` (`user_id`,`name`), - KEY `index_psueds_on_name` (`name`) -) ENGINE=InnoDB AUTO_INCREMENT=258650 DEFAULT CHARSET=utf8; + KEY `index_psueds_on_name` (`name`), + KEY `index_pseuds_on_user_id_and_name` (`user_id`,`name`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `question_translations` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -974,7 +977,7 @@ CREATE TABLE `question_translations` ( PRIMARY KEY (`id`), KEY `index_question_translations_on_question_id` (`question_id`), KEY `index_question_translations_on_locale` (`locale`) -) ENGINE=InnoDB AUTO_INCREMENT=1980 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `questions` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -988,7 +991,7 @@ CREATE TABLE `questions` ( `position` int(11) DEFAULT '1', PRIMARY KEY (`id`), KEY `index_questions_on_archive_faq_id_and_position` (`archive_faq_id`,`position`) -) ENGINE=InnoDB AUTO_INCREMENT=822 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `readings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1002,9 +1005,9 @@ CREATE TABLE `readings` ( `toread` tinyint(1) NOT NULL DEFAULT '0', `toskip` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `index_readings_on_work_id` (`work_id`), - KEY `index_readings_on_user_id` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=110872473 DEFAULT CHARSET=utf8; + KEY `index_readings_on_user_id` (`user_id`), + KEY `index_readings_on_work_id` (`work_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `related_works` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1018,7 +1021,7 @@ CREATE TABLE `related_works` ( PRIMARY KEY (`id`), KEY `index_related_works_on_parent_id_and_parent_type` (`parent_id`,`parent_type`), KEY `index_related_works_on_work_id` (`work_id`) -) ENGINE=InnoDB AUTO_INCREMENT=27542 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `roles` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1031,7 +1034,7 @@ CREATE TABLE `roles` ( KEY `index_roles_on_authorizable_id_and_authorizable_type` (`authorizable_id`,`authorizable_type`), KEY `index_roles_on_authorizable_type` (`authorizable_type`), KEY `index_roles_on_name` (`name`) -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `roles_users` ( `user_id` int(11) DEFAULT NULL, @@ -1040,22 +1043,12 @@ CREATE TABLE `roles_users` ( `updated_at` datetime DEFAULT NULL, KEY `index_roles_users_on_role_id_and_user_id` (`role_id`,`user_id`), KEY `index_roles_users_on_user_id_and_role_id` (`user_id`,`role_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `saved_works` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `work_id` int(11) NOT NULL, - `created_at` datetime NOT NULL, - `updated_at` datetime NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `index_saved_works_on_user_id_and_work_id` (`user_id`,`work_id`) -) ENGINE=InnoDB AUTO_INCREMENT=4208074 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `schema_migrations` ( `version` varchar(255) NOT NULL, UNIQUE KEY `unique_schema_migrations` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `searches` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1066,7 +1059,7 @@ CREATE TABLE `searches` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `serial_works` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1076,9 +1069,9 @@ CREATE TABLE `serial_works` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), - KEY `index_serial_works_on_work_id` (`work_id`), - KEY `index_serial_works_on_series_id` (`series_id`) -) ENGINE=InnoDB AUTO_INCREMENT=210162 DEFAULT CHARSET=utf8; + KEY `index_serial_works_on_series_id` (`series_id`), + KEY `index_serial_works_on_work_id` (`work_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `series` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1093,7 +1086,7 @@ CREATE TABLE `series` ( `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', `notes_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=63092 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `set_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1104,7 +1097,7 @@ CREATE TABLE `set_taggings` ( PRIMARY KEY (`id`), KEY `index_set_taggings_on_tag_id` (`tag_id`), KEY `index_set_taggings_on_tag_set_id` (`tag_set_id`) -) ENGINE=InnoDB AUTO_INCREMENT=632984 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `skin_parents` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1114,7 +1107,7 @@ CREATE TABLE `skin_parents` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=62481 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `skins` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1154,12 +1147,12 @@ CREATE TABLE `skins` ( `featured` tinyint(1) NOT NULL DEFAULT '0', `in_chooser` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `index_skins_on_type` (`type`), - KEY `index_skins_on_public_and_official` (`public`,`official`), KEY `index_skins_on_author_id` (`author_id`), KEY `index_skins_on_in_chooser` (`in_chooser`), - KEY `index_skins_on_title` (`title`) -) ENGINE=InnoDB AUTO_INCREMENT=9645 DEFAULT CHARSET=utf8; + KEY `index_skins_on_public_and_official` (`public`,`official`), + KEY `index_skins_on_title` (`title`), + KEY `index_skins_on_type` (`type`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `stat_counters` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1173,7 +1166,7 @@ CREATE TABLE `stat_counters` ( PRIMARY KEY (`id`), UNIQUE KEY `index_hit_counters_on_work_id` (`work_id`), KEY `index_hit_counters_on_hit_count` (`hit_count`) -) ENGINE=InnoDB AUTO_INCREMENT=1055874 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `subscriptions` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1183,9 +1176,9 @@ CREATE TABLE `subscriptions` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), - KEY `user_id` (`user_id`), - KEY `subscribable` (`subscribable_id`,`subscribable_type`) -) ENGINE=InnoDB AUTO_INCREMENT=306 DEFAULT CHARSET=utf8; + KEY `subscribable` (`subscribable_id`,`subscribable_type`), + KEY `user_id` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `tag_nominations` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1203,7 +1196,7 @@ CREATE TABLE `tag_nominations` ( `parented` tinyint(1) NOT NULL DEFAULT '0', `synonym` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=99677 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `tag_set_associations` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1213,7 +1206,7 @@ CREATE TABLE `tag_set_associations` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=35729 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `tag_set_nominations` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1222,7 +1215,7 @@ CREATE TABLE `tag_set_nominations` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=6467 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `tag_set_ownerships` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1232,14 +1225,14 @@ CREATE TABLE `tag_set_ownerships` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=599 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `tag_sets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=225206 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1252,7 +1245,7 @@ CREATE TABLE `taggings` ( PRIMARY KEY (`id`), UNIQUE KEY `index_taggings_polymorphic` (`tagger_id`,`tagger_type`,`taggable_id`,`taggable_type`), KEY `index_taggings_taggable` (`taggable_id`,`taggable_type`) -) ENGINE=InnoDB AUTO_INCREMENT=14004140 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `tags` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1271,13 +1264,13 @@ CREATE TABLE `tags` ( `sortable_name` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `index_tags_on_name` (`name`), - KEY `index_tags_on_merger_id` (`merger_id`), - KEY `index_tags_on_id_and_type` (`id`,`type`), KEY `index_tags_on_canonical` (`canonical`), KEY `tag_created_at_index` (`created_at`), - KEY `index_tags_on_type` (`type`), - KEY `index_tags_on_sortable_name` (`sortable_name`) -) ENGINE=InnoDB AUTO_INCREMENT=1214966 DEFAULT CHARSET=utf8; + KEY `index_tags_on_id_and_type` (`id`,`type`), + KEY `index_tags_on_merger_id` (`merger_id`), + KEY `index_tags_on_sortable_name` (`sortable_name`), + KEY `index_tags_on_type` (`type`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `user_invite_requests` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1290,7 +1283,7 @@ CREATE TABLE `user_invite_requests` ( `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_user_invite_requests_on_user_id` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=23225 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1314,7 +1307,7 @@ CREATE TABLE `users` ( UNIQUE KEY `index_users_on_login` (`login`), KEY `index_users_on_activation_code` (`activation_code`), KEY `index_users_on_email` (`email`) -) ENGINE=InnoDB AUTO_INCREMENT=237635 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `work_links` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1325,7 +1318,7 @@ CREATE TABLE `work_links` ( `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `work_links_work_id_url` (`work_id`,`url`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `works` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1363,15 +1356,15 @@ CREATE TABLE `works` ( `spam` tinyint(1) NOT NULL DEFAULT '0', `spam_checked_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), - KEY `index_works_on_language_id` (`language_id`), - KEY `index_works_on_imported_from_url` (`imported_from_url`), - KEY `index_works_on_revised_at` (`revised_at`), + KEY `complete_works` (`complete`,`posted`,`hidden_by_admin`), KEY `index_works_on_delta` (`delta`), + KEY `index_works_on_imported_from_url` (`imported_from_url`), + KEY `index_works_on_language_id` (`language_id`), KEY `visible_works` (`restricted`,`posted`,`hidden_by_admin`), - KEY `complete_works` (`complete`,`posted`,`hidden_by_admin`), + KEY `index_works_on_revised_at` (`revised_at`), KEY `index_works_on_ip_address` (`ip_address`), KEY `index_works_on_spam` (`spam`) -) ENGINE=InnoDB AUTO_INCREMENT=1060949 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `wrangling_assignments` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1380,7 +1373,7 @@ CREATE TABLE `wrangling_assignments` ( PRIMARY KEY (`id`), KEY `wrangling_assignments_by_fandom_id` (`fandom_id`), KEY `wrangling_assignments_by_user_id` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=29154 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `wrangling_guidelines` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1392,353 +1385,7 @@ CREATE TABLE `wrangling_guidelines` ( `position` int(11) DEFAULT NULL, `content_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; - -INSERT INTO schema_migrations (version) VALUES ('1'); - -INSERT INTO schema_migrations (version) VALUES ('20080726215505'); - -INSERT INTO schema_migrations (version) VALUES ('20080727030151'); - -INSERT INTO schema_migrations (version) VALUES ('20080803045759'); - -INSERT INTO schema_migrations (version) VALUES ('20080803124959'); - -INSERT INTO schema_migrations (version) VALUES ('20080803125332'); - -INSERT INTO schema_migrations (version) VALUES ('20080805021608'); - -INSERT INTO schema_migrations (version) VALUES ('20080901172442'); - -INSERT INTO schema_migrations (version) VALUES ('20080904135616'); - -INSERT INTO schema_migrations (version) VALUES ('20080906193922'); - -INSERT INTO schema_migrations (version) VALUES ('20080912233749'); - -INSERT INTO schema_migrations (version) VALUES ('20080914202646'); - -INSERT INTO schema_migrations (version) VALUES ('20080916213733'); - -INSERT INTO schema_migrations (version) VALUES ('20080920020544'); - -INSERT INTO schema_migrations (version) VALUES ('20080920052318'); - -INSERT INTO schema_migrations (version) VALUES ('20080922015228'); - -INSERT INTO schema_migrations (version) VALUES ('20080922060611'); - -INSERT INTO schema_migrations (version) VALUES ('20080927172047'); - -INSERT INTO schema_migrations (version) VALUES ('20080927172113'); - -INSERT INTO schema_migrations (version) VALUES ('20080927191115'); - -INSERT INTO schema_migrations (version) VALUES ('20080929233315'); - -INSERT INTO schema_migrations (version) VALUES ('20080930163408'); - -INSERT INTO schema_migrations (version) VALUES ('20081001035116'); - -INSERT INTO schema_migrations (version) VALUES ('20081001160257'); - -INSERT INTO schema_migrations (version) VALUES ('20081002011129'); - -INSERT INTO schema_migrations (version) VALUES ('20081002011130'); - -INSERT INTO schema_migrations (version) VALUES ('20081012185902'); - -INSERT INTO schema_migrations (version) VALUES ('20081014183856'); - -INSERT INTO schema_migrations (version) VALUES ('20081026180141'); - -INSERT INTO schema_migrations (version) VALUES ('20081102050355'); - -INSERT INTO schema_migrations (version) VALUES ('20081109004140'); - -INSERT INTO schema_migrations (version) VALUES ('20081114043420'); - -INSERT INTO schema_migrations (version) VALUES ('20081114164535'); - -INSERT INTO schema_migrations (version) VALUES ('20081115041645'); - -INSERT INTO schema_migrations (version) VALUES ('20081122025525'); - -INSERT INTO schema_migrations (version) VALUES ('20090127012544'); - -INSERT INTO schema_migrations (version) VALUES ('20090127045219'); - -INSERT INTO schema_migrations (version) VALUES ('20090214045954'); - -INSERT INTO schema_migrations (version) VALUES ('20090218223404'); - -INSERT INTO schema_migrations (version) VALUES ('20090307152243'); - -INSERT INTO schema_migrations (version) VALUES ('20090313212917'); - -INSERT INTO schema_migrations (version) VALUES ('20090315182538'); - -INSERT INTO schema_migrations (version) VALUES ('20090318004340'); - -INSERT INTO schema_migrations (version) VALUES ('20090322182529'); - -INSERT INTO schema_migrations (version) VALUES ('20090328235607'); - -INSERT INTO schema_migrations (version) VALUES ('20090329002541'); - -INSERT INTO schema_migrations (version) VALUES ('20090331012516'); - -INSERT INTO schema_migrations (version) VALUES ('20090331205830'); - -INSERT INTO schema_migrations (version) VALUES ('20090419175827'); - -INSERT INTO schema_migrations (version) VALUES ('20090419184639'); - -INSERT INTO schema_migrations (version) VALUES ('20090420003418'); - -INSERT INTO schema_migrations (version) VALUES ('20090420032457'); - -INSERT INTO schema_migrations (version) VALUES ('20090504020354'); - -INSERT INTO schema_migrations (version) VALUES ('20090524195217'); - -INSERT INTO schema_migrations (version) VALUES ('20090524201025'); - -INSERT INTO schema_migrations (version) VALUES ('20090604221238'); - -INSERT INTO schema_migrations (version) VALUES ('20090610010041'); - -INSERT INTO schema_migrations (version) VALUES ('20090613092005'); - -INSERT INTO schema_migrations (version) VALUES ('20090706214616'); - -INSERT INTO schema_migrations (version) VALUES ('20090723205349'); - -INSERT INTO schema_migrations (version) VALUES ('20090816092821'); - -INSERT INTO schema_migrations (version) VALUES ('20090816092952'); - -INSERT INTO schema_migrations (version) VALUES ('20090902191851'); - -INSERT INTO schema_migrations (version) VALUES ('20090907021029'); - -INSERT INTO schema_migrations (version) VALUES ('20090913221007'); - -INSERT INTO schema_migrations (version) VALUES ('20090913234257'); - -INSERT INTO schema_migrations (version) VALUES ('20090916140506'); - -INSERT INTO schema_migrations (version) VALUES ('20090917004451'); - -INSERT INTO schema_migrations (version) VALUES ('20090918112658'); - -INSERT INTO schema_migrations (version) VALUES ('20090918212755'); - -INSERT INTO schema_migrations (version) VALUES ('20090919125723'); - -INSERT INTO schema_migrations (version) VALUES ('20090919161520'); - -INSERT INTO schema_migrations (version) VALUES ('20090921210056'); - -INSERT INTO schema_migrations (version) VALUES ('20090930033753'); - -INSERT INTO schema_migrations (version) VALUES ('20091018155535'); - -INSERT INTO schema_migrations (version) VALUES ('20091018161438'); - -INSERT INTO schema_migrations (version) VALUES ('20091018174444'); - -INSERT INTO schema_migrations (version) VALUES ('20091019013949'); - -INSERT INTO schema_migrations (version) VALUES ('20091021225848'); - -INSERT INTO schema_migrations (version) VALUES ('20091029224425'); - -INSERT INTO schema_migrations (version) VALUES ('20091107214504'); - -INSERT INTO schema_migrations (version) VALUES ('20091121200119'); - -INSERT INTO schema_migrations (version) VALUES ('20091122210634'); - -INSERT INTO schema_migrations (version) VALUES ('20091205204625'); - -INSERT INTO schema_migrations (version) VALUES ('20091206140850'); - -INSERT INTO schema_migrations (version) VALUES ('20091206150153'); - -INSERT INTO schema_migrations (version) VALUES ('20091206172751'); - -INSERT INTO schema_migrations (version) VALUES ('20091206180109'); - -INSERT INTO schema_migrations (version) VALUES ('20091206180907'); - -INSERT INTO schema_migrations (version) VALUES ('20091207234702'); - -INSERT INTO schema_migrations (version) VALUES ('20091208200602'); - -INSERT INTO schema_migrations (version) VALUES ('20091209202619'); - -INSERT INTO schema_migrations (version) VALUES ('20091209215213'); - -INSERT INTO schema_migrations (version) VALUES ('20091212035917'); - -INSERT INTO schema_migrations (version) VALUES ('20091212051923'); - -INSERT INTO schema_migrations (version) VALUES ('20091213013846'); - -INSERT INTO schema_migrations (version) VALUES ('20091213035516'); - -INSERT INTO schema_migrations (version) VALUES ('20091216001101'); - -INSERT INTO schema_migrations (version) VALUES ('20091216150855'); - -INSERT INTO schema_migrations (version) VALUES ('20091217004235'); - -INSERT INTO schema_migrations (version) VALUES ('20091217005945'); - -INSERT INTO schema_migrations (version) VALUES ('20091217162252'); - -INSERT INTO schema_migrations (version) VALUES ('20091219192317'); - -INSERT INTO schema_migrations (version) VALUES ('20091220182557'); - -INSERT INTO schema_migrations (version) VALUES ('20091221011225'); - -INSERT INTO schema_migrations (version) VALUES ('20091221145401'); - -INSERT INTO schema_migrations (version) VALUES ('20091223002020'); - -INSERT INTO schema_migrations (version) VALUES ('20091223003205'); - -INSERT INTO schema_migrations (version) VALUES ('20091223180731'); - -INSERT INTO schema_migrations (version) VALUES ('20091227192528'); - -INSERT INTO schema_migrations (version) VALUES ('20091228042140'); - -INSERT INTO schema_migrations (version) VALUES ('20100104041510'); - -INSERT INTO schema_migrations (version) VALUES ('20100104144922'); - -INSERT INTO schema_migrations (version) VALUES ('20100104232731'); - -INSERT INTO schema_migrations (version) VALUES ('20100104232756'); - -INSERT INTO schema_migrations (version) VALUES ('20100105043033'); - -INSERT INTO schema_migrations (version) VALUES ('20100108002148'); - -INSERT INTO schema_migrations (version) VALUES ('20100112034428'); - -INSERT INTO schema_migrations (version) VALUES ('20100123004135'); - -INSERT INTO schema_migrations (version) VALUES ('20100202154135'); - -INSERT INTO schema_migrations (version) VALUES ('20100202154255'); - -INSERT INTO schema_migrations (version) VALUES ('20100210180708'); - -INSERT INTO schema_migrations (version) VALUES ('20100210214240'); - -INSERT INTO schema_migrations (version) VALUES ('20100220022635'); - -INSERT INTO schema_migrations (version) VALUES ('20100220031906'); - -INSERT INTO schema_migrations (version) VALUES ('20100220062829'); - -INSERT INTO schema_migrations (version) VALUES ('20100222011208'); - -INSERT INTO schema_migrations (version) VALUES ('20100222074558'); - -INSERT INTO schema_migrations (version) VALUES ('20100223204450'); - -INSERT INTO schema_migrations (version) VALUES ('20100223205231'); - -INSERT INTO schema_migrations (version) VALUES ('20100223212822'); - -INSERT INTO schema_migrations (version) VALUES ('20100225063636'); - -INSERT INTO schema_migrations (version) VALUES ('20100227013502'); - -INSERT INTO schema_migrations (version) VALUES ('20100301211829'); - -INSERT INTO schema_migrations (version) VALUES ('20100304193643'); - -INSERT INTO schema_migrations (version) VALUES ('20100307211947'); - -INSERT INTO schema_migrations (version) VALUES ('20100312165910'); - -INSERT INTO schema_migrations (version) VALUES ('20100313165910'); - -INSERT INTO schema_migrations (version) VALUES ('20100314021317'); - -INSERT INTO schema_migrations (version) VALUES ('20100314035644'); - -INSERT INTO schema_migrations (version) VALUES ('20100314044409'); - -INSERT INTO schema_migrations (version) VALUES ('20100320165910'); - -INSERT INTO schema_migrations (version) VALUES ('20100326170256'); - -INSERT INTO schema_migrations (version) VALUES ('20100326170652'); - -INSERT INTO schema_migrations (version) VALUES ('20100326170924'); - -INSERT INTO schema_migrations (version) VALUES ('20100326171229'); - -INSERT INTO schema_migrations (version) VALUES ('20100328215724'); - -INSERT INTO schema_migrations (version) VALUES ('20100402163915'); - -INSERT INTO schema_migrations (version) VALUES ('20100403191349'); - -INSERT INTO schema_migrations (version) VALUES ('20100404223432'); - -INSERT INTO schema_migrations (version) VALUES ('20100405191217'); - -INSERT INTO schema_migrations (version) VALUES ('20100407222411'); - -INSERT INTO schema_migrations (version) VALUES ('20100413231821'); - -INSERT INTO schema_migrations (version) VALUES ('20100414231821'); - -INSERT INTO schema_migrations (version) VALUES ('20100415231821'); - -INSERT INTO schema_migrations (version) VALUES ('20100416145044'); - -INSERT INTO schema_migrations (version) VALUES ('20100419131629'); - -INSERT INTO schema_migrations (version) VALUES ('20100420211328'); - -INSERT INTO schema_migrations (version) VALUES ('20100502024059'); - -INSERT INTO schema_migrations (version) VALUES ('20100506203017'); - -INSERT INTO schema_migrations (version) VALUES ('20100506231821'); - -INSERT INTO schema_migrations (version) VALUES ('20100530152111'); - -INSERT INTO schema_migrations (version) VALUES ('20100530161827'); - -INSERT INTO schema_migrations (version) VALUES ('20100618021343'); - -INSERT INTO schema_migrations (version) VALUES ('20100620185742'); - -INSERT INTO schema_migrations (version) VALUES ('20100727212342'); - -INSERT INTO schema_migrations (version) VALUES ('20100728220657'); - -INSERT INTO schema_migrations (version) VALUES ('20100804185744'); - -INSERT INTO schema_migrations (version) VALUES ('20100812175429'); - -INSERT INTO schema_migrations (version) VALUES ('20100821165448'); - -INSERT INTO schema_migrations (version) VALUES ('20100901154501'); - -INSERT INTO schema_migrations (version) VALUES ('20100901165448'); - -INSERT INTO schema_migrations (version) VALUES ('20100907015632'); +) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO schema_migrations (version) VALUES ('20100929044155'); @@ -1908,8 +1555,6 @@ INSERT INTO schema_migrations (version) VALUES ('20130707160714'); INSERT INTO schema_migrations (version) VALUES ('20130707160814'); -INSERT INTO schema_migrations (version) VALUES ('20140206031705'); - INSERT INTO schema_migrations (version) VALUES ('20140208200234'); INSERT INTO schema_migrations (version) VALUES ('20140326130206'); @@ -1926,6 +1571,12 @@ INSERT INTO schema_migrations (version) VALUES ('20140922025054'); INSERT INTO schema_migrations (version) VALUES ('20140924023950'); +INSERT INTO schema_migrations (version) VALUES ('20141003204623'); + +INSERT INTO schema_migrations (version) VALUES ('20141003205439'); + +INSERT INTO schema_migrations (version) VALUES ('20141004123421'); + INSERT INTO schema_migrations (version) VALUES ('20150106211421'); INSERT INTO schema_migrations (version) VALUES ('20150111203000'); From cbc201ee38e2ccb5b0d39a2762e9ea09fe46ecb3 Mon Sep 17 00:00:00 2001 From: james_ Date: Fri, 8 May 2015 17:07:06 +0000 Subject: [PATCH 25/30] Put the db files back --- db/schema.rb | 30 ++- db/structure.sql | 671 +++++++++++++++++++++++++++++++++++------------ 2 files changed, 528 insertions(+), 173 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 1f8d54e8de4..4d5af6a212e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -31,8 +31,8 @@ t.string "action" t.text "summary" t.integer "summary_sanitizer_version", :limit => 2, :default => 0, :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" end create_table "admin_banners", :force => true do |t| @@ -287,15 +287,15 @@ create_table "collection_profiles", :force => true do |t| t.integer "collection_id" - t.text "intro", :limit => 2147483647 - t.text "faq", :limit => 2147483647 - t.text "rules", :limit => 2147483647 + t.text "intro", :limit => 16777215 + t.text "faq", :limit => 16777215 + t.text "rules", :limit => 16777215 t.datetime "created_at" t.datetime "updated_at" t.text "gift_notification" - t.integer "intro_sanitizer_version", :limit => 2, :default => 0, :null => false - t.integer "faq_sanitizer_version", :limit => 2, :default => 0, :null => false - t.integer "rules_sanitizer_version", :limit => 2, :default => 0, :null => false + t.integer "intro_sanitizer_version", :limit => 2, :default => 0, :null => false + t.integer "faq_sanitizer_version", :limit => 2, :default => 0, :null => false + t.integer "rules_sanitizer_version", :limit => 2, :default => 0, :null => false t.text "assignment_notification" end @@ -608,9 +608,7 @@ t.string "name" t.boolean "main" t.datetime "updated_at" - t.integer "language_id", :null => false - t.boolean "interface_enabled", :default => false, :null => false - t.boolean "email_enabled", :default => false, :null => false + t.integer "language_id", :null => false end add_index "locales", ["iso"], :name => "index_locales_on_iso" @@ -770,7 +768,6 @@ t.boolean "kudos_emails_off", :default => false, :null => false t.boolean "disable_share_links", :default => false, :null => false t.boolean "banner_seen", :default => false, :null => false - t.integer "preferred_locale", :default => 1, :null => false end add_index "preferences", ["user_id"], :name => "index_preferences_on_user_id" @@ -983,6 +980,15 @@ add_index "roles_users", ["role_id", "user_id"], :name => "index_roles_users_on_role_id_and_user_id" add_index "roles_users", ["user_id", "role_id"], :name => "index_roles_users_on_user_id_and_role_id" + create_table "saved_works", :force => true do |t| + t.integer "user_id", :null => false + t.integer "work_id", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "saved_works", ["user_id", "work_id"], :name => "index_saved_works_on_user_id_and_work_id", :unique => true + create_table "searches", :force => true do |t| t.integer "user_id" t.string "name" diff --git a/db/structure.sql b/db/structure.sql index 16f4ee7b368..0478dae9987 100755 --- a/db/structure.sql +++ b/db/structure.sql @@ -9,7 +9,7 @@ CREATE TABLE `abuse_reports` ( `category` varchar(255) DEFAULT NULL, `comment_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=2222 DEFAULT CHARSET=utf8; CREATE TABLE `admin_activities` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -19,10 +19,10 @@ CREATE TABLE `admin_activities` ( `action` varchar(255) DEFAULT NULL, `summary` text, `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `created_at` datetime NOT NULL, - `updated_at` datetime NOT NULL, + `created_at` datetime DEFAULT NULL, + `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=844 DEFAULT CHARSET=utf8; CREATE TABLE `admin_banners` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -31,7 +31,7 @@ CREATE TABLE `admin_banners` ( `banner_type` varchar(255) DEFAULT NULL, `active` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8; CREATE TABLE `admin_post_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -41,7 +41,7 @@ CREATE TABLE `admin_post_taggings` ( `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_admin_post_taggings_on_admin_post_id` (`admin_post_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=957 DEFAULT CHARSET=utf8; CREATE TABLE `admin_post_tags` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -50,7 +50,7 @@ CREATE TABLE `admin_post_tags` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=114 DEFAULT CHARSET=utf8; CREATE TABLE `admin_posts` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -63,9 +63,9 @@ CREATE TABLE `admin_posts` ( `translated_post_id` int(11) DEFAULT NULL, `language_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `index_admin_posts_on_created_at` (`created_at`), - KEY `index_admin_posts_on_post_id` (`translated_post_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_admin_posts_on_post_id` (`translated_post_id`), + KEY `index_admin_posts_on_created_at` (`created_at`) +) ENGINE=InnoDB AUTO_INCREMENT=410 DEFAULT CHARSET=utf8; CREATE TABLE `admin_settings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -91,7 +91,7 @@ CREATE TABLE `admin_settings` ( `creation_requires_invite` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `index_admin_settings_on_last_updated_by` (`last_updated_by`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; CREATE TABLE `admins` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -103,7 +103,7 @@ CREATE TABLE `admins` ( `salt` varchar(255) DEFAULT NULL, `persistence_token` varchar(255) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=145 DEFAULT CHARSET=utf8; CREATE TABLE `api_keys` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -115,7 +115,7 @@ CREATE TABLE `api_keys` ( PRIMARY KEY (`id`), UNIQUE KEY `index_api_keys_on_name` (`name`), UNIQUE KEY `index_api_keys_on_access_token` (`access_token`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; CREATE TABLE `archive_faq_translations` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -127,7 +127,7 @@ CREATE TABLE `archive_faq_translations` ( PRIMARY KEY (`id`), KEY `index_archive_faq_translations_on_archive_faq_id` (`archive_faq_id`), KEY `index_archive_faq_translations_on_locale` (`locale`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=132 DEFAULT CHARSET=utf8; CREATE TABLE `archive_faqs` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -140,7 +140,7 @@ CREATE TABLE `archive_faqs` ( PRIMARY KEY (`id`), UNIQUE KEY `index_archive_faqs_on_slug` (`slug`), KEY `index_archive_faqs_on_position` (`position`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=utf8; CREATE TABLE `bookmarks` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -157,11 +157,11 @@ CREATE TABLE `bookmarks` ( `delta` tinyint(1) DEFAULT '1', `notes_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `index_bookmarkable_pseud` (`bookmarkable_id`,`bookmarkable_type`,`pseud_id`), - KEY `index_bookmarks_on_private_and_hidden_by_admin_and_created_at` (`private`,`hidden_by_admin`,`created_at`), + KEY `fk_bookmarks_user` (`user_id`), KEY `index_bookmarks_on_pseud_id` (`pseud_id`), - KEY `fk_bookmarks_user` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_bookmarkable_pseud` (`bookmarkable_id`,`bookmarkable_type`,`pseud_id`), + KEY `index_bookmarks_on_private_and_hidden_by_admin_and_created_at` (`private`,`hidden_by_admin`,`created_at`) +) ENGINE=InnoDB AUTO_INCREMENT=6784931 DEFAULT CHARSET=utf8; CREATE TABLE `challenge_assignments` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -179,14 +179,14 @@ CREATE TABLE `challenge_assignments` ( `pinch_request_signup_id` int(11) DEFAULT NULL, `covered_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), - KEY `index_challenge_assignments_on_collection_id` (`collection_id`), KEY `assignments_on_creation_id` (`creation_id`), KEY `assignments_on_creation_type` (`creation_type`), - KEY `assignments_on_defaulted_at` (`defaulted_at`), KEY `assignments_on_offer_signup_id` (`offer_signup_id`), + KEY `assignments_on_offer_sent_at` (`sent_at`), KEY `assignments_on_pinch_hitter_id` (`pinch_hitter_id`), - KEY `assignments_on_offer_sent_at` (`sent_at`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `assignments_on_defaulted_at` (`defaulted_at`), + KEY `index_challenge_assignments_on_collection_id` (`collection_id`) +) ENGINE=InnoDB AUTO_INCREMENT=104826 DEFAULT CHARSET=utf8; CREATE TABLE `challenge_claims` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -202,11 +202,11 @@ CREATE TABLE `challenge_claims` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), - KEY `index_challenge_claims_on_claiming_user_id` (`claiming_user_id`), - KEY `index_challenge_claims_on_collection_id` (`collection_id`), KEY `creations` (`creation_id`,`creation_type`), - KEY `index_challenge_claims_on_request_signup_id` (`request_signup_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_challenge_claims_on_claiming_user_id` (`claiming_user_id`), + KEY `index_challenge_claims_on_request_signup_id` (`request_signup_id`), + KEY `index_challenge_claims_on_collection_id` (`collection_id`) +) ENGINE=InnoDB AUTO_INCREMENT=795 DEFAULT CHARSET=utf8; CREATE TABLE `challenge_signups` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -217,9 +217,9 @@ CREATE TABLE `challenge_signups` ( `assigned_as_request` tinyint(1) DEFAULT '0', `assigned_as_offer` tinyint(1) DEFAULT '0', PRIMARY KEY (`id`), - KEY `index_challenge_signups_on_collection_id` (`collection_id`), - KEY `signups_on_pseud_id` (`pseud_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `signups_on_pseud_id` (`pseud_id`), + KEY `index_challenge_signups_on_collection_id` (`collection_id`) +) ENGINE=InnoDB AUTO_INCREMENT=14135 DEFAULT CHARSET=utf8; CREATE TABLE `chapters` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -241,9 +241,9 @@ CREATE TABLE `chapters` ( `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', `endnotes_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `index_chapters_on_work_id` (`work_id`), - KEY `works_chapter_index` (`work_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `works_chapter_index` (`work_id`), + KEY `index_chapters_on_work_id` (`work_id`) +) ENGINE=InnoDB AUTO_INCREMENT=2124653 DEFAULT CHARSET=utf8; CREATE TABLE `collection_items` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -258,11 +258,11 @@ CREATE TABLE `collection_items` ( `unrevealed` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `by collection and item` (`collection_id`,`item_id`,`item_type`), - KEY `collection_items_anonymous` (`anonymous`), KEY `index_collection_items_approval_status` (`collection_id`,`user_approval_status`,`collection_approval_status`), - KEY `collection_items_item_id` (`item_id`), - KEY `collection_items_unrevealed` (`unrevealed`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `collection_items_unrevealed` (`unrevealed`), + KEY `collection_items_anonymous` (`anonymous`), + KEY `collection_items_item_id` (`item_id`) +) ENGINE=InnoDB AUTO_INCREMENT=181250 DEFAULT CHARSET=utf8; CREATE TABLE `collection_participants` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -275,7 +275,7 @@ CREATE TABLE `collection_participants` ( UNIQUE KEY `by collection and pseud` (`collection_id`,`pseud_id`), KEY `participants_by_collection_and_role` (`collection_id`,`participant_role`), KEY `participants_pseud_id` (`pseud_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=11976 DEFAULT CHARSET=utf8; CREATE TABLE `collection_preferences` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -292,14 +292,14 @@ CREATE TABLE `collection_preferences` ( `email_notify` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `index_collection_preferences_on_collection_id` (`collection_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=6075 DEFAULT CHARSET=utf8; CREATE TABLE `collection_profiles` ( `id` int(11) NOT NULL AUTO_INCREMENT, `collection_id` int(11) DEFAULT NULL, - `intro` longtext, - `faq` longtext, - `rules` longtext, + `intro` mediumtext, + `faq` mediumtext, + `rules` mediumtext, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `gift_notification` text, @@ -309,7 +309,7 @@ CREATE TABLE `collection_profiles` ( `assignment_notification` text, PRIMARY KEY (`id`), KEY `index_collection_profiles_on_collection_id` (`collection_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=6075 DEFAULT CHARSET=utf8; CREATE TABLE `collections` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -333,7 +333,7 @@ CREATE TABLE `collections` ( PRIMARY KEY (`id`), KEY `index_collections_on_name` (`name`), KEY `index_collections_on_parent_id` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=6078 DEFAULT CHARSET=utf8; CREATE TABLE `comments` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -360,10 +360,10 @@ CREATE TABLE `comments` ( `content_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `index_comments_commentable` (`commentable_id`,`commentable_type`), - KEY `index_comments_parent` (`parent_id`,`parent_type`), KEY `index_comments_on_pseud_id` (`pseud_id`), + KEY `index_comments_parent` (`parent_id`,`parent_type`), KEY `comments_by_thread` (`thread`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=5203688 DEFAULT CHARSET=utf8; CREATE TABLE `common_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -375,7 +375,7 @@ CREATE TABLE `common_taggings` ( PRIMARY KEY (`id`), UNIQUE KEY `index_common_tags` (`common_tag_id`,`filterable_type`,`filterable_id`), KEY `index_common_taggings_on_filterable_id` (`filterable_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=2655022 DEFAULT CHARSET=utf8; CREATE TABLE `creatorships` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -387,7 +387,7 @@ CREATE TABLE `creatorships` ( PRIMARY KEY (`id`), UNIQUE KEY `creation_id_creation_type_pseud_id` (`creation_id`,`creation_type`,`pseud_id`), KEY `index_creatorships_pseud` (`pseud_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=3395285 DEFAULT CHARSET=utf8; CREATE TABLE `delayed_jobs` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -402,11 +402,11 @@ CREATE TABLE `delayed_jobs` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), - KEY `delayed_jobs_failed_at` (`failed_at`), + KEY `delayed_jobs_run_at` (`run_at`), KEY `delayed_jobs_locked_at` (`locked_at`), KEY `delayed_jobs_locked_by` (`locked_by`), - KEY `delayed_jobs_run_at` (`run_at`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `delayed_jobs_failed_at` (`failed_at`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `external_author_names` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -416,7 +416,7 @@ CREATE TABLE `external_author_names` ( `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_external_author_names_on_external_author_id` (`external_author_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=4199 DEFAULT CHARSET=utf8; CREATE TABLE `external_authors` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -428,9 +428,9 @@ CREATE TABLE `external_authors` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), - KEY `index_external_authors_on_email` (`email`), - KEY `index_external_authors_on_user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_external_authors_on_user_id` (`user_id`), + KEY `index_external_authors_on_email` (`email`) +) ENGINE=InnoDB AUTO_INCREMENT=1910 DEFAULT CHARSET=utf8; CREATE TABLE `external_creatorships` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -441,10 +441,10 @@ CREATE TABLE `external_creatorships` ( `archivist_id` int(11) DEFAULT NULL, `external_author_name_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `index_external_creatorships_on_archivist_id` (`archivist_id`), KEY `index_external_creatorships_on_creation_id_and_creation_type` (`creation_id`,`creation_type`), - KEY `index_external_creatorships_on_external_author_name_id` (`external_author_name_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_external_creatorships_on_external_author_name_id` (`external_author_name_id`), + KEY `index_external_creatorships_on_archivist_id` (`archivist_id`) +) ENGINE=InnoDB AUTO_INCREMENT=12402 DEFAULT CHARSET=utf8; CREATE TABLE `external_works` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -459,7 +459,7 @@ CREATE TABLE `external_works` ( `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', `language_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=31332 DEFAULT CHARSET=utf8; CREATE TABLE `favorite_tags` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -467,7 +467,7 @@ CREATE TABLE `favorite_tags` ( `tag_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `index_favorite_tags_on_user_id_and_tag_id` (`user_id`,`tag_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=588 DEFAULT CHARSET=utf8; CREATE TABLE `feedbacks` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -483,7 +483,7 @@ CREATE TABLE `feedbacks` ( `approved` tinyint(1) NOT NULL DEFAULT '0', `ip_address` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=14688 DEFAULT CHARSET=utf8; CREATE TABLE `filter_counts` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -494,9 +494,9 @@ CREATE TABLE `filter_counts` ( `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `index_filter_counts_on_filter_id` (`filter_id`), - KEY `index_public_works_count` (`public_works_count`), - KEY `index_unhidden_works_count` (`unhidden_works_count`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_unhidden_works_count` (`unhidden_works_count`), + KEY `index_public_works_count` (`public_works_count`) +) ENGINE=InnoDB AUTO_INCREMENT=244850 DEFAULT CHARSET=utf8; CREATE TABLE `filter_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -507,9 +507,9 @@ CREATE TABLE `filter_taggings` ( `updated_at` datetime DEFAULT NULL, `inherited` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `index_filter_taggings_on_filter_id_and_filterable_type` (`filter_id`,`filterable_type`), - KEY `index_filter_taggings_filterable` (`filterable_id`,`filterable_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_filter_taggings_filterable` (`filterable_id`,`filterable_type`), + KEY `index_filter_taggings_on_filter_id_and_filterable_type` (`filter_id`,`filterable_type`) +) ENGINE=InnoDB AUTO_INCREMENT=19391996 DEFAULT CHARSET=utf8; CREATE TABLE `gift_exchanges` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -543,7 +543,7 @@ CREATE TABLE `gift_exchanges` ( `signup_instructions_offers_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', `requests_summary_visible` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=390 DEFAULT CHARSET=utf8; CREATE TABLE `gifts` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -553,10 +553,10 @@ CREATE TABLE `gifts` ( `updated_at` datetime DEFAULT NULL, `pseud_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `index_gifts_on_pseud_id` (`pseud_id`), KEY `index_gifts_on_recipient_name` (`recipient_name`), - KEY `index_gifts_on_work_id` (`work_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_gifts_on_work_id` (`work_id`), + KEY `index_gifts_on_pseud_id` (`pseud_id`) +) ENGINE=InnoDB AUTO_INCREMENT=102594 DEFAULT CHARSET=utf8; CREATE TABLE `inbox_comments` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -567,10 +567,10 @@ CREATE TABLE `inbox_comments` ( `read` tinyint(1) NOT NULL DEFAULT '0', `replied_to` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `index_inbox_comments_on_feedback_comment_id` (`feedback_comment_id`), KEY `index_inbox_comments_on_read_and_user_id` (`read`,`user_id`), + KEY `index_inbox_comments_on_feedback_comment_id` (`feedback_comment_id`), KEY `index_inbox_comments_on_user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=4752479 DEFAULT CHARSET=utf8; CREATE TABLE `invitations` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -588,11 +588,11 @@ CREATE TABLE `invitations` ( `from_queue` tinyint(1) NOT NULL DEFAULT '0', `external_author_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `index_invitations_on_creator_id_and_creator_type` (`creator_id`,`creator_type`), - KEY `index_invitations_on_external_author_id` (`external_author_id`), KEY `index_invitations_on_invitee_id_and_invitee_type` (`invitee_id`,`invitee_type`), + KEY `index_invitations_on_external_author_id` (`external_author_id`), + KEY `index_invitations_on_creator_id_and_creator_type` (`creator_id`,`creator_type`), KEY `index_invitations_on_token` (`token`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=355011 DEFAULT CHARSET=utf8; CREATE TABLE `invite_requests` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -602,7 +602,7 @@ CREATE TABLE `invite_requests` ( `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_invite_requests_on_email` (`email`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=298136 DEFAULT CHARSET=utf8; CREATE TABLE `known_issues` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -613,7 +613,7 @@ CREATE TABLE `known_issues` ( `created_at` datetime DEFAULT NULL, `content_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; CREATE TABLE `kudos` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -624,10 +624,10 @@ CREATE TABLE `kudos` ( `updated_at` datetime DEFAULT NULL, `ip_address` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `index_kudos_on_commentable_id_and_commentable_type_and_pseud_id` (`commentable_id`,`commentable_type`,`pseud_id`), + KEY `index_kudos_on_pseud_id` (`pseud_id`), KEY `index_kudos_on_ip_address` (`ip_address`), - KEY `index_kudos_on_pseud_id` (`pseud_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_kudos_on_commentable_id_and_commentable_type_and_pseud_id` (`commentable_id`,`commentable_type`,`pseud_id`) +) ENGINE=InnoDB AUTO_INCREMENT=26291856 DEFAULT CHARSET=utf8; CREATE TABLE `languages` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -635,7 +635,7 @@ CREATE TABLE `languages` ( `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_languages_on_short` (`short`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8; CREATE TABLE `locales` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -645,13 +645,11 @@ CREATE TABLE `locales` ( `main` tinyint(1) DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `language_id` int(11) NOT NULL, - `interface_enabled` tinyint(1) NOT NULL DEFAULT '0', - `email_enabled` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `index_locales_on_iso` (`iso`), - KEY `index_locales_on_language_id` (`language_id`), - KEY `index_locales_on_short` (`short`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + KEY `index_locales_on_short` (`short`), + KEY `index_locales_on_language_id` (`language_id`) +) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=utf8; CREATE TABLE `log_items` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -665,10 +663,10 @@ CREATE TABLE `log_items` ( `updated_at` datetime DEFAULT NULL, `note_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), + KEY `index_log_items_on_user_id` (`user_id`), KEY `index_log_items_on_admin_id` (`admin_id`), - KEY `index_log_items_on_role_id` (`role_id`), - KEY `index_log_items_on_user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_log_items_on_role_id` (`role_id`) +) ENGINE=InnoDB AUTO_INCREMENT=539553 DEFAULT CHARSET=utf8; CREATE TABLE `meta_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -680,7 +678,7 @@ CREATE TABLE `meta_taggings` ( PRIMARY KEY (`id`), KEY `index_meta_taggings_on_meta_tag_id` (`meta_tag_id`), KEY `index_meta_taggings_on_sub_tag_id` (`sub_tag_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=87824 DEFAULT CHARSET=utf8; CREATE TABLE `open_id_authentication_associations` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -691,7 +689,7 @@ CREATE TABLE `open_id_authentication_associations` ( `server_url` blob, `secret` blob, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=232 DEFAULT CHARSET=utf8; CREATE TABLE `open_id_authentication_nonces` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -699,7 +697,7 @@ CREATE TABLE `open_id_authentication_nonces` ( `server_url` varchar(255) DEFAULT NULL, `salt` varchar(255) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=3953 DEFAULT CHARSET=utf8; CREATE TABLE `owned_set_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -709,7 +707,7 @@ CREATE TABLE `owned_set_taggings` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=1605 DEFAULT CHARSET=utf8; CREATE TABLE `owned_tag_sets` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -728,7 +726,7 @@ CREATE TABLE `owned_tag_sets` ( `freeform_nomination_limit` int(11) NOT NULL DEFAULT '0', `usable` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=333 DEFAULT CHARSET=utf8; CREATE TABLE `potential_match_settings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -750,7 +748,7 @@ CREATE TABLE `potential_match_settings` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=387 DEFAULT CHARSET=utf8; CREATE TABLE `potential_matches` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -765,7 +763,7 @@ CREATE TABLE `potential_matches` ( KEY `index_potential_matches_on_collection_id` (`collection_id`), KEY `index_potential_matches_on_offer_signup_id` (`offer_signup_id`), KEY `index_potential_matches_on_request_signup_id` (`request_signup_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=5623257 DEFAULT CHARSET=utf8; CREATE TABLE `potential_prompt_matches` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -785,7 +783,7 @@ CREATE TABLE `potential_prompt_matches` ( KEY `index_potential_prompt_matches_on_potential_match_id` (`potential_match_id`), KEY `index_potential_prompt_matches_on_offer_id` (`offer_id`), KEY `index_potential_prompt_matches_on_request_id` (`request_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=6339834 DEFAULT CHARSET=utf8; CREATE TABLE `preferences` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -821,10 +819,9 @@ CREATE TABLE `preferences` ( `kudos_emails_off` tinyint(1) NOT NULL DEFAULT '0', `disable_share_links` tinyint(1) NOT NULL DEFAULT '0', `banner_seen` tinyint(1) NOT NULL DEFAULT '0', - `preferred_locale` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `index_preferences_on_user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=237581 DEFAULT CHARSET=utf8; CREATE TABLE `profiles` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -838,7 +835,7 @@ CREATE TABLE `profiles` ( `about_me_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `index_profiles_on_user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=237581 DEFAULT CHARSET=utf8; CREATE TABLE `prompt_memes` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -863,7 +860,7 @@ CREATE TABLE `prompt_memes` ( `updated_at` datetime DEFAULT NULL, `anonymous` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=290 DEFAULT CHARSET=utf8; CREATE TABLE `prompt_restrictions` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -910,7 +907,7 @@ CREATE TABLE `prompt_restrictions` ( `title_required` tinyint(1) NOT NULL DEFAULT '0', `title_allowed` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=1133 DEFAULT CHARSET=utf8; CREATE TABLE `prompts` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -936,12 +933,12 @@ CREATE TABLE `prompts` ( `any_freeform` tinyint(1) NOT NULL DEFAULT '0', `anonymous` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `index_prompts_on_challenge_signup_id` (`challenge_signup_id`), + KEY `index_prompts_on_tag_set_id` (`tag_set_id`), + KEY `index_prompts_on_type` (`type`), KEY `index_prompts_on_collection_id` (`collection_id`), KEY `index_prompts_on_optional_tag_set_id` (`optional_tag_set_id`), - KEY `index_prompts_on_tag_set_id` (`tag_set_id`), - KEY `index_prompts_on_type` (`type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_prompts_on_challenge_signup_id` (`challenge_signup_id`) +) ENGINE=InnoDB AUTO_INCREMENT=109268 DEFAULT CHARSET=utf8; CREATE TABLE `pseuds` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -960,9 +957,9 @@ CREATE TABLE `pseuds` ( `description_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', `icon_comment_text` varchar(255) DEFAULT '', PRIMARY KEY (`id`), - KEY `index_psueds_on_name` (`name`), - KEY `index_pseuds_on_user_id_and_name` (`user_id`,`name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_pseuds_on_user_id_and_name` (`user_id`,`name`), + KEY `index_psueds_on_name` (`name`) +) ENGINE=InnoDB AUTO_INCREMENT=258650 DEFAULT CHARSET=utf8; CREATE TABLE `question_translations` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -977,7 +974,7 @@ CREATE TABLE `question_translations` ( PRIMARY KEY (`id`), KEY `index_question_translations_on_question_id` (`question_id`), KEY `index_question_translations_on_locale` (`locale`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=1980 DEFAULT CHARSET=utf8; CREATE TABLE `questions` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -991,7 +988,7 @@ CREATE TABLE `questions` ( `position` int(11) DEFAULT '1', PRIMARY KEY (`id`), KEY `index_questions_on_archive_faq_id_and_position` (`archive_faq_id`,`position`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=822 DEFAULT CHARSET=utf8; CREATE TABLE `readings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1005,9 +1002,9 @@ CREATE TABLE `readings` ( `toread` tinyint(1) NOT NULL DEFAULT '0', `toskip` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `index_readings_on_user_id` (`user_id`), - KEY `index_readings_on_work_id` (`work_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_readings_on_work_id` (`work_id`), + KEY `index_readings_on_user_id` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=110872473 DEFAULT CHARSET=utf8; CREATE TABLE `related_works` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1021,7 +1018,7 @@ CREATE TABLE `related_works` ( PRIMARY KEY (`id`), KEY `index_related_works_on_parent_id_and_parent_type` (`parent_id`,`parent_type`), KEY `index_related_works_on_work_id` (`work_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=27542 DEFAULT CHARSET=utf8; CREATE TABLE `roles` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1034,7 +1031,7 @@ CREATE TABLE `roles` ( KEY `index_roles_on_authorizable_id_and_authorizable_type` (`authorizable_id`,`authorizable_type`), KEY `index_roles_on_authorizable_type` (`authorizable_type`), KEY `index_roles_on_name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; CREATE TABLE `roles_users` ( `user_id` int(11) DEFAULT NULL, @@ -1043,12 +1040,22 @@ CREATE TABLE `roles_users` ( `updated_at` datetime DEFAULT NULL, KEY `index_roles_users_on_role_id_and_user_id` (`role_id`,`user_id`), KEY `index_roles_users_on_user_id_and_role_id` (`user_id`,`role_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `saved_works` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `work_id` int(11) NOT NULL, + `created_at` datetime NOT NULL, + `updated_at` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `index_saved_works_on_user_id_and_work_id` (`user_id`,`work_id`) +) ENGINE=InnoDB AUTO_INCREMENT=4208074 DEFAULT CHARSET=utf8; CREATE TABLE `schema_migrations` ( `version` varchar(255) NOT NULL, UNIQUE KEY `unique_schema_migrations` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `searches` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1059,7 +1066,7 @@ CREATE TABLE `searches` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `serial_works` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1069,9 +1076,9 @@ CREATE TABLE `serial_works` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), - KEY `index_serial_works_on_series_id` (`series_id`), - KEY `index_serial_works_on_work_id` (`work_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_serial_works_on_work_id` (`work_id`), + KEY `index_serial_works_on_series_id` (`series_id`) +) ENGINE=InnoDB AUTO_INCREMENT=210162 DEFAULT CHARSET=utf8; CREATE TABLE `series` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1086,7 +1093,7 @@ CREATE TABLE `series` ( `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', `notes_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=63092 DEFAULT CHARSET=utf8; CREATE TABLE `set_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1097,7 +1104,7 @@ CREATE TABLE `set_taggings` ( PRIMARY KEY (`id`), KEY `index_set_taggings_on_tag_id` (`tag_id`), KEY `index_set_taggings_on_tag_set_id` (`tag_set_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=632984 DEFAULT CHARSET=utf8; CREATE TABLE `skin_parents` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1107,7 +1114,7 @@ CREATE TABLE `skin_parents` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=62481 DEFAULT CHARSET=utf8; CREATE TABLE `skins` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1147,12 +1154,12 @@ CREATE TABLE `skins` ( `featured` tinyint(1) NOT NULL DEFAULT '0', `in_chooser` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), + KEY `index_skins_on_type` (`type`), + KEY `index_skins_on_public_and_official` (`public`,`official`), KEY `index_skins_on_author_id` (`author_id`), KEY `index_skins_on_in_chooser` (`in_chooser`), - KEY `index_skins_on_public_and_official` (`public`,`official`), - KEY `index_skins_on_title` (`title`), - KEY `index_skins_on_type` (`type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_skins_on_title` (`title`) +) ENGINE=InnoDB AUTO_INCREMENT=9645 DEFAULT CHARSET=utf8; CREATE TABLE `stat_counters` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1166,7 +1173,7 @@ CREATE TABLE `stat_counters` ( PRIMARY KEY (`id`), UNIQUE KEY `index_hit_counters_on_work_id` (`work_id`), KEY `index_hit_counters_on_hit_count` (`hit_count`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=1055874 DEFAULT CHARSET=utf8; CREATE TABLE `subscriptions` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1176,9 +1183,9 @@ CREATE TABLE `subscriptions` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), - KEY `subscribable` (`subscribable_id`,`subscribable_type`), - KEY `user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `user_id` (`user_id`), + KEY `subscribable` (`subscribable_id`,`subscribable_type`) +) ENGINE=InnoDB AUTO_INCREMENT=306 DEFAULT CHARSET=utf8; CREATE TABLE `tag_nominations` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1196,7 +1203,7 @@ CREATE TABLE `tag_nominations` ( `parented` tinyint(1) NOT NULL DEFAULT '0', `synonym` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=99677 DEFAULT CHARSET=utf8; CREATE TABLE `tag_set_associations` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1206,7 +1213,7 @@ CREATE TABLE `tag_set_associations` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=35729 DEFAULT CHARSET=utf8; CREATE TABLE `tag_set_nominations` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1215,7 +1222,7 @@ CREATE TABLE `tag_set_nominations` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=6467 DEFAULT CHARSET=utf8; CREATE TABLE `tag_set_ownerships` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1225,14 +1232,14 @@ CREATE TABLE `tag_set_ownerships` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=599 DEFAULT CHARSET=utf8; CREATE TABLE `tag_sets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=225206 DEFAULT CHARSET=utf8; CREATE TABLE `taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1245,7 +1252,7 @@ CREATE TABLE `taggings` ( PRIMARY KEY (`id`), UNIQUE KEY `index_taggings_polymorphic` (`tagger_id`,`tagger_type`,`taggable_id`,`taggable_type`), KEY `index_taggings_taggable` (`taggable_id`,`taggable_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=14004140 DEFAULT CHARSET=utf8; CREATE TABLE `tags` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1264,13 +1271,13 @@ CREATE TABLE `tags` ( `sortable_name` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `index_tags_on_name` (`name`), + KEY `index_tags_on_merger_id` (`merger_id`), + KEY `index_tags_on_id_and_type` (`id`,`type`), KEY `index_tags_on_canonical` (`canonical`), KEY `tag_created_at_index` (`created_at`), - KEY `index_tags_on_id_and_type` (`id`,`type`), - KEY `index_tags_on_merger_id` (`merger_id`), - KEY `index_tags_on_sortable_name` (`sortable_name`), - KEY `index_tags_on_type` (`type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `index_tags_on_type` (`type`), + KEY `index_tags_on_sortable_name` (`sortable_name`) +) ENGINE=InnoDB AUTO_INCREMENT=1214966 DEFAULT CHARSET=utf8; CREATE TABLE `user_invite_requests` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1283,7 +1290,7 @@ CREATE TABLE `user_invite_requests` ( `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_user_invite_requests_on_user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=23225 DEFAULT CHARSET=utf8; CREATE TABLE `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1307,7 +1314,7 @@ CREATE TABLE `users` ( UNIQUE KEY `index_users_on_login` (`login`), KEY `index_users_on_activation_code` (`activation_code`), KEY `index_users_on_email` (`email`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=237635 DEFAULT CHARSET=utf8; CREATE TABLE `work_links` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1318,7 +1325,7 @@ CREATE TABLE `work_links` ( `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `work_links_work_id_url` (`work_id`,`url`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `works` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1356,15 +1363,15 @@ CREATE TABLE `works` ( `spam` tinyint(1) NOT NULL DEFAULT '0', `spam_checked_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), - KEY `complete_works` (`complete`,`posted`,`hidden_by_admin`), - KEY `index_works_on_delta` (`delta`), - KEY `index_works_on_imported_from_url` (`imported_from_url`), KEY `index_works_on_language_id` (`language_id`), - KEY `visible_works` (`restricted`,`posted`,`hidden_by_admin`), + KEY `index_works_on_imported_from_url` (`imported_from_url`), KEY `index_works_on_revised_at` (`revised_at`), + KEY `index_works_on_delta` (`delta`), + KEY `visible_works` (`restricted`,`posted`,`hidden_by_admin`), + KEY `complete_works` (`complete`,`posted`,`hidden_by_admin`), KEY `index_works_on_ip_address` (`ip_address`), KEY `index_works_on_spam` (`spam`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=1060949 DEFAULT CHARSET=utf8; CREATE TABLE `wrangling_assignments` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1373,7 +1380,7 @@ CREATE TABLE `wrangling_assignments` ( PRIMARY KEY (`id`), KEY `wrangling_assignments_by_fandom_id` (`fandom_id`), KEY `wrangling_assignments_by_user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=29154 DEFAULT CHARSET=utf8; CREATE TABLE `wrangling_guidelines` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1385,7 +1392,353 @@ CREATE TABLE `wrangling_guidelines` ( `position` int(11) DEFAULT NULL, `content_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; + +INSERT INTO schema_migrations (version) VALUES ('1'); + +INSERT INTO schema_migrations (version) VALUES ('20080726215505'); + +INSERT INTO schema_migrations (version) VALUES ('20080727030151'); + +INSERT INTO schema_migrations (version) VALUES ('20080803045759'); + +INSERT INTO schema_migrations (version) VALUES ('20080803124959'); + +INSERT INTO schema_migrations (version) VALUES ('20080803125332'); + +INSERT INTO schema_migrations (version) VALUES ('20080805021608'); + +INSERT INTO schema_migrations (version) VALUES ('20080901172442'); + +INSERT INTO schema_migrations (version) VALUES ('20080904135616'); + +INSERT INTO schema_migrations (version) VALUES ('20080906193922'); + +INSERT INTO schema_migrations (version) VALUES ('20080912233749'); + +INSERT INTO schema_migrations (version) VALUES ('20080914202646'); + +INSERT INTO schema_migrations (version) VALUES ('20080916213733'); + +INSERT INTO schema_migrations (version) VALUES ('20080920020544'); + +INSERT INTO schema_migrations (version) VALUES ('20080920052318'); + +INSERT INTO schema_migrations (version) VALUES ('20080922015228'); + +INSERT INTO schema_migrations (version) VALUES ('20080922060611'); + +INSERT INTO schema_migrations (version) VALUES ('20080927172047'); + +INSERT INTO schema_migrations (version) VALUES ('20080927172113'); + +INSERT INTO schema_migrations (version) VALUES ('20080927191115'); + +INSERT INTO schema_migrations (version) VALUES ('20080929233315'); + +INSERT INTO schema_migrations (version) VALUES ('20080930163408'); + +INSERT INTO schema_migrations (version) VALUES ('20081001035116'); + +INSERT INTO schema_migrations (version) VALUES ('20081001160257'); + +INSERT INTO schema_migrations (version) VALUES ('20081002011129'); + +INSERT INTO schema_migrations (version) VALUES ('20081002011130'); + +INSERT INTO schema_migrations (version) VALUES ('20081012185902'); + +INSERT INTO schema_migrations (version) VALUES ('20081014183856'); + +INSERT INTO schema_migrations (version) VALUES ('20081026180141'); + +INSERT INTO schema_migrations (version) VALUES ('20081102050355'); + +INSERT INTO schema_migrations (version) VALUES ('20081109004140'); + +INSERT INTO schema_migrations (version) VALUES ('20081114043420'); + +INSERT INTO schema_migrations (version) VALUES ('20081114164535'); + +INSERT INTO schema_migrations (version) VALUES ('20081115041645'); + +INSERT INTO schema_migrations (version) VALUES ('20081122025525'); + +INSERT INTO schema_migrations (version) VALUES ('20090127012544'); + +INSERT INTO schema_migrations (version) VALUES ('20090127045219'); + +INSERT INTO schema_migrations (version) VALUES ('20090214045954'); + +INSERT INTO schema_migrations (version) VALUES ('20090218223404'); + +INSERT INTO schema_migrations (version) VALUES ('20090307152243'); + +INSERT INTO schema_migrations (version) VALUES ('20090313212917'); + +INSERT INTO schema_migrations (version) VALUES ('20090315182538'); + +INSERT INTO schema_migrations (version) VALUES ('20090318004340'); + +INSERT INTO schema_migrations (version) VALUES ('20090322182529'); + +INSERT INTO schema_migrations (version) VALUES ('20090328235607'); + +INSERT INTO schema_migrations (version) VALUES ('20090329002541'); + +INSERT INTO schema_migrations (version) VALUES ('20090331012516'); + +INSERT INTO schema_migrations (version) VALUES ('20090331205830'); + +INSERT INTO schema_migrations (version) VALUES ('20090419175827'); + +INSERT INTO schema_migrations (version) VALUES ('20090419184639'); + +INSERT INTO schema_migrations (version) VALUES ('20090420003418'); + +INSERT INTO schema_migrations (version) VALUES ('20090420032457'); + +INSERT INTO schema_migrations (version) VALUES ('20090504020354'); + +INSERT INTO schema_migrations (version) VALUES ('20090524195217'); + +INSERT INTO schema_migrations (version) VALUES ('20090524201025'); + +INSERT INTO schema_migrations (version) VALUES ('20090604221238'); + +INSERT INTO schema_migrations (version) VALUES ('20090610010041'); + +INSERT INTO schema_migrations (version) VALUES ('20090613092005'); + +INSERT INTO schema_migrations (version) VALUES ('20090706214616'); + +INSERT INTO schema_migrations (version) VALUES ('20090723205349'); + +INSERT INTO schema_migrations (version) VALUES ('20090816092821'); + +INSERT INTO schema_migrations (version) VALUES ('20090816092952'); + +INSERT INTO schema_migrations (version) VALUES ('20090902191851'); + +INSERT INTO schema_migrations (version) VALUES ('20090907021029'); + +INSERT INTO schema_migrations (version) VALUES ('20090913221007'); + +INSERT INTO schema_migrations (version) VALUES ('20090913234257'); + +INSERT INTO schema_migrations (version) VALUES ('20090916140506'); + +INSERT INTO schema_migrations (version) VALUES ('20090917004451'); + +INSERT INTO schema_migrations (version) VALUES ('20090918112658'); + +INSERT INTO schema_migrations (version) VALUES ('20090918212755'); + +INSERT INTO schema_migrations (version) VALUES ('20090919125723'); + +INSERT INTO schema_migrations (version) VALUES ('20090919161520'); + +INSERT INTO schema_migrations (version) VALUES ('20090921210056'); + +INSERT INTO schema_migrations (version) VALUES ('20090930033753'); + +INSERT INTO schema_migrations (version) VALUES ('20091018155535'); + +INSERT INTO schema_migrations (version) VALUES ('20091018161438'); + +INSERT INTO schema_migrations (version) VALUES ('20091018174444'); + +INSERT INTO schema_migrations (version) VALUES ('20091019013949'); + +INSERT INTO schema_migrations (version) VALUES ('20091021225848'); + +INSERT INTO schema_migrations (version) VALUES ('20091029224425'); + +INSERT INTO schema_migrations (version) VALUES ('20091107214504'); + +INSERT INTO schema_migrations (version) VALUES ('20091121200119'); + +INSERT INTO schema_migrations (version) VALUES ('20091122210634'); + +INSERT INTO schema_migrations (version) VALUES ('20091205204625'); + +INSERT INTO schema_migrations (version) VALUES ('20091206140850'); + +INSERT INTO schema_migrations (version) VALUES ('20091206150153'); + +INSERT INTO schema_migrations (version) VALUES ('20091206172751'); + +INSERT INTO schema_migrations (version) VALUES ('20091206180109'); + +INSERT INTO schema_migrations (version) VALUES ('20091206180907'); + +INSERT INTO schema_migrations (version) VALUES ('20091207234702'); + +INSERT INTO schema_migrations (version) VALUES ('20091208200602'); + +INSERT INTO schema_migrations (version) VALUES ('20091209202619'); + +INSERT INTO schema_migrations (version) VALUES ('20091209215213'); + +INSERT INTO schema_migrations (version) VALUES ('20091212035917'); + +INSERT INTO schema_migrations (version) VALUES ('20091212051923'); + +INSERT INTO schema_migrations (version) VALUES ('20091213013846'); + +INSERT INTO schema_migrations (version) VALUES ('20091213035516'); + +INSERT INTO schema_migrations (version) VALUES ('20091216001101'); + +INSERT INTO schema_migrations (version) VALUES ('20091216150855'); + +INSERT INTO schema_migrations (version) VALUES ('20091217004235'); + +INSERT INTO schema_migrations (version) VALUES ('20091217005945'); + +INSERT INTO schema_migrations (version) VALUES ('20091217162252'); + +INSERT INTO schema_migrations (version) VALUES ('20091219192317'); + +INSERT INTO schema_migrations (version) VALUES ('20091220182557'); + +INSERT INTO schema_migrations (version) VALUES ('20091221011225'); + +INSERT INTO schema_migrations (version) VALUES ('20091221145401'); + +INSERT INTO schema_migrations (version) VALUES ('20091223002020'); + +INSERT INTO schema_migrations (version) VALUES ('20091223003205'); + +INSERT INTO schema_migrations (version) VALUES ('20091223180731'); + +INSERT INTO schema_migrations (version) VALUES ('20091227192528'); + +INSERT INTO schema_migrations (version) VALUES ('20091228042140'); + +INSERT INTO schema_migrations (version) VALUES ('20100104041510'); + +INSERT INTO schema_migrations (version) VALUES ('20100104144922'); + +INSERT INTO schema_migrations (version) VALUES ('20100104232731'); + +INSERT INTO schema_migrations (version) VALUES ('20100104232756'); + +INSERT INTO schema_migrations (version) VALUES ('20100105043033'); + +INSERT INTO schema_migrations (version) VALUES ('20100108002148'); + +INSERT INTO schema_migrations (version) VALUES ('20100112034428'); + +INSERT INTO schema_migrations (version) VALUES ('20100123004135'); + +INSERT INTO schema_migrations (version) VALUES ('20100202154135'); + +INSERT INTO schema_migrations (version) VALUES ('20100202154255'); + +INSERT INTO schema_migrations (version) VALUES ('20100210180708'); + +INSERT INTO schema_migrations (version) VALUES ('20100210214240'); + +INSERT INTO schema_migrations (version) VALUES ('20100220022635'); + +INSERT INTO schema_migrations (version) VALUES ('20100220031906'); + +INSERT INTO schema_migrations (version) VALUES ('20100220062829'); + +INSERT INTO schema_migrations (version) VALUES ('20100222011208'); + +INSERT INTO schema_migrations (version) VALUES ('20100222074558'); + +INSERT INTO schema_migrations (version) VALUES ('20100223204450'); + +INSERT INTO schema_migrations (version) VALUES ('20100223205231'); + +INSERT INTO schema_migrations (version) VALUES ('20100223212822'); + +INSERT INTO schema_migrations (version) VALUES ('20100225063636'); + +INSERT INTO schema_migrations (version) VALUES ('20100227013502'); + +INSERT INTO schema_migrations (version) VALUES ('20100301211829'); + +INSERT INTO schema_migrations (version) VALUES ('20100304193643'); + +INSERT INTO schema_migrations (version) VALUES ('20100307211947'); + +INSERT INTO schema_migrations (version) VALUES ('20100312165910'); + +INSERT INTO schema_migrations (version) VALUES ('20100313165910'); + +INSERT INTO schema_migrations (version) VALUES ('20100314021317'); + +INSERT INTO schema_migrations (version) VALUES ('20100314035644'); + +INSERT INTO schema_migrations (version) VALUES ('20100314044409'); + +INSERT INTO schema_migrations (version) VALUES ('20100320165910'); + +INSERT INTO schema_migrations (version) VALUES ('20100326170256'); + +INSERT INTO schema_migrations (version) VALUES ('20100326170652'); + +INSERT INTO schema_migrations (version) VALUES ('20100326170924'); + +INSERT INTO schema_migrations (version) VALUES ('20100326171229'); + +INSERT INTO schema_migrations (version) VALUES ('20100328215724'); + +INSERT INTO schema_migrations (version) VALUES ('20100402163915'); + +INSERT INTO schema_migrations (version) VALUES ('20100403191349'); + +INSERT INTO schema_migrations (version) VALUES ('20100404223432'); + +INSERT INTO schema_migrations (version) VALUES ('20100405191217'); + +INSERT INTO schema_migrations (version) VALUES ('20100407222411'); + +INSERT INTO schema_migrations (version) VALUES ('20100413231821'); + +INSERT INTO schema_migrations (version) VALUES ('20100414231821'); + +INSERT INTO schema_migrations (version) VALUES ('20100415231821'); + +INSERT INTO schema_migrations (version) VALUES ('20100416145044'); + +INSERT INTO schema_migrations (version) VALUES ('20100419131629'); + +INSERT INTO schema_migrations (version) VALUES ('20100420211328'); + +INSERT INTO schema_migrations (version) VALUES ('20100502024059'); + +INSERT INTO schema_migrations (version) VALUES ('20100506203017'); + +INSERT INTO schema_migrations (version) VALUES ('20100506231821'); + +INSERT INTO schema_migrations (version) VALUES ('20100530152111'); + +INSERT INTO schema_migrations (version) VALUES ('20100530161827'); + +INSERT INTO schema_migrations (version) VALUES ('20100618021343'); + +INSERT INTO schema_migrations (version) VALUES ('20100620185742'); + +INSERT INTO schema_migrations (version) VALUES ('20100727212342'); + +INSERT INTO schema_migrations (version) VALUES ('20100728220657'); + +INSERT INTO schema_migrations (version) VALUES ('20100804185744'); + +INSERT INTO schema_migrations (version) VALUES ('20100812175429'); + +INSERT INTO schema_migrations (version) VALUES ('20100821165448'); + +INSERT INTO schema_migrations (version) VALUES ('20100901154501'); + +INSERT INTO schema_migrations (version) VALUES ('20100901165448'); + +INSERT INTO schema_migrations (version) VALUES ('20100907015632'); INSERT INTO schema_migrations (version) VALUES ('20100929044155'); @@ -1555,6 +1908,8 @@ INSERT INTO schema_migrations (version) VALUES ('20130707160714'); INSERT INTO schema_migrations (version) VALUES ('20130707160814'); +INSERT INTO schema_migrations (version) VALUES ('20140206031705'); + INSERT INTO schema_migrations (version) VALUES ('20140208200234'); INSERT INTO schema_migrations (version) VALUES ('20140326130206'); @@ -1571,12 +1926,6 @@ INSERT INTO schema_migrations (version) VALUES ('20140922025054'); INSERT INTO schema_migrations (version) VALUES ('20140924023950'); -INSERT INTO schema_migrations (version) VALUES ('20141003204623'); - -INSERT INTO schema_migrations (version) VALUES ('20141003205439'); - -INSERT INTO schema_migrations (version) VALUES ('20141004123421'); - INSERT INTO schema_migrations (version) VALUES ('20150106211421'); INSERT INTO schema_migrations (version) VALUES ('20150111203000'); From f72f9792ef807f138aacd50e9824ca2548755b01 Mon Sep 17 00:00:00 2001 From: james_ Date: Fri, 8 May 2015 17:08:26 +0000 Subject: [PATCH 26/30] Get travis to delete the current db state to make the files not used for testing so we can automate the generation on deploying to test --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ad0ad7e4b4b..03ce4863f58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ services: - redis-server - memcached script: + - rm -f db/structure.sql db/schema.rb - 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 From a38edb4ec45c144ad4d3959a0d4b473757bf038f Mon Sep 17 00:00:00 2001 From: james_ Date: Fri, 8 May 2015 17:33:35 +0000 Subject: [PATCH 27/30] Try this travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 03ce4863f58..19421cadd0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,7 @@ services: - memcached script: - rm -f db/structure.sql db/schema.rb + - RAILS_ENV=test bundle exec rake db:migrate --trace - 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 From 4f9b11801aa2cc6c2c142b3069e12a74ce45263b Mon Sep 17 00:00:00 2001 From: james_ Date: Fri, 8 May 2015 17:54:50 +0000 Subject: [PATCH 28/30] Try this travis --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 19421cadd0b..544e3041474 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,7 @@ services: - redis-server - memcached script: - - rm -f db/structure.sql db/schema.rb - - RAILS_ENV=test bundle exec rake db:migrate --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 From 826804a6baec1f9c38dfee22615cbbddc15a7f22 Mon Sep 17 00:00:00 2001 From: james_ Date: Fri, 8 May 2015 18:53:46 +0000 Subject: [PATCH 29/30] We need to do the migrations --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/schema.rb b/db/schema.rb index 4d5af6a212e..0c438abbdd3 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 => 20121129192353) do create_table "abuse_reports", :force => true do |t| t.string "email" From 8e6c0c8ea1264342fd7fa4bb33ba05ff43da0d38 Mon Sep 17 00:00:00 2001 From: james_ Date: Sat, 9 May 2015 05:31:12 +0000 Subject: [PATCH 30/30] Roll up the migrations properly --- ...d_persistence_token_to_users_and_admins.rb | 13 --- ...1015053927_add_sanitizer_version_fields.rb | 86 ------------------- ...131743_add_inherited_to_filter_taggings.rb | 9 -- ...20101022002353_add_tag_wrangling_freeze.rb | 9 -- ...60603_add_restrict_to_fandom_to_tag_set.rb | 11 --- .../20101024232837_add_any_to_prompts.rb | 35 -------- ...022733_add_unique_to_prompt_restriction.rb | 21 ----- db/migrate/20101103185307_tagging_indexes.rb | 13 --- ...estrict_to_fandom_to_prompt_restriction.rb | 15 ---- ...0101107212421_add_guest_download_freeze.rb | 9 -- ...ment_notification_to_collection_profile.rb | 9 -- ...01109204730_create_missing_work_indexes.rb | 15 ---- ...dd_approved_and_ip_address_to_feedbacks.rb | 11 --- db/migrate/20101130074147_create_kudos.rb | 15 ---- db/migrate/20101204042756_add_type_to_skin.rb | 9 -- .../20101204061318_rename_disable_ugs.rb | 9 -- ...0101204062558_add_work_skin_id_to_works.rb | 9 -- .../20101205015909_add_ip_address_to_kudos.rb | 9 -- ...translation_and_language_to_admin_posts.rb | 11 --- db/migrate/20101219191929_add_kudo_indexes.rb | 17 ---- ...104_add_kudos_emails_off_to_preferences.rb | 9 -- ..._add_disable_share_links_to_preferences.rb | 9 -- ...dd_prompt_meme_to_collection_preference.rb | 9 -- .../20110130093601_create_prompt_memes.rb | 30 ------- db/migrate/20110130093602_add_anon_prompts.rb | 9 -- .../20110130093604_create_challenge_claims.rb | 22 ----- .../20110212162042_add_admin_post_tags.rb | 19 ---- ...1104_add_requests_summary_to_challenges.rb | 9 -- .../20110222093602_add_anon_prompt_memes.rb | 9 -- ...110223031701_stop_restricted_being_null.rb | 9 -- ...0304042756_add_paragraph_margin_to_skin.rb | 9 -- .../20110312174241_create_subscriptions.rb | 15 ---- ...185831_add_banner_unseen_to_preferences.rb | 9 -- ...0401201033_add_banner_to_admin_settings.rb | 9 -- .../20110513145847_create_owned_tag_sets.rb | 26 ------ ...15182045_add_featured_to_owned_tag_sets.rb | 11 --- ...0110526203419_add_header_color_to_skins.rb | 9 -- .../20110601200556_add_accent_to_skins.rb | 9 -- ...10619091214_update_prompt_meme_defaults.rb | 11 --- ...0110619091342_update_challenge_defaults.rb | 13 --- ...21015359_add_language_to_external_works.rb | 9 -- ...0110710033732_create_owned_set_taggings.rb | 15 ---- ..._add_nomination_limits_to_owned_tag_set.rb | 15 ---- ...110712140002_create_tag_set_nominations.rb | 14 --- ..._set_restriction_to_prompt_restrictions.rb | 11 --- .../20110801134913_create_tag_nominations.rb | 22 ----- ...0810012317_add_usable_to_owned_tag_sets.rb | 9 -- ...110810150044_add_last_viewed_to_reading.rb | 11 --- ...012725_add_canonical_to_tag_nominations.rb | 11 --- ...23015903_add_synonym_to_tag_nominations.rb | 9 -- ...3658_remove_fields_from_tag_nominations.rb | 13 --- .../20110827185228_change_banner_text_type.rb | 13 --- ...0110828172403_add_banner_text_sanitiser.rb | 9 -- ...9125505_add_failed_login_count_to_users.rb | 9 -- .../20110905184626_create_skin_parents.rb | 15 ---- ...10908191743_create_tag_set_associations.rb | 15 ---- .../20111006032145_add_features_to_skins.rb | 23 ----- .../20111007235357_add_unusable_to_skins.rb | 9 -- ...dd_title_options_to_prompt_restrictions.rb | 11 --- ...25_add_featured_and_in_chooser_to_skins.rb | 11 --- .../20111122225340_add_comment_to_pseuds.rb | 9 -- ...11122225341_add_icontext_to_collections.rb | 9 -- ...3011929_add_login_unique_index_to_users.rb | 11 --- ...06225341_add_iconcomment_to_collections.rb | 9 -- ...120131225520_filter_tagging_primary_key.rb | 11 --- .../20120206034312_create_work_links.rb | 18 ---- ..._add_stats_updated_at_to_admin_settings.rb | 9 -- ...0120415134615_add_unwrangleable_to_tags.rb | 9 -- ..._unique_index_filter_id_to_filter_count.rb | 32 ------- ...0809161528_add_collection_info_to_works.rb | 11 --- ...34_change_hit_counters_to_stat_counters.rb | 15 ---- db/migrate/20120825165632_create_searches.rb | 16 ---- ...44_add_filter_control_to_admin_settings.rb | 9 -- ...20120913222728_remove_openid_from_users.rb | 11 --- ...notifications_to_collection_preferences.rb | 9 -- ...23221449_remove_old_translation_systems.rb | 12 --- ...002223_add_request_invite_enabled_field.rb | 9 -- ...0121129192353_add_sortable_name_to_tags.rb | 10 --- ...1205215503_add_account_creation_options.rb | 9 -- ...20012746_add_anon_commenting_preference.rb | 9 -- .../20130113003307_create_admin_activities.rb | 18 ---- ...onymous_commenting_default_state_change.rb | 11 --- ...20130707160714_remove_duplicate_indexes.rb | 18 ---- ...0814_revert_filter_taggings_primary_key.rb | 15 ---- db/migrate/20140208200234_create_api_keys.rb | 13 --- ...40326130206_add_potential_match_indexes.rb | 19 ---- db/migrate/20140327111111_doc_faq_rework.rb | 47 ---------- .../20140406043239_create_admin_banners.rb | 20 ----- .../20140808220904_create_favorite_tags.rb | 9 -- db/migrate/20140922024405_add_slug_to_faqs.rb | 9 -- .../20140922025054_add_indices_to_faqs.rb | 6 -- ...40924023950_create_wrangling_guidelines.rb | 17 ---- .../20150106211421_add_ip_address_to_works.rb | 11 --- ...150111203000_add_akismet_score_to_works.rb | 13 --- ...150217034225_change_favorite_tags_index.rb | 11 --- db/schema.rb | 2 +- 96 files changed, 1 insertion(+), 1319 deletions(-) delete mode 100644 db/migrate/20100929044155_add_persistence_token_to_users_and_admins.rb delete mode 100644 db/migrate/20101015053927_add_sanitizer_version_fields.rb delete mode 100644 db/migrate/20101016131743_add_inherited_to_filter_taggings.rb delete mode 100644 db/migrate/20101022002353_add_tag_wrangling_freeze.rb delete mode 100644 db/migrate/20101022160603_add_restrict_to_fandom_to_tag_set.rb delete mode 100644 db/migrate/20101024232837_add_any_to_prompts.rb delete mode 100644 db/migrate/20101025022733_add_unique_to_prompt_restriction.rb delete mode 100644 db/migrate/20101103185307_tagging_indexes.rb delete mode 100644 db/migrate/20101107005107_add_restrict_to_fandom_to_prompt_restriction.rb delete mode 100644 db/migrate/20101107212421_add_guest_download_freeze.rb delete mode 100644 db/migrate/20101108003021_add_assignment_notification_to_collection_profile.rb delete mode 100644 db/migrate/20101109204730_create_missing_work_indexes.rb delete mode 100644 db/migrate/20101128051309_add_approved_and_ip_address_to_feedbacks.rb delete mode 100644 db/migrate/20101130074147_create_kudos.rb delete mode 100644 db/migrate/20101204042756_add_type_to_skin.rb delete mode 100644 db/migrate/20101204061318_rename_disable_ugs.rb delete mode 100644 db/migrate/20101204062558_add_work_skin_id_to_works.rb delete mode 100644 db/migrate/20101205015909_add_ip_address_to_kudos.rb delete mode 100644 db/migrate/20101216165336_add_translation_and_language_to_admin_posts.rb delete mode 100644 db/migrate/20101219191929_add_kudo_indexes.rb delete mode 100644 db/migrate/20101231171104_add_kudos_emails_off_to_preferences.rb delete mode 100644 db/migrate/20101231174606_add_disable_share_links_to_preferences.rb delete mode 100644 db/migrate/20110130093600_add_prompt_meme_to_collection_preference.rb delete mode 100644 db/migrate/20110130093601_create_prompt_memes.rb delete mode 100644 db/migrate/20110130093602_add_anon_prompts.rb delete mode 100644 db/migrate/20110130093604_create_challenge_claims.rb delete mode 100644 db/migrate/20110212162042_add_admin_post_tags.rb delete mode 100644 db/migrate/20110214171104_add_requests_summary_to_challenges.rb delete mode 100644 db/migrate/20110222093602_add_anon_prompt_memes.rb delete mode 100644 db/migrate/20110223031701_stop_restricted_being_null.rb delete mode 100644 db/migrate/20110304042756_add_paragraph_margin_to_skin.rb delete mode 100644 db/migrate/20110312174241_create_subscriptions.rb delete mode 100644 db/migrate/20110401185831_add_banner_unseen_to_preferences.rb delete mode 100644 db/migrate/20110401201033_add_banner_to_admin_settings.rb delete mode 100644 db/migrate/20110513145847_create_owned_tag_sets.rb delete mode 100644 db/migrate/20110515182045_add_featured_to_owned_tag_sets.rb delete mode 100644 db/migrate/20110526203419_add_header_color_to_skins.rb delete mode 100644 db/migrate/20110601200556_add_accent_to_skins.rb delete mode 100644 db/migrate/20110619091214_update_prompt_meme_defaults.rb delete mode 100644 db/migrate/20110619091342_update_challenge_defaults.rb delete mode 100644 db/migrate/20110621015359_add_language_to_external_works.rb delete mode 100644 db/migrate/20110710033732_create_owned_set_taggings.rb delete mode 100644 db/migrate/20110712003637_add_nomination_limits_to_owned_tag_set.rb delete mode 100644 db/migrate/20110712140002_create_tag_set_nominations.rb delete mode 100644 db/migrate/20110713013317_add_tag_set_restriction_to_prompt_restrictions.rb delete mode 100644 db/migrate/20110801134913_create_tag_nominations.rb delete mode 100644 db/migrate/20110810012317_add_usable_to_owned_tag_sets.rb delete mode 100644 db/migrate/20110810150044_add_last_viewed_to_reading.rb delete mode 100644 db/migrate/20110812012725_add_canonical_to_tag_nominations.rb delete mode 100644 db/migrate/20110823015903_add_synonym_to_tag_nominations.rb delete mode 100644 db/migrate/20110827153658_remove_fields_from_tag_nominations.rb delete mode 100644 db/migrate/20110827185228_change_banner_text_type.rb delete mode 100644 db/migrate/20110828172403_add_banner_text_sanitiser.rb delete mode 100644 db/migrate/20110829125505_add_failed_login_count_to_users.rb delete mode 100644 db/migrate/20110905184626_create_skin_parents.rb delete mode 100644 db/migrate/20110908191743_create_tag_set_associations.rb delete mode 100644 db/migrate/20111006032145_add_features_to_skins.rb delete mode 100644 db/migrate/20111007235357_add_unusable_to_skins.rb delete mode 100644 db/migrate/20111013010307_add_title_options_to_prompt_restrictions.rb delete mode 100644 db/migrate/20111027173425_add_featured_and_in_chooser_to_skins.rb delete mode 100644 db/migrate/20111122225340_add_comment_to_pseuds.rb delete mode 100644 db/migrate/20111122225341_add_icontext_to_collections.rb delete mode 100644 db/migrate/20111123011929_add_login_unique_index_to_users.rb delete mode 100644 db/migrate/20111206225341_add_iconcomment_to_collections.rb delete mode 100644 db/migrate/20120131225520_filter_tagging_primary_key.rb delete mode 100644 db/migrate/20120206034312_create_work_links.rb delete mode 100644 db/migrate/20120226024139_add_stats_updated_at_to_admin_settings.rb delete mode 100644 db/migrate/20120415134615_add_unwrangleable_to_tags.rb delete mode 100644 db/migrate/20120501210459_add_unique_index_filter_id_to_filter_count.rb delete mode 100644 db/migrate/20120809161528_add_collection_info_to_works.rb delete mode 100644 db/migrate/20120809164434_change_hit_counters_to_stat_counters.rb delete mode 100644 db/migrate/20120825165632_create_searches.rb delete mode 100644 db/migrate/20120901113344_add_filter_control_to_admin_settings.rb delete mode 100644 db/migrate/20120913222728_remove_openid_from_users.rb delete mode 100644 db/migrate/20120921094037_add_email_notifications_to_collection_preferences.rb delete mode 100644 db/migrate/20121023221449_remove_old_translation_systems.rb delete mode 100644 db/migrate/20121102002223_add_request_invite_enabled_field.rb delete mode 100644 db/migrate/20121129192353_add_sortable_name_to_tags.rb delete mode 100644 db/migrate/20121205215503_add_account_creation_options.rb delete mode 100644 db/migrate/20121220012746_add_anon_commenting_preference.rb delete mode 100644 db/migrate/20130113003307_create_admin_activities.rb delete mode 100644 db/migrate/20130327164311_anonymous_commenting_default_state_change.rb delete mode 100644 db/migrate/20130707160714_remove_duplicate_indexes.rb delete mode 100644 db/migrate/20130707160814_revert_filter_taggings_primary_key.rb delete mode 100644 db/migrate/20140208200234_create_api_keys.rb delete mode 100644 db/migrate/20140326130206_add_potential_match_indexes.rb delete mode 100644 db/migrate/20140327111111_doc_faq_rework.rb delete mode 100644 db/migrate/20140406043239_create_admin_banners.rb delete mode 100644 db/migrate/20140808220904_create_favorite_tags.rb delete mode 100644 db/migrate/20140922024405_add_slug_to_faqs.rb delete mode 100644 db/migrate/20140922025054_add_indices_to_faqs.rb delete mode 100644 db/migrate/20140924023950_create_wrangling_guidelines.rb delete mode 100644 db/migrate/20150106211421_add_ip_address_to_works.rb delete mode 100644 db/migrate/20150111203000_add_akismet_score_to_works.rb delete mode 100644 db/migrate/20150217034225_change_favorite_tags_index.rb 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/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 0c438abbdd3..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 => 20121129192353) do +ActiveRecord::Schema.define(:version => 20010101010101) do create_table "abuse_reports", :force => true do |t| t.string "email"