Skip to content

Running migrations as part of tempest install auth does not create migrations table #1684

@sander-bol

Description

@sander-bol

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

  1. composer create-project tempest/app
  2. php tempest install auth
  3. 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')
  1. Trying to recover from this error by running php tempest migrate:up now also fails, because now the users table 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions