Skip to content

Commit

Permalink
Do not invoke old data migrations inside of migrations any more
Browse files Browse the repository at this point in the history
  • Loading branch information
PragTob committed Oct 5, 2024
1 parent 5821ad3 commit 88e1f66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 88e1f66

Please sign in to comment.