From 20e122a766d14c707947098b66f1bd2d4961aa3f Mon Sep 17 00:00:00 2001 From: Rui Lopes Date: Mon, 5 Feb 2024 13:39:20 +0000 Subject: [PATCH] fix: migrations --- .../migrations/20210218152530_create_spotlights.exs | 2 +- .../20240205133722_change_spotlight_column.exs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 priv/repo/migrations/20240205133722_change_spotlight_column.exs diff --git a/priv/repo/migrations/20210218152530_create_spotlights.exs b/priv/repo/migrations/20210218152530_create_spotlights.exs index 4d7c6140..07cc4cbb 100644 --- a/priv/repo/migrations/20210218152530_create_spotlights.exs +++ b/priv/repo/migrations/20210218152530_create_spotlights.exs @@ -3,7 +3,7 @@ defmodule Safira.Repo.Migrations.CreateSpotlights do def change do create table(:spotlights) do - add :end, :utc_datetime + add :active, :boolean, default: false, null: false add :badge_id, references(:badges, on_delete: :nothing) add :lock_version, :integer, default: 1 diff --git a/priv/repo/migrations/20240205133722_change_spotlight_column.exs b/priv/repo/migrations/20240205133722_change_spotlight_column.exs new file mode 100644 index 00000000..442ceff2 --- /dev/null +++ b/priv/repo/migrations/20240205133722_change_spotlight_column.exs @@ -0,0 +1,10 @@ +defmodule Safira.Repo.Migrations.ChangeSpotlightColumn do + use Ecto.Migration + + def change do + alter table(:spotlights) do + remove :active + add :end, :utc_datetime + end + end +end