Skip to content

Conversation

@xHeaven
Copy link
Contributor

@xHeaven xHeaven commented Jan 27, 2026

This PR makes the filename prefix configurable for raw migrations.
Keeps the original Y-m-d prefix and adds a new Uuidv7 prefix. (time-sortable)
The usecase: no collision/confusion/rename need when creating multiple migrations the same day.

@innocenzi
Copy link
Member

I love this. What if the interface accepted the filename so the user could have further control over the final name?

@xHeaven
Copy link
Contributor Author

xHeaven commented Jan 27, 2026

I love this. What if the interface accepted the filename so the user could have further control over the final name?

Only the filename, or a separate property?

@innocenzi
Copy link
Member

I meant this:

interface MigrationNamingStrategy
{
    public function getName(string $filename): string;
}

Not sure if the extension should be given too?

@xHeaven
Copy link
Contributor Author

xHeaven commented Jan 27, 2026

I meant this:

interface MigrationNamingStrategy
{
    public function getName(string $filename): string;
}

Makes sense, I can definitely adapt to this. However, object and up name gets generated entirely differently that raw, do you want to streamline them or we want to handle them separately?

Not sure if the extension should be given too?

I don't think so, raw migrations are .sql, object and up migrations are .php since they are class-based, not sure what benefit would it give us to change this.

What are your thoughts?

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.

2 participants