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

Module doesn't work on Postgres #201

Open
elliot-sawyer opened this issue Aug 8, 2023 · 1 comment
Open

Module doesn't work on Postgres #201

elliot-sawyer opened this issue Aug 8, 2023 · 1 comment

Comments

@elliot-sawyer
Copy link

[2023-08-08 04:07:32] error-log.ERROR: Couldn't run query: INSERT INTO "Package" ("ClassName", "Name", "Version", "Type", "Description", "Supported", "LastEdited", "Created") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) ERROR: value too long for type character varying(255) {"exception":"[object] (SilverStripe\\ORM\\Connect\\DatabaseException(code: 0): Couldn't run query:\n\nINSERT INTO \"Package\"\n (\"ClassName\", \"Name\", \"Version\", \"Type\", \"Description\", \"Supported\", \"LastEdited\", \"Created\")\n VALUES\n ($1, $2, $3, $4, $5, $6, $7, $8)\n\nERROR: value too long for type character varying(255) at /var/www/html/vendor/silverstripe/framework/src/ORM/Connect/DBConnector.php:64)"} []

Issue seems to be when one of the fields (guessing Description) contains a value that's too long to fit in the column. MySQL will truncate the value to fit, while Postgres will reject it for being too long

To get around this, I passed in the following YML:


BringYourOwnIdeas\Maintenance\Model\Package:
  db:
    Name: Text
    Description: Text
    Version: Text
    Type: Text

Not sure I should make a PR for this, since Postgres isn't a requirement to run, but leaving this here in case it helps someone else

@GuySartorelli
Copy link
Collaborator

Hi, thanks for this.
We probably don't want the description being truncated - if that is the only field being problematic, I'd support a pull request that changes the db type for Description to Text.
If you'd like to submit a pull request making that change, I'll happily review it.

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

No branches or pull requests

2 participants