about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
authorReverite <github@reverite.sh>2019-10-11 14:55:34 -0700
committerReverite <github@reverite.sh>2019-10-11 14:55:34 -0700
commitb63bcefbdf19eece58ae430bce14031d147ab796 (patch)
tree9ce7c29898ddf3f4c4af20890492409793d2fb0f /db/migrate
parent38afc782051fe6faf06c2c9ca20304dd946cfb5c (diff)
parentfbe1de114fca16d63ff651425f69eb534ba013e9 (diff)
Merge branch 'glitch' into production
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20181024224956_migrate_account_conversations.rb2
-rw-r--r--db/migrate/20191007013357_update_pt_locales.rb11
2 files changed, 12 insertions, 1 deletions
diff --git a/db/migrate/20181024224956_migrate_account_conversations.rb b/db/migrate/20181024224956_migrate_account_conversations.rb
index b718f9e1d..d4bc3b91d 100644
--- a/db/migrate/20181024224956_migrate_account_conversations.rb
+++ b/db/migrate/20181024224956_migrate_account_conversations.rb
@@ -52,6 +52,6 @@ class MigrateAccountConversations < ActiveRecord::Migration[5.2]
   end
 
   def notifications_about_direct_statuses
-    Notification.joins(mention: :status).where(activity_type: 'Mention', statuses: { visibility: :direct })
+    Notification.joins('INNER JOIN mentions ON mentions.id = notifications.activity_id INNER JOIN statuses ON statuses.id = mentions.status_id').where(activity_type: 'Mention', statuses: { visibility: :direct })
   end
 end
diff --git a/db/migrate/20191007013357_update_pt_locales.rb b/db/migrate/20191007013357_update_pt_locales.rb
new file mode 100644
index 000000000..b7288d38a
--- /dev/null
+++ b/db/migrate/20191007013357_update_pt_locales.rb
@@ -0,0 +1,11 @@
+class UpdatePtLocales < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def up
+    User.where(locale: 'pt').in_batches.update_all(locale: 'pt-PT')
+  end
+
+  def down
+    User.where(locale: 'pt-PT').in_batches.update_all(locale: 'pt')
+  end
+end