refactor(orm): rename seeds directory to seeders (Laravel parity)#173
Merged
Conversation
Rename the ORM seeder directory from 'seeds' to 'seeders' to match Laravel's database/seeders convention, and update every reference. - Rename core package masoniteorm/seeds -> masoniteorm/seeders (import path is now fastapi_startkit.masoniteorm.seeders) - Change the default --directory / seed_path from databases/seeds to databases/seeders across db:seed, seed (make:seed), make:model, migrate:fresh, and migrate:refresh - Update the create_seed stub import (also fixing its previously incorrect module prefix so generated seeders import correctly) - Rename example app seeder directories and update their imports - Update the database SKILL doc snippet
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Cover Seeder.call() ordering/connection propagation, run_database_seed and run_specific_seed happy/error paths via pydoc.locate, and the full DBSeedCommand handle path (default DatabaseSeeder, table argument, --class variants, connection default/override, and not-found errors) using cleo's CommandTester against sqlite-safe fixture seeder modules.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Renames the ORM seeder directory from
seedstoseedersto match Laravel'sdatabase/seedersconvention, and sweeps every reference across the core package, console commands, stubs, example apps, and docs so nothing breaks.Changes
Core package
masoniteorm/seeds/→masoniteorm/seeders/(public import path is nowfastapi_startkit.masoniteorm.seeders)from ..seeds import SeederinDBSeedCommand--directory/seed_pathfromdatabases/seeds→databases/seedersin:db:seed,seed(make:seed),make:model(--seeders-directory),migrate:fresh,migrate:refresh, and theSeederconstructor defaultcreate_seed.stub— applied the rename and corrected its module prefix (wasmasoniteorm.seeds, nowfastapi_startkit.masoniteorm.seeders) so generated seeder files import correctly, matching the example appsExample apps
example/database-app/databases/seeds/→seeders/and updated all 6 seeder importsexample/inertia-pingcrm-app/databases/seeds/database_seeder.pyinto the existingseeders/directory (that app already had aseeders/), updated its import, and removed the leftoverseeds/dirDocs / skills
Verification
from fastapi_startkit.masoniteorm.seeders import Seederresolves; defaultseed_pathis nowdatabases/seedersdatabases/seeds/masoniteorm.seedsreferences remainNote for reviewer
The stub previously imported from
masoniteorm.seeds(missing thefastapi_startkit.prefix) — I corrected the prefix while renaming so generated seeders actually import. Flagging in case that behavioral fix should be split out.