diff options
| author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-08-18 18:02:09 +0300 |
|---|---|---|
| committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-08-18 18:02:09 +0300 |
| commit | 27e7999a151d8068ec503c9a25aff352f4d31068 (patch) | |
| tree | c6de5995748aee92878514c7a6e24c58f4641c2b /priv/repo/migrations | |
| parent | f50c653c8d63ce8fcffe62d70c61ab464e8e6c8e (diff) | |
| parent | 8d70692abf64244e44ade5ef2055d1a586788dd1 (diff) | |
| download | pleroma-27e7999a151d8068ec503c9a25aff352f4d31068.tar.gz pleroma-27e7999a151d8068ec503c9a25aff352f4d31068.zip | |
Merge remote-tracking branch 'remotes/origin/develop' into 2168-media-preview-proxy
Diffstat (limited to 'priv/repo/migrations')
3 files changed, 45 insertions, 0 deletions
diff --git a/priv/repo/migrations/20200808173046_only_expire_creates.exs b/priv/repo/migrations/20200808173046_only_expire_creates.exs new file mode 100644 index 000000000..9df52956f --- /dev/null +++ b/priv/repo/migrations/20200808173046_only_expire_creates.exs @@ -0,0 +1,19 @@ +defmodule Pleroma.Repo.Migrations.OnlyExpireCreates do + use Ecto.Migration + + def up do + statement = """ + DELETE FROM + activity_expirations a_exp USING activities a, objects o + WHERE + a_exp.activity_id = a.id AND (o.data->>'id') = COALESCE(a.data->'object'->>'id', a.data->>'object') + AND (a.data->>'type' != 'Create' OR o.data->>'type' != 'Note'); + """ + + execute(statement) + end + + def down do + :ok + end +end diff --git a/priv/repo/migrations/20200811143147_ap_id_not_null.exs b/priv/repo/migrations/20200811143147_ap_id_not_null.exs new file mode 100644 index 000000000..df649c7ca --- /dev/null +++ b/priv/repo/migrations/20200811143147_ap_id_not_null.exs @@ -0,0 +1,19 @@ +defmodule Pleroma.Repo.Migrations.ApIdNotNull do + use Ecto.Migration + + require Logger + + def up do + Logger.warn( + "If this migration fails please open an issue at https://git.pleroma.social/pleroma/pleroma/-/issues/new \n" + ) + + alter table(:users) do + modify(:ap_id, :string, null: false) + end + end + + def down do + :ok + end +end diff --git a/priv/repo/migrations/20200817120935_add_invisible_index_to_users.exs b/priv/repo/migrations/20200817120935_add_invisible_index_to_users.exs new file mode 100644 index 000000000..2417d366e --- /dev/null +++ b/priv/repo/migrations/20200817120935_add_invisible_index_to_users.exs @@ -0,0 +1,7 @@ +defmodule Pleroma.Repo.Migrations.AddInvisibleIndexToUsers do + use Ecto.Migration + + def change do + create(index(:users, [:invisible])) + end +end |
