From 7fb850e987c92a6b863cc1f66a6ec7318460f1de Mon Sep 17 00:00:00 2001 From: unarist Date: Tue, 28 Nov 2017 04:22:27 +0900 Subject: [PATCH 1/3] Merge indexes for reblog on statuses table (#5831) We added an index for `[account_id, reblog_of_id]`, but we already have a similar index for `reblog_of_id`. Those index will be bigger according to statuses count. For example, `reblog_of_id` index uses 800MB for 10GB statuses table. So this patch swaps indexed columns like `[reblog_of_id, account_id]`, then it will covers both usage with single index. Since those index creation may take a while, I've also disabled previous index creation. --- ...d_index_account_and_reblog_of_id_to_statuses.rb | 12 +++++++++--- ...d_index_reblog_of_id_and_account_to_statuses.rb | 7 +++++++ ...25190735_remove_old_reblog_index_on_statuses.rb | 14 ++++++++++++++ db/schema.rb | 5 ++--- 4 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20171125185353_add_index_reblog_of_id_and_account_to_statuses.rb create mode 100644 db/migrate/20171125190735_remove_old_reblog_index_on_statuses.rb diff --git a/db/migrate/20171122120436_add_index_account_and_reblog_of_id_to_statuses.rb b/db/migrate/20171122120436_add_index_account_and_reblog_of_id_to_statuses.rb index 49c1ce0a8b..131e54b72e 100644 --- a/db/migrate/20171122120436_add_index_account_and_reblog_of_id_to_statuses.rb +++ b/db/migrate/20171122120436_add_index_account_and_reblog_of_id_to_statuses.rb @@ -1,6 +1,12 @@ class AddIndexAccountAndReblogOfIdToStatuses < ActiveRecord::Migration[5.1] - def change - commit_db_transaction - add_index :statuses, [:account_id, :reblog_of_id], algorithm: :concurrently + disable_ddl_transaction! + + def up + # This index has been superseded by migration 20171125185353 + # add_index :statuses, [:account_id, :reblog_of_id], algorithm: :concurrently + end + + def down + remove_index :statuses, [:account_id, :reblog_of_id] if index_exists?(:statuses, [:account_id, :reblog_of_id]) end end diff --git a/db/migrate/20171125185353_add_index_reblog_of_id_and_account_to_statuses.rb b/db/migrate/20171125185353_add_index_reblog_of_id_and_account_to_statuses.rb new file mode 100644 index 0000000000..37662eaa5d --- /dev/null +++ b/db/migrate/20171125185353_add_index_reblog_of_id_and_account_to_statuses.rb @@ -0,0 +1,7 @@ +class AddIndexReblogOfIdAndAccountToStatuses < ActiveRecord::Migration[5.1] + disable_ddl_transaction! + + def change + add_index :statuses, [:reblog_of_id, :account_id], algorithm: :concurrently + end +end diff --git a/db/migrate/20171125190735_remove_old_reblog_index_on_statuses.rb b/db/migrate/20171125190735_remove_old_reblog_index_on_statuses.rb new file mode 100644 index 0000000000..68146c5ce0 --- /dev/null +++ b/db/migrate/20171125190735_remove_old_reblog_index_on_statuses.rb @@ -0,0 +1,14 @@ +class RemoveOldReblogIndexOnStatuses < ActiveRecord::Migration[5.1] + disable_ddl_transaction! + + def up + # This index may not exists (see migration 20171122120436) + remove_index :statuses, [:account_id, :reblog_of_id] if index_exists?(:statuses, [:account_id, :reblog_of_id]) + + remove_index :statuses, :reblog_of_id + end + + def down + add_index :statuses, :reblog_of_id, algorithm: :concurrently + end +end diff --git a/db/schema.rb b/db/schema.rb index 7422bd1277..120b159504 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: 20171125031751) do +ActiveRecord::Schema.define(version: 20171125190735) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -409,10 +409,9 @@ ActiveRecord::Schema.define(version: 20171125031751) do t.bigint "application_id" t.bigint "in_reply_to_account_id" t.index ["account_id", "id"], name: "index_statuses_on_account_id_id" - t.index ["account_id", "reblog_of_id"], name: "index_statuses_on_account_id_and_reblog_of_id" 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"], name: "index_statuses_on_reblog_of_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 end From e20258a2e57bff6ea44c949fbe86a5b34572f9d6 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Mon, 27 Nov 2017 20:22:47 +0100 Subject: [PATCH 2/3] chore(yarn): Upgrade react-swipeable-views (smoother swiping) (#5830) --- yarn.lock | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/yarn.lock b/yarn.lock index b7aa18a017..646a4042f2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5799,7 +5799,7 @@ react-dom@^16.0.0: object-assign "^4.1.1" prop-types "^15.6.0" -react-event-listener@^0.5.0: +react-event-listener@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/react-event-listener/-/react-event-listener-0.5.1.tgz#ba36076e47bc37c5a67ff5ccd4a9ff0f15621040" dependencies: @@ -5916,33 +5916,33 @@ react-router@^4.2.0: prop-types "^15.5.4" warning "^3.0.0" -react-swipeable-views-core@^0.12.8: - version "0.12.8" - resolved "https://registry.yarnpkg.com/react-swipeable-views-core/-/react-swipeable-views-core-0.12.8.tgz#99460621e5a6da07fb482a25b151905ae7a797a9" +react-swipeable-views-core@^0.12.11: + version "0.12.11" + resolved "https://registry.yarnpkg.com/react-swipeable-views-core/-/react-swipeable-views-core-0.12.11.tgz#3cf2b4daffbb36f9d69bd19bf5b2d5370b6b2c1b" dependencies: babel-runtime "^6.23.0" warning "^3.0.0" -react-swipeable-views-utils@^0.12.8: - version "0.12.8" - resolved "https://registry.yarnpkg.com/react-swipeable-views-utils/-/react-swipeable-views-utils-0.12.8.tgz#9483fc7dd370032f2f93ac44f2a2913d7c52aa41" +react-swipeable-views-utils@^0.12.11: + version "0.12.11" + resolved "https://registry.yarnpkg.com/react-swipeable-views-utils/-/react-swipeable-views-utils-0.12.11.tgz#3c9a6a2b8dbdcc331a5d107419578f57b7e101d6" dependencies: babel-runtime "^6.23.0" fbjs "^0.8.4" keycode "^2.1.7" - prop-types "^15.5.4" - react-event-listener "^0.5.0" - react-swipeable-views-core "^0.12.8" + prop-types "^15.6.0" + react-event-listener "^0.5.1" + react-swipeable-views-core "^0.12.11" react-swipeable-views@^0.12.3: - version "0.12.8" - resolved "https://registry.yarnpkg.com/react-swipeable-views/-/react-swipeable-views-0.12.8.tgz#8541daab5881067e58281d1e6ff13815ae94ebf5" + version "0.12.12" + resolved "https://registry.yarnpkg.com/react-swipeable-views/-/react-swipeable-views-0.12.12.tgz#60cdc8e3682ed082aaf094f7761eaf691ed28a6f" dependencies: babel-runtime "^6.23.0" dom-helpers "^3.2.1" prop-types "^15.5.4" - react-swipeable-views-core "^0.12.8" - react-swipeable-views-utils "^0.12.8" + react-swipeable-views-core "^0.12.11" + react-swipeable-views-utils "^0.12.11" warning "^3.0.0" react-test-renderer@^16.0.0, react-test-renderer@^16.0.0-0: From c6b7c772293ed1319dc57741487ce5bc774558a9 Mon Sep 17 00:00:00 2001 From: mayaeh Date: Tue, 28 Nov 2017 04:23:14 +0900 Subject: [PATCH 3/3] i18n: Update ja translation for consumable invites. (#5829) * Add Japanese translation for consumable invites. * Add Japanese translation. * Update Japanese translation. --- config/locales/ja.yml | 24 ++++++++++++++++++++++++ config/locales/simple_form.ja.yml | 2 ++ 2 files changed, 26 insertions(+) diff --git a/config/locales/ja.yml b/config/locales/ja.yml index e52ffe642d..14f083b976 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -231,6 +231,8 @@ ja: reset: リセット search: 検索 title: 既知のインスタンス + invites: + title: 招待 reports: action_taken_by: レポート処理者 are_you_sure: 本当に実行しますか? @@ -269,6 +271,9 @@ ja: deletion: desc_html: 誰でも自分のアカウントを削除できるようにします title: アカウント削除を受け付ける + min_invite_role: + disabled: 誰も許可しない + title: 招待の作成を許可 open: desc_html: 誰でも自由にアカウントを作成できるようにします title: 新規登録を受け付ける @@ -424,6 +429,25 @@ ja: muting: ミュートしたアカウントリスト upload: アップロード in_memoriam_html: 故人を偲んで + invites: + delete: 削除 + expires_in: + '1800': 30 分 + '21600': 6 時間 + '3600': 1 時間 + '43200': 12 時間 + '86400': 1 日 + expires_in_prompt: 無期限 + generate: 作成 + max_uses: + one: 1 + other: "%{count}" + max_uses_prompt: 無制限 + prompt: リンクを生成・共有してこのインスタンスへの新規登録を受け付けることができます。 + table: + expires_at: 有効期限 + uses: 使用 + title: 新規ユーザーの招待 landing_strip_html: "%{name} さんはインスタンス %{link_to_root_path} のユーザーです。アカウントさえ持っていればフォローしたり会話したりできます。" landing_strip_signup_html: もしお持ちでないなら こちら からサインアップできます。 media_attachments: diff --git a/config/locales/simple_form.ja.yml b/config/locales/simple_form.ja.yml index 48eaf79b20..bdeefa7e52 100644 --- a/config/locales/simple_form.ja.yml +++ b/config/locales/simple_form.ja.yml @@ -26,10 +26,12 @@ ja: data: データ display_name: 表示名 email: メールアドレス + expires_in: 有効期限 filtered_languages: 除外する言語 header: ヘッダー locale: 言語 locked: 非公開アカウントにする + max_uses: 使用できる回数 new_password: 新しいパスワード note: プロフィール otp_attempt: 二段階認証コード