Fix Exiftool migration id #763

Merged
floatingghost merged 1 commits from Oneric/akkoma:fix-migration-timeline-exifdesc into develop 2024-05-06 22:51:06 +00:00
Member

See #744 (comment)

Applying works fine with a 20220220135625 version, but it won’t be
rolled back in the right order. Fortunately this action is idempotent
so we can just rename and reapply it with a new id.

To also not break large-scale rollbacks past 2022 for anyone
who already applied it with the old id, keep a stub migration.

See https://akkoma.dev/AkkomaGang/akkoma/pulls/744#issuecomment-11882 Applying works fine with a 20220220135625 version, but it won’t be rolled back in the right order. Fortunately this action is idempotent so we can just rename and reapply it with a new id. To also not break large-scale rollbacks past 2022 for anyone who already applied it with the old id, keep a stub migration.
Oneric added 1 commit 2024-04-27 17:20:58 +00:00
ci/woodpecker/pr/build-amd64 Pipeline is pending Details
ci/woodpecker/pr/build-arm64 Pipeline is pending Details
ci/woodpecker/pr/docs Pipeline is pending Details
ci/woodpecker/pr/lint Pipeline is pending Details
ci/woodpecker/pr/test Pipeline is pending Details
905cbc6d60
Fix Exiftool migration id
Applying works fine with a 20220220135625 version, but it won’t be
rolled back in the right order. Fortunately this action is idempotent
so we can just rename and reapply it with a new id.

To also not break large-scale rollbacks past 2022 for anyone
who already applied it with the old id, keep a stub migration.
floatingghost reviewed 2024-05-06 21:49:27 +00:00
@ -1,37 +1,10 @@
defmodule Pleroma.Repo.Migrations.UploadFilterExiftoolToExiftoolStripMetadata do
defmodule Pleroma.Repo.Migrations.UploadFilterExiftoolToExiftoolStripMetadataStub do

gonna be pedantic

the filename should match the module name

also also, this filename causes migrations to fail from older versions - it works from current dev/stable, but not before

$ git checkout v3.12.2 # 2024.03
$ mix ecto.reset # get us a default DB
$ git checkout oneric/fix-migration-timeline-exifdesc
$ mix ecto.migrate
** (Ecto.MigrationError) migrations can't be executed, migration name upload_filter_exiftool_to_exiftool_strip_location is duplicated

running

mv 
priv/repo/migrations/20220220135625_upload_filter_exiftool_to_exiftool_strip_location.exs 
priv/repo/migrations/20220220135625_upload_filter_exiftool_to_exiftool_strip_location_stub.exs

causes this to succeed

gonna be pedantic the filename should match the module name also also, this filename causes migrations to fail from older versions - it works from current dev/stable, but not before ```bash $ git checkout v3.12.2 # 2024.03 $ mix ecto.reset # get us a default DB $ git checkout oneric/fix-migration-timeline-exifdesc $ mix ecto.migrate ** (Ecto.MigrationError) migrations can't be executed, migration name upload_filter_exiftool_to_exiftool_strip_location is duplicated ``` running ```bash mv priv/repo/migrations/20220220135625_upload_filter_exiftool_to_exiftool_strip_location.exs priv/repo/migrations/20220220135625_upload_filter_exiftool_to_exiftool_strip_location_stub.exs ``` causes this to succeed
Author
Member

good catch! If filenames can become important though, it’s probably safer to leave the original filename as is. So the 2022 version now keeps its name and module and filename of the 2024 are now changed to include a _real/Real suffix

migrations from 3.12.2 now work for me

good catch! If filenames can become important though, it’s probably safer to leave the original filename as is. So the 2022 version now keeps its name and module and filename of the 2024 are now changed to include a `_real`/`Real` suffix migrations from 3.12.2 now work for me
Oneric marked this conversation as resolved
Oneric force-pushed fix-migration-timeline-exifdesc from 905cbc6d60 to 5256678901 2024-05-06 22:31:56 +00:00 Compare

indeedy they do :nod:

thankies

indeedy they do :nod: thankies
floatingghost merged commit ee03149ba1 into develop 2024-05-06 22:51:06 +00:00
floatingghost deleted branch fix-migration-timeline-exifdesc 2024-05-06 22:51:06 +00:00
Sign in to join this conversation.
No description provided.