about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-10-11 22:28:11 +0200
committerGitHub <noreply@github.com>2019-10-11 22:28:11 +0200
commitef925f31a66d1cbc95bff11669d05e2924d8ce85 (patch)
treeaadbb60d22a196075fe1faaeeae169e5badead57 /db
parentb3dd0d276d52042828e11bf325015f5d7f4624ca (diff)
parent877e8c9d799eae663526609642e0c0c9a4612bda (diff)
Merge pull request #1233 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20181024224956_migrate_account_conversations.rb2
-rw-r--r--db/migrate/20191007013357_update_pt_locales.rb11
-rw-r--r--db/schema.rb26
3 files changed, 37 insertions, 2 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
diff --git a/db/schema.rb b/db/schema.rb
index d9c4f7a37..eb86a9f68 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: 2019_10_01_213028) do
+ActiveRecord::Schema.define(version: 2019_10_07_013357) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -706,6 +706,30 @@ ActiveRecord::Schema.define(version: 2019_10_01_213028) do
     t.index ["tag_id", "status_id"], name: "index_statuses_tags_on_tag_id_and_status_id", unique: true
   end
 
+  create_table "stream_entries", force: :cascade do |t|
+    t.bigint "activity_id"
+    t.string "activity_type"
+    t.datetime "created_at", null: false
+    t.datetime "updated_at", null: false
+    t.boolean "hidden", default: false, null: false
+    t.bigint "account_id"
+    t.index ["account_id", "activity_type", "id"], name: "index_stream_entries_on_account_id_and_activity_type_and_id"
+    t.index ["activity_id", "activity_type"], name: "index_stream_entries_on_activity_id_and_activity_type"
+  end
+
+  create_table "subscriptions", force: :cascade do |t|
+    t.string "callback_url", default: "", null: false
+    t.string "secret"
+    t.datetime "expires_at"
+    t.boolean "confirmed", default: false, null: false
+    t.datetime "created_at", null: false
+    t.datetime "updated_at", null: false
+    t.datetime "last_successful_delivery_at"
+    t.string "domain"
+    t.bigint "account_id", null: false
+    t.index ["account_id", "callback_url"], name: "index_subscriptions_on_account_id_and_callback_url", unique: true
+  end
+
   create_table "tags", force: :cascade do |t|
     t.string "name", default: "", null: false
     t.datetime "created_at", null: false