Skip to content

Conversation

NewZAZ
Copy link
Contributor

@NewZAZ NewZAZ commented Jul 14, 2025

πŸ”— Linked issue

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Seeders with a number above 9 start over when you launch the seeders, so I added the same functionality as migrations. I added an optional naturalSort.

πŸ“ Checklist

@NewZAZ NewZAZ marked this pull request as draft July 14, 2025 08:46
@NewZAZ NewZAZ marked this pull request as ready for review July 14, 2025 09:34
@thetutlage
Copy link
Member

Should the order of seeders matter?

@NewZAZ
Copy link
Contributor Author

NewZAZ commented Jul 15, 2025

Should the order of seeders matter?

Yes, because personally I have quite a few seeders, over 10 seeders, and I have to keep the right order, because things depend on other things etc...

@RomainLanz
Copy link
Member

Should the order of seeders matter?

Yes, we do need that feature, especially when seeders depend on each other.

Also, the current documentation is inaccurate. The ordering described there doesn't actually work without the changes proposed in this PR:

https://lucid.adonisjs.com/docs/seeders#customizing-seeders-order

@thetutlage thetutlage merged commit 5b63a48 into adonisjs:21.x Jul 21, 2025
16 checks passed
@thetutlage
Copy link
Member

@NewZAZ Thanks for the PR :)

@Clement-Z4RM
Copy link

Also, the current documentation is inaccurate. The ordering described there doesn't actually work without the changes proposed in this PR:

https://lucid.adonisjs.com/docs/seeders#customizing-seeders-order

These changes work well in my case without the changes of the actual PR

@NewZAZ
Copy link
Contributor Author

NewZAZ commented Aug 18, 2025

Also, the current documentation is inaccurate. The ordering described there doesn't actually work without the changes proposed in this PR:
https://lucid.adonisjs.com/docs/seeders#customizing-seeders-order

These changes work well in my case without the changes of the actual PR

adonisjs/lucid.adonisjs.com#55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants