about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170520145338_change_language_filter_to_opt_out.rb9
-rw-r--r--db/schema.rb6
2 files changed, 12 insertions, 3 deletions
diff --git a/db/migrate/20170520145338_change_language_filter_to_opt_out.rb b/db/migrate/20170520145338_change_language_filter_to_opt_out.rb
new file mode 100644
index 000000000..8dac98ee8
--- /dev/null
+++ b/db/migrate/20170520145338_change_language_filter_to_opt_out.rb
@@ -0,0 +1,9 @@
+class ChangeLanguageFilterToOptOut < ActiveRecord::Migration[5.0]
+  def change
+    remove_index :users, :allowed_languages
+    remove_column :users, :allowed_languages
+
+    add_column :users, :filtered_languages, :string, array: true, default: [], null: false
+    add_index :users, :filtered_languages, using: :gin
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 8246e665a..33c833615 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 20170517205741) do
+ActiveRecord::Schema.define(version: 20170520145338) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -350,11 +350,11 @@ ActiveRecord::Schema.define(version: 20170517205741) do
     t.boolean  "otp_required_for_login"
     t.datetime "last_emailed_at"
     t.string   "otp_backup_codes",                                       array: true
-    t.string   "allowed_languages",         default: [],    null: false, array: true
+    t.string   "filtered_languages",        default: [],    null: false, array: true
     t.index ["account_id"], name: "index_users_on_account_id", using: :btree
-    t.index ["allowed_languages"], name: "index_users_on_allowed_languages", using: :gin
     t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree
     t.index ["email"], name: "index_users_on_email", unique: true, using: :btree
+    t.index ["filtered_languages"], name: "index_users_on_filtered_languages", using: :gin
     t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
   end