summaryrefslogtreecommitdiff
path: root/priv/repo
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2019-05-14 18:15:56 +0700
committerEgor Kislitsyn <egor@kislitsyn.com>2019-05-14 18:15:56 +0700
commit5e2b491276d5cd8d90fddf219f7653d1c9b31ef3 (patch)
treec7d10c01a9b17ba9c732cb43e2097bd26d67e915 /priv/repo
parent1557b99beb3b406572ef2d3baaabed1c9baeca1c (diff)
parentcdcdbd88da76f18c21da7f6f15a29883044902c8 (diff)
downloadpleroma-5e2b491276d5cd8d90fddf219f7653d1c9b31ef3.tar.gz
pleroma-5e2b491276d5cd8d90fddf219f7653d1c9b31ef3.zip
Merge remote-tracking branch 'pleroma/develop' into feature/disable-account
Diffstat (limited to 'priv/repo')
-rw-r--r--priv/repo/migrations/20190408123347_create_conversations.exs26
-rw-r--r--priv/repo/migrations/20190410152859_add_participation_updated_at_index.exs7
-rw-r--r--priv/repo/migrations/20190513175809_change_hide_column_in_filter_table.exs9
3 files changed, 42 insertions, 0 deletions
diff --git a/priv/repo/migrations/20190408123347_create_conversations.exs b/priv/repo/migrations/20190408123347_create_conversations.exs
new file mode 100644
index 000000000..0e0af30ae
--- /dev/null
+++ b/priv/repo/migrations/20190408123347_create_conversations.exs
@@ -0,0 +1,26 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Repo.Migrations.CreateConversations do
+ use Ecto.Migration
+
+ def change do
+ create table(:conversations) do
+ add(:ap_id, :string, null: false)
+ timestamps()
+ end
+
+ create table(:conversation_participations) do
+ add(:user_id, references(:users, type: :uuid, on_delete: :delete_all))
+ add(:conversation_id, references(:conversations, on_delete: :delete_all))
+ add(:read, :boolean, default: false)
+
+ timestamps()
+ end
+
+ create index(:conversation_participations, [:conversation_id])
+ create unique_index(:conversation_participations, [:user_id, :conversation_id])
+ create unique_index(:conversations, [:ap_id])
+ end
+end
diff --git a/priv/repo/migrations/20190410152859_add_participation_updated_at_index.exs b/priv/repo/migrations/20190410152859_add_participation_updated_at_index.exs
new file mode 100644
index 000000000..1ce688c52
--- /dev/null
+++ b/priv/repo/migrations/20190410152859_add_participation_updated_at_index.exs
@@ -0,0 +1,7 @@
+defmodule Pleroma.Repo.Migrations.AddParticipationUpdatedAtIndex do
+ use Ecto.Migration
+
+ def change do
+ create index(:conversation_participations, ["updated_at desc"])
+ end
+end
diff --git a/priv/repo/migrations/20190513175809_change_hide_column_in_filter_table.exs b/priv/repo/migrations/20190513175809_change_hide_column_in_filter_table.exs
new file mode 100644
index 000000000..2ffb88cc9
--- /dev/null
+++ b/priv/repo/migrations/20190513175809_change_hide_column_in_filter_table.exs
@@ -0,0 +1,9 @@
+defmodule Pleroma.Repo.Migrations.ChangeHideColumnInFilterTable do
+ use Ecto.Migration
+
+ def change do
+ alter table(:filters) do
+ modify :hide, :boolean, default: false
+ end
+ end
+end