diff options
| author | Alex Gleason <alex@alexgleason.me> | 2022-01-25 15:35:47 +0000 |
|---|---|---|
| committer | Alex Gleason <alex@alexgleason.me> | 2022-01-25 15:35:47 +0000 |
| commit | dd7977bb68f8289b1487159a81df510da11cd944 (patch) | |
| tree | 9266f4bee07fe384076ae6ff6f3b7839cf142942 /priv/repo/migrations | |
| parent | 19d557c870c3ec43dd3b0ee7ea85259a89bd9a80 (diff) | |
| parent | 249fe88d12345c1c93f1812871cd70424b9e9a0d (diff) | |
| download | pleroma-dd7977bb68f8289b1487159a81df510da11cd944.tar.gz pleroma-dd7977bb68f8289b1487159a81df510da11cd944.zip | |
Merge branch 'birth-dates' into 'develop'
Birth dates
See merge request pleroma/pleroma!3608
Diffstat (limited to 'priv/repo/migrations')
| -rw-r--r-- | priv/repo/migrations/20220116183110_add_birthday_to_users.exs | 12 | ||||
| -rw-r--r-- | priv/repo/migrations/20220125104429_add_birthday_month_day_index_to_users.exs | 11 |
2 files changed, 23 insertions, 0 deletions
diff --git a/priv/repo/migrations/20220116183110_add_birthday_to_users.exs b/priv/repo/migrations/20220116183110_add_birthday_to_users.exs new file mode 100644 index 000000000..0b22ecc69 --- /dev/null +++ b/priv/repo/migrations/20220116183110_add_birthday_to_users.exs @@ -0,0 +1,12 @@ +defmodule Pleroma.Repo.Migrations.AddBirthdayToUsers do + use Ecto.Migration + + def change do + alter table(:users) do + add_if_not_exists(:birthday, :date) + add_if_not_exists(:show_birthday, :boolean, default: false, null: false) + end + + create_if_not_exists(index(:users, [:show_birthday])) + end +end diff --git a/priv/repo/migrations/20220125104429_add_birthday_month_day_index_to_users.exs b/priv/repo/migrations/20220125104429_add_birthday_month_day_index_to_users.exs new file mode 100644 index 000000000..8ce4c77c5 --- /dev/null +++ b/priv/repo/migrations/20220125104429_add_birthday_month_day_index_to_users.exs @@ -0,0 +1,11 @@ +defmodule Pleroma.Repo.Migrations.AddBirthdayMonthDayIndexToUsers do + use Ecto.Migration + + def change do + create( + index(:users, ["date_part('month', birthday)", "date_part('day', birthday)"], + name: :users_birthday_month_day_index + ) + ) + end +end |
