tempest-framework
tempest-framework copied to clipboard
Running migrations as part of `tempest install auth` does not create migrations table
Tempest version
2.5
PHP version
8.4
Operating system
macOS
Description
Another one of my "rocky start" bugs (I'm really good at doing stuff you did not expect new users to do, it seems :D).
If you have not run migrations before, answering Yes to the migration question in tempest install auth ends up with an error due to the migrations table not yet existing. Running migrate:up before doing the install works, but is not documented as a required step for getting started.
Perhaps the migrate:up command does preflight checks that are skipped when going via tempest install ?
Steps to reproduce
-
composer create-project tempest/app -
php tempest install auth - Yes to all the steps, specifically "Do you want to execute migrations?" (defaults to No).
× // Tempest\Database\Exceptions\QueryWasInvalid
× // SQLSTATE[HY000]: General error: 1 no such table: migrations
INSERT INTO `migrations` (`name`, `hash`) VALUES ('0000-00-00_create_users_table', '8176018ac1ea405ef12fad65424a0c72')
- Trying to recover from this error by running
php tempest migrate:upnow also fails, because now theuserstable already exists, without the migration being tracked by the previous attempt.
Tried to dive into the code, but didn't have enough time yet to pinpoint the cause of this.