diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2021-02-07 22:24:12 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2021-02-07 22:24:12 +0300 |
commit | d1c6dd97aa503ca7c897d67d98fe8c924e113a61 (patch) | |
tree | 337e5fb61f36e458bfdfca4f925b7c063d6348b0 /priv/repo/migrations | |
parent | 4e14945670bac15a6e183eb8c552d6e0669713ac (diff) | |
download | pleroma-d1c6dd97aa503ca7c897d67d98fe8c924e113a61.tar.gz pleroma-d1c6dd97aa503ca7c897d67d98fe8c924e113a61.zip |
[#3213] Partially addressed code review points.
migration rollback task changes, hashtags-related config handling tweaks, `hashtags.data` deletion (unused).
Diffstat (limited to 'priv/repo/migrations')
-rw-r--r-- | priv/repo/migrations/20201221202251_create_hashtags.exs | 1 | ||||
-rw-r--r-- | priv/repo/migrations/20201221202252_remove_data_from_hashtags.exs | 15 |
2 files changed, 15 insertions, 1 deletions
diff --git a/priv/repo/migrations/20201221202251_create_hashtags.exs b/priv/repo/migrations/20201221202251_create_hashtags.exs index afc522002..8d2e9ae66 100644 --- a/priv/repo/migrations/20201221202251_create_hashtags.exs +++ b/priv/repo/migrations/20201221202251_create_hashtags.exs @@ -4,7 +4,6 @@ defmodule Pleroma.Repo.Migrations.CreateHashtags do def change do create_if_not_exists table(:hashtags) do add(:name, :citext, null: false) - add(:data, :map, default: %{}) timestamps() end diff --git a/priv/repo/migrations/20201221202252_remove_data_from_hashtags.exs b/priv/repo/migrations/20201221202252_remove_data_from_hashtags.exs new file mode 100644 index 000000000..0442c3b87 --- /dev/null +++ b/priv/repo/migrations/20201221202252_remove_data_from_hashtags.exs @@ -0,0 +1,15 @@ +defmodule Pleroma.Repo.Migrations.RemoveDataFromHashtags do + use Ecto.Migration + + def up do + alter table(:hashtags) do + remove_if_exists(:data, :map) + end + end + + def down do + alter table(:hashtags) do + add_if_not_exists(:data, :map, default: %{}) + end + end +end |