plugin
plugin copied to clipboard
[Bug]: Creating migration when generating Model via plugin uses local datetime in filename and not UTC
Bug description
For this example my local time is now 22nd of March 2024, 11:38. And UTC is 22nd of March 2024, 10:38 (so 1 hour earlier).
When creating a Migration via: Action menu > New Eloquent Model > (checkbox) Create Migration a new migration file is indeed created, but the local time is used in the filename: 2024_03_22_113800_create_my_table.php
.
When I create a migration via the artisan command, the UTC time is used: php artisan make:migration create_my_table
gives 2024_03_22_103800_create_my_table.php
.
This makes the migration created via the artisan command appear and execute "before" the other one which can cause issues when using foreign keys on tables that are not yet created by a now later executed migration.
Should the plugin use UTC time in migration filename as well?
Plugin version
8.1.3.233
Operating system
MacOS
Steps to reproduce
- Create a Migration via the plugin: Action menu > New Eloquent Model > (checkbox) Create Migration
- See the migration filename use local time (which is not always UTC)
- Create a migration via Artisan command:
php artisan make:migration create_my_table
- See the migration filename use UTC time
Relevant log output
No response
That's a very good point. I'll try to fix it. Thank you.
Fixed in 8.1.4