logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 61bae9a407ae9480e46e3a33d0b7d1f4c940b02c
parent e3d394eef64f96210b144c40d3055d0662da7109
Author: marcin mikołajczak <git@mkljczk.pl>
Date:   Sun, 23 Jan 2022 09:54:24 +0100

Create index for `show_birthday`

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>

Diffstat:

Apriv/repo/migrations/20220116183110_add_birthday_to_users.exs12++++++++++++
Dpriv/repo/migrations/29220116183110_add_birth_date_to_users.exs10----------
2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/priv/repo/migrations/20220116183110_add_birthday_to_users.exs 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/29220116183110_add_birth_date_to_users.exs b/priv/repo/migrations/29220116183110_add_birth_date_to_users.exs @@ -1,10 +0,0 @@ -defmodule Pleroma.Repo.Migrations.AddBirthDateToUsers 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 - end -end