From 88e1f66ca8fde3c4c26c9f95a7a892f7477ddec5 Mon Sep 17 00:00:00 2001 From: Tobias Pfeiffer Date: Sat, 5 Oct 2024 09:08:01 +0200 Subject: [PATCH] Do not invoke old data migrations inside of migrations any more --- .../20210314114416_execute_migrate_idea_labels.exs | 10 ++++------ ...62733_migrate_idea_labels_to_idea_idea_labels.exs | 12 ++++-------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/priv/repo/migrations/20210314114416_execute_migrate_idea_labels.exs b/priv/repo/migrations/20210314114416_execute_migrate_idea_labels.exs index 9506915c..229a1a01 100644 --- a/priv/repo/migrations/20210314114416_execute_migrate_idea_labels.exs +++ b/priv/repo/migrations/20210314114416_execute_migrate_idea_labels.exs @@ -1,13 +1,11 @@ defmodule Mindwendel.Repo.Migrations.ExecuteMigrateIdeaLabels do - # Remember to always use a relative file to the priv directory of the elixir app. - # Therefore, we are using `:code.priv_dir(:mindwendel)` - # See https://elixirforum.com/t/handling-relative-paths-inside-my-mix-project/28974 - Code.require_file("#{:code.priv_dir(:mindwendel)}/repo/data_migrations/migrate_idea_labels.exs") - use Ecto.Migration + # There used to be code here, but the migration is so old it's not worth keeping significant code + # and its tests around. No one needs a 2 year+ old data migration, or so I hope. + # However, the migration already ran/is saved in the `schema_migrations` so removing it would also + # be confusing. Hence, it's kept empty. def up do - Mindwendel.Repo.DataMigrations.MigrateIdealLabels.run() end # We do nothing here diff --git a/priv/repo/migrations/20220220162733_migrate_idea_labels_to_idea_idea_labels.exs b/priv/repo/migrations/20220220162733_migrate_idea_labels_to_idea_idea_labels.exs index 9e3f0c82..a6178e77 100644 --- a/priv/repo/migrations/20220220162733_migrate_idea_labels_to_idea_idea_labels.exs +++ b/priv/repo/migrations/20220220162733_migrate_idea_labels_to_idea_idea_labels.exs @@ -1,15 +1,11 @@ defmodule Mindwendel.Repo.Migrations.MigrateIdeaLabelsToIdeaIdeaLabels do - # Remember to always use a relative file to the priv directory of the elixir app. - # Therefore, we are using `:code.priv_dir(:mindwendel)` - # See https://elixirforum.com/t/handling-relative-paths-inside-my-mix-project/28974 - Code.require_file( - "#{:code.priv_dir(:mindwendel)}/repo/data_migrations/migrate_idea_labels_to_idea_idea_labels.exs" - ) - use Ecto.Migration + # There used to be code here, but the migration is so old it's not worth keeping significant code + # and its tests around. No one needs a 2 year+ old data migration, or so I hope. + # However, the migration already ran/is saved in the `schema_migrations` so removing it would also + # be confusing. Hence, it's kept empty. def up do - Mindwendel.Repo.DataMigrations.MigrateIdeaLabelsToIdeaIdeaLabels.run() end # We do nothing here