Move field migration logic out of drush command

Created on 16 July 2024, 5 months ago

Problem/Motivation

If you want to migrate date fields via code, currently you have to either copy the logic from \Drupal\smart_date\Commands\SmartDateDrushCommands::migrate() or call the drush command (which is fragile). Ideally drush commands should be wrappers around functionality exposed by the module. An example of working around this issue can be seen in 💬 How to run migration script in a post-update hook Needs review .

Steps to reproduce

Try to write a function in a custom module that migrates date fields to smart dates.

Proposed resolution

Create a new service that supports migrating fields and call that from the drush command.

Remaining tasks

Do it.

User interface changes

None

API changes

There will be a new service with a migrate() method.

Data model changes

None

📌 Task
Status

Needs review

Version

4.1

Component

Code

Created by

🇬🇧United Kingdom AndyF

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024