wunderio / ddev-drupal

Work in progress of template for DDEV Drupal projects
0 stars 0 forks source link

#16 run config import updb after import #26

Open hkirsman opened 2 months ago

hkirsman commented 2 months ago

Overview

On one hand we'd like to have all needed database actions done after import:

Then gain sometimes we don't want to run anything at all.

This PR adds all of the possible database actions to post db hook but also introduces new command that ignores the post actions: ddev import-db-no-hooks It's wrapper for the ddev import-db so all the arguments work. What it does is that it temporarily comments out the post-import-db lines in config.wunderio.yaml, then puts it back after import.

Screenshots

New command that does not run hooks 2024-04-23_16-56

By default import config, update db, clear caches, sanitize db: 2024-04-23_17-09

Maybe some day they'll implement the --no-hooks flag https://github.com/ddev/ddev/issues/2129

Testing

  1. Install this update to your site: ddev composer require wunderio/ddev-drupal:dev-feature/16-run-config-import-updb-after-import --dev

  2. Try the new command with your sql: ddev import-db-skip-hooks --file=example.sql

  3. Try the default import: ddev import-db --file=example.sql