Skip to content

Commit cf00f3a

Browse files
committed
add quick data migration utility for Works
1 parent f3996e2 commit cf00f3a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/banchan/works/works.ex

+11
Original file line numberDiff line numberDiff line change
@@ -536,4 +536,15 @@ defmodule Banchan.Works do
536536
def delete_work(%Work{} = work) do
537537
Repo.delete(work)
538538
end
539+
540+
## Data Migration
541+
542+
@doc """
543+
If site was made pre-Works, this needs to be run to bring over all the
544+
legacy gallery/portfolio images.
545+
"""
546+
def migrate_from_legacy(%User{} = actor) do
547+
:ok = Workers.MigratePortfolioImages.queue_migration(actor)
548+
:ok = Workers.MigrateGalleryImages.queue_migration(actor)
549+
end
539550
end

0 commit comments

Comments
 (0)