Skip to content

Schema: insert fixture rows with column types #122

Open

Description

@temp

Part of #102. Line numbers refer to branch chore/php-8.4-dependabot (#98). Verified = reproduced, suspected = from reading the code.

  • Every applyData() calls $connection->insert($table, $row) without $types. Verified on SQLite.
    • false on a boolean column is stored as '', so WHERE active = 0 finds nothing. MySQL strict mode probably rejects it (suspected).
    • DateTimeImmutable values throw "could not be converted to string".
    • Arrays for JSON columns are stored as the string Array.

Fix: take the column types from the SchemaBuilder's schema and pass them as $types.

Breaking: stored values change, e.g. false becomes 0. Tests that assert the wrong values start failing. This could also ship in 7.x as an opt-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions