cakephp / cakephp/phinx

How to group seeds?

Open
#1,389 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
PHP
Stars
4.5k
Forks
884
PR merge metrics
No merged PRs in 30d

Description

Is it possible to group seeds into categories/groups?

My use case is I'm converting an old application into more modern practices, DB migrations being one of them. The application stores alot of configuration options in the DB so I have created seeds for them and then used faker to populate the other tables.

This is fine for development but on live I would like to seed only the configuration tables and not everything else. I understand I could run -s ConfigSeeder for example but this then becomes very clunky adding multiple seeders.

Is there away to group seeds together to avoid this?
Thank You

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing how seeders are currently selected from the command line, including the mentioned -s ConfigSeeder usage, and how multiple seeders are executed. Define what grouping or category selection should look like for running only configuration seeds, then verify that the approach avoids requiring each seeder to be listed individually.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.