Browse Source

Fix existing user records with now-renamed `pt` locale (#12092)

Fix #12082
Eugen Rochko 3 months ago
parent
commit
b5be067c88
No account linked to committer's email address
2 changed files with 36 additions and 1 deletions
  1. 11
    0
      db/migrate/20191007013357_update_pt_locales.rb
  2. 25
    1
      db/schema.rb

+ 11
- 0
db/migrate/20191007013357_update_pt_locales.rb View File

@@ -0,0 +1,11 @@
1
+class UpdatePtLocales < ActiveRecord::Migration[5.2]
2
+  disable_ddl_transaction!
3
+
4
+  def up
5
+    User.where(locale: 'pt').in_batches.update_all(locale: 'pt-PT')
6
+  end
7
+
8
+  def down
9
+    User.where(locale: 'pt-PT').in_batches.update_all(locale: 'pt')
10
+  end
11
+end

+ 25
- 1
db/schema.rb View File

@@ -10,7 +10,7 @@
10 10
 #
11 11
 # It's strongly recommended that you check this file into your version control system.
12 12
 
13
-ActiveRecord::Schema.define(version: 2019_10_01_213028) do
13
+ActiveRecord::Schema.define(version: 2019_10_07_013357) do
14 14
 
15 15
   # These are extensions that must be enabled in order to support this database
16 16
   enable_extension "plpgsql"
@@ -693,6 +693,30 @@ ActiveRecord::Schema.define(version: 2019_10_01_213028) do
693 693
     t.index ["tag_id", "status_id"], name: "index_statuses_tags_on_tag_id_and_status_id", unique: true
694 694
   end
695 695
 
696
+  create_table "stream_entries", force: :cascade do |t|
697
+    t.bigint "activity_id"
698
+    t.string "activity_type"
699
+    t.datetime "created_at", null: false
700
+    t.datetime "updated_at", null: false
701
+    t.boolean "hidden", default: false, null: false
702
+    t.bigint "account_id"
703
+    t.index ["account_id", "activity_type", "id"], name: "index_stream_entries_on_account_id_and_activity_type_and_id"
704
+    t.index ["activity_id", "activity_type"], name: "index_stream_entries_on_activity_id_and_activity_type"
705
+  end
706
+
707
+  create_table "subscriptions", force: :cascade do |t|
708
+    t.string "callback_url", default: "", null: false
709
+    t.string "secret"
710
+    t.datetime "expires_at"
711
+    t.boolean "confirmed", default: false, null: false
712
+    t.datetime "created_at", null: false
713
+    t.datetime "updated_at", null: false
714
+    t.datetime "last_successful_delivery_at"
715
+    t.string "domain"
716
+    t.bigint "account_id", null: false
717
+    t.index ["account_id", "callback_url"], name: "index_subscriptions_on_account_id_and_callback_url", unique: true
718
+  end
719
+
696 720
   create_table "tags", force: :cascade do |t|
697 721
     t.string "name", default: "", null: false
698 722
     t.datetime "created_at", null: false

Loading…
Cancel
Save