Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgres case insensitive column names #165

Closed
DavidBadura opened this issue Jan 12, 2022 · 2 comments
Closed

postgres case insensitive column names #165

DavidBadura opened this issue Jan 12, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@DavidBadura
Copy link
Member

DavidBadura commented Jan 12, 2022

Postgres columns always seem to be created in lowercase. Saving the data works without any problems. But when reading you get the column names in lowercase.

Example:

recordedOn => recordedon

There is then an error when accessing the array. Another field is also affected: aggregateId.

The solution would be to create the columns in lowersnakecase. But that would be a BC break because you would have to adapt the scheme.

Otherwise you would have to fix the data in the store so that the data can be loaded from Postgres.

@DavidBadura DavidBadura added the bug Something isn't working label Jan 12, 2022
@DanielBadura
Copy link
Member

Since this is a bug i wouldnt mind having a bc but the should first check if the get this fixed without bc

@DavidBadura
Copy link
Member Author

DavidBadura commented Jan 12, 2022

looks like we can fix this with adding this condition in normalizeResult

        if (isset($result['aggregateid']) && isset($result['recordedon'])) {
            $result['aggregateId'] = $result['aggregateid'];
            $result['recordedOn'] = $result['recordedon'];

            unset($result['aggregateid'], $result['recordedon']);
        }

for the 2.x release, we should change the schema to lower snakecase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants