From 647e89b69d439afc5ff4d8c1dc2b535c29ea57a4 Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Tue, 2 Jan 2024 10:37:36 -0500 Subject: [PATCH] feat: Add migration to add override column to test groups table (#2338) --- config/dev.exs | 4 +++- ...0231220204054_add_override_for_test_groups.exs | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 priv/repo/migrations/20231220204054_add_override_for_test_groups.exs diff --git a/config/dev.exs b/config/dev.exs index bc0edac42..7fbda5215 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -72,4 +72,6 @@ config :phoenix, :stacktrace_depth, 20 config :phoenix, :plug_init_mode, :runtime # Don't report issues with migrations from before we introduced excellent_migrations -config :excellent_migrations, start_after: "20230908133314" +config :excellent_migrations, + start_after: "20230908133314", + skip_checks: [:column_added_with_default] diff --git a/priv/repo/migrations/20231220204054_add_override_for_test_groups.exs b/priv/repo/migrations/20231220204054_add_override_for_test_groups.exs new file mode 100644 index 000000000..ae163d137 --- /dev/null +++ b/priv/repo/migrations/20231220204054_add_override_for_test_groups.exs @@ -0,0 +1,15 @@ +defmodule Skate.Repo.Migrations.AddOverrideForTestGroups do + use Ecto.Migration + + def change do + # excellent_migrations:safety-assured-for-this-file raw_sql_executed + execute( + "CREATE TYPE test_group_override AS ENUM ('none', 'enabled', 'disabled')", + "DROP TYPE test_group_override" + ) + + alter table(:test_groups) do + add(:override, :test_group_override, default: "none", null: false) + end + end +end