From 7eec279c7fb0350974fea4456c5c3bab7b457376 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 17 Jun 2018 13:54:02 +0200 Subject: Change language opt-out to language opt-in (#7823) * Switch filtered_languages to chosen_languages * Adjust interface * Remove unused translations --- db/migrate/20180616192031_add_chosen_languages_to_users.rb | 5 +++++ db/schema.rb | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20180616192031_add_chosen_languages_to_users.rb (limited to 'db') diff --git a/db/migrate/20180616192031_add_chosen_languages_to_users.rb b/db/migrate/20180616192031_add_chosen_languages_to_users.rb new file mode 100644 index 000000000..48b53019d --- /dev/null +++ b/db/migrate/20180616192031_add_chosen_languages_to_users.rb @@ -0,0 +1,5 @@ +class AddChosenLanguagesToUsers < ActiveRecord::Migration[5.2] + def change + add_column :users, :chosen_languages, :string, array: true, null: true, default: nil + end +end diff --git a/db/schema.rb b/db/schema.rb index 4c39de26a..c06387ba6 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: 2018_06_15_122121) do +ActiveRecord::Schema.define(version: 2018_06_16_192031) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -525,6 +525,7 @@ ActiveRecord::Schema.define(version: 2018_06_15_122121) do t.boolean "moderator", default: false, null: false t.bigint "invite_id" t.string "remember_token" + t.string "chosen_languages", array: true t.index ["account_id"], name: "index_users_on_account_id" t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true t.index ["email"], name: "index_users_on_email", unique: true -- cgit From bb21c6414db64739637b4ea81526efe8e539cce0 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 17 Jun 2018 18:49:35 +0200 Subject: Remove unused indexes (#7829) --- db/migrate/20180617162849_remove_unused_indexes.rb | 7 +++++++ db/schema.rb | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 db/migrate/20180617162849_remove_unused_indexes.rb (limited to 'db') diff --git a/db/migrate/20180617162849_remove_unused_indexes.rb b/db/migrate/20180617162849_remove_unused_indexes.rb new file mode 100644 index 000000000..61add6385 --- /dev/null +++ b/db/migrate/20180617162849_remove_unused_indexes.rb @@ -0,0 +1,7 @@ +class RemoveUnusedIndexes < ActiveRecord::Migration[5.2] + def change + remove_index :statuses, name: "index_statuses_on_conversation_id" + remove_index :users, name: "index_users_on_filtered_languages" + remove_index :backups, name: "index_backups_on_user_id" + end +end diff --git a/db/schema.rb b/db/schema.rb index c06387ba6..2853aef94 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: 2018_06_16_192031) do +ActiveRecord::Schema.define(version: 2018_06_17_162849) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -103,7 +103,6 @@ ActiveRecord::Schema.define(version: 2018_06_16_192031) do t.boolean "processed", default: false, null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.index ["user_id"], name: "index_backups_on_user_id" end create_table "blocks", force: :cascade do |t| @@ -448,7 +447,6 @@ ActiveRecord::Schema.define(version: 2018_06_16_192031) do t.bigint "application_id" t.bigint "in_reply_to_account_id" t.index ["account_id", "id", "visibility", "updated_at"], name: "index_statuses_20180106", order: { id: :desc } - t.index ["conversation_id"], name: "index_statuses_on_conversation_id" t.index ["in_reply_to_id"], name: "index_statuses_on_in_reply_to_id" t.index ["reblog_of_id", "account_id"], name: "index_statuses_on_reblog_of_id_and_account_id" t.index ["uri"], name: "index_statuses_on_uri", unique: true @@ -529,7 +527,6 @@ ActiveRecord::Schema.define(version: 2018_06_16_192031) do t.index ["account_id"], name: "index_users_on_account_id" t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true t.index ["email"], name: "index_users_on_email", unique: true - 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 end -- cgit