From 104a7fc26a7afe29d6a6353d68ec7346730d6574 Mon Sep 17 00:00:00 2001 From: tom Date: Tue, 25 Jul 2023 01:31:25 +0200 Subject: [PATCH] Remove the old upgrade DB migration from v1.1.0 --- CHANGELOG.md | 3 +- ...0000000001_ensure_columns_are_not_null.exs | 34 ------------------- 2 files changed, 2 insertions(+), 35 deletions(-) delete mode 100644 priv/ecto_repo/migrations/00000000000001_ensure_columns_are_not_null.exs diff --git a/CHANGELOG.md b/CHANGELOG.md index 7db52918..20737ce0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Add support for Elixir 1.15. Drop support for Elixir 1.12. Elixir >= 1.13 is now required. Dropping support for older versions of Elixir simply means that this package is no longer tested with them in CI, and that compatibility issues are not considered bugs. * Drop support for Erlang/OTP 23, and Erlang/OTP >= 24 is now required. Dropping support for older versions of Erlang/OTP simply means that this package is not tested with them in CI, and that no compatibility issues are considered bugs. +* Removed from the repo the [DB migration](https://github.com/tompave/fun_with_flags/blob/v1.1.0/priv/ecto_repo/migrations/00000000000001_ensure_columns_are_not_null.exs) added in [v1.1.0](https://github.com/tompave/fun_with_flags/blob/master/CHANGELOG.md#v110) (November 2018), as an upgrade step. After almost 5 years, chances are that users of the library are already using the correct schema, and that extra "upgrade" migration is incompatible with RDBMS other than Postgres and MySQL. ## v1.10.1 @@ -109,7 +110,7 @@ There is no other change in this release, but this is a minor version bump becau * Drop support for OTP 19. OTP >= 20 is now required. * Update to Ecto 3 with the `ecto_sql` package. * Update to Redix 0.8 and Redix.PubSub 0.5. -* Ecto persistence: add `NOT NULL` constraints to the table definition in the Ecto migration. This is not a breaking change: the constraints have been added because those values are never null anyway. If users of the library want to add them, they can do so by adding [this migration](https://github.com/tompave/fun_with_flags/blob/master/priv/ecto_repo/migrations/00000000000001_ensure_columns_are_not_null.exs) to their projects. +* Ecto persistence: add `NOT NULL` constraints to the table definition in the Ecto migration. This is not a breaking change: the constraints have been added because those values are never null anyway. If users of the library want to add them, they can do so by adding [this migration](https://github.com/tompave/fun_with_flags/blob/v1.1.0/priv/ecto_repo/migrations/00000000000001_ensure_columns_are_not_null.exs) to their projects. * Redis persistence: allow to configure the Redis URL with a system tuple to read it from an environment variable. (Thanks [seangeo](https://github.com/seangeo), [pull/29](https://github.com/tompave/fun_with_flags/pull/29)) ## v1.0.0 diff --git a/priv/ecto_repo/migrations/00000000000001_ensure_columns_are_not_null.exs b/priv/ecto_repo/migrations/00000000000001_ensure_columns_are_not_null.exs deleted file mode 100644 index 8e3e76ca..00000000 --- a/priv/ecto_repo/migrations/00000000000001_ensure_columns_are_not_null.exs +++ /dev/null @@ -1,34 +0,0 @@ -defmodule FunWithFlags.Dev.EctoRepo.Migrations.EnsureColumnsAreNotNull do - use Ecto.Migration - # - # Use this migration to add the `not null` constraints to the - # table created using the `CreateFeatureFlagsTable` migration - # from versions `<= 1.0.0`. - # - # If the table has been created with a migration from `>= 1.1.0`, - # then the `not null` constraints are already there and there - # is no need to run this migration. In that case, this migration - # is a no-op. - # - # This migration assumes the default table name of "fun_with_flags_toggles" - # is being used. If you have overridden that via configuration, you should - # change this migration accordingly. - - def up do - alter table(:fun_with_flags_toggles) do - modify :flag_name, :string, null: false - modify :gate_type, :string, null: false - modify :target, :string, null: false - modify :enabled, :boolean, null: false - end - end - - def down do - alter table(:fun_with_flags_toggles) do - modify :flag_name, :string, null: true - modify :gate_type, :string, null: true - modify :target, :string, null: true - modify :enabled, :boolean, null: true - end - end -end