[00:03] minor release contained a fix for a very annoying problem to me personally. I tweeted about it recently. So, with migrations, LLMs often make something like this. So, migrations within the same second. It was happening very [00:20] rarely, but when it does, it actually breaks the things and it was very annoying. So, let me explain why it was happening, what it was breaking, and what is the actual fix in the newest Laravel version. So, this is the same [00:32] project with fixed migration order. As you can see, no same second migration, but if we take a look at client contacts table, there's a foreign ID to client. And originally, how LLM generated those migrations was in the same second. So, [00:46] let me reproduce that again. So, let's rename that migration file to be at the same second as clients table, exactly like it was as LLM generated. So, we have something like this, same second timestamp, and see the order then [01:01] changes because the order is then alphabetical, which means that client contacts migration would be executed first before clients table even exists. with foreign key, and you would think that Opus 4.8 would catch that and fix [01:19] it. But not necessarily. Let me show you why. It depends on which database you actually using, MySQL or SQLite. On MySQL, it would throw an error. On SQLite, not necessarily. So, let's change that to SQLite and comment all [01:34] the others and run migrate fresh. So, I have migrate fresh, and as you can see, no error. Although, the order of migrations, as you can see, client contacts happened before clients, but for SQLite with foreign key behavior, [01:52] it's no big deal. It works. So, if the AI agent works with SQLite, it will not even see the error. But, as soon as I get back to MySQL and relaunch migrate [02:04] fresh with seed or without, as you can see, the error is clear. Failed to open table clients because, well, it doesn't exist yet. And the underlying reason of this happening is this. So, probably for efficiency, often LLMs try to combine a [02:22] few commands in one terminal thing like make this and make that and make, for example, filament resource multiple resources in one command or something like that. I've seen that multiple times depending on the model. And then, of [02:35] course, generating of migration happens well at the same second or a second after that there's another batch of migrations. So, yeah, this may be the result. Of course, again, it happens really randomly, but it does happen. [02:50] But, luckily for me and for Laravel community, my Twitter account is pretty influential. So, a lot of people that, so push back from the core Laravel team noticed my tweet and submitted a pull request with the fix. But, also [03:04] after that, another person, Nick, submitted his version of the pull request. After seeing push back version, he submitted kind of the same but a bit more improved pull request. So, that was 22 hours ago yesterday, and then Taylor [03:20] merged that commit basically almost right away. So, this is how fast things can happen. So, thank you to Push Back, Taylor, and Nick for reacting so quickly. Let's try the fix. So, in the same project, I'll run composer update [03:35] to update to the latest Laravel version of 13.20, and then I will try to run make model in the same second. So, yeah, as you can see, new version is out. And let's try PHP artisan something like this. So, [03:49] fictional models task and then task subtask and let's see what happens now. So although it technically happened in the same second, the timestamp is different. So the solution by Push Back in the original pull request in the [04:04] first one was to check the migration directory and then forward one second at a time until finds a free prefix. So this was the solution, get the path with [04:16] date prefix and then while not empty then add But Nick argued in the comment that Push Back's solution had some backwards Back's solution had some backwards compatibility issues and Nick's solution [04:29] was a bit deeper. So new function renamed collision free path instead of path and a bit more logic on top to get the current migration path and then also [04:41] while but a bit different while a bit more thorough with backwards more thorough with backwards compatibility with tests also covering the cases. So as the final proof let's run three models in a row with same [04:54] run three models in a row with same prefix and as you can see 060708 although technically it was in the same second. So yep, the solution does work well. Thank you Nick and Push Back and Taylor again. And there were more things [05:08] released, many more things in the latest 13.20 of Laravel framework. So a lot of small changes in the minor versions, see the list it's pretty impressive from the community and the core team so I will link that in the description below so [05:23] you may find something interesting for your specific cases. And I will keep channel so subscribe to the channel to not miss any of those videos and see you not miss any of those videos and see you guys in other videos.