diff options
author | marcin mikołajczak <git@mkljczk.pl> | 2022-01-23 09:54:24 +0100 |
---|---|---|
committer | marcin mikołajczak <git@mkljczk.pl> | 2022-01-23 12:07:05 +0100 |
commit | 61bae9a407ae9480e46e3a33d0b7d1f4c940b02c (patch) | |
tree | 5aaee8ef406119383bc87c906ff3cc6c855e1a55 /priv/repo/migrations/20220116183110_add_birthday_to_users.exs | |
parent | e3d394eef64f96210b144c40d3055d0662da7109 (diff) | |
download | pleroma-61bae9a407ae9480e46e3a33d0b7d1f4c940b02c.tar.gz pleroma-61bae9a407ae9480e46e3a33d0b7d1f4c940b02c.zip |
Create index for `show_birthday`
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'priv/repo/migrations/20220116183110_add_birthday_to_users.exs')
-rw-r--r-- | priv/repo/migrations/20220116183110_add_birthday_to_users.exs | 12 |
1 files changed, 12 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 |