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: creation of custom fields #101

Closed
mavuio opened this issue May 28, 2019 · 0 comments
Closed

postgres: creation of custom fields #101

mavuio opened this issue May 28, 2019 · 0 comments
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@mavuio
Copy link

mavuio commented May 28, 2019

Describe the bug
when creating a new custom field via a plugin the field cannot be created because
postgres complains when trying to create the fields

To Reproduce
❖ have at least one product in the products database
❖ create demo plugin:

import { VendurePlugin } from "@vendure/core";
export class DemoPlugin implements VendurePlugin {
  configure(config) {
    config.customFields.Product.push({
      type: "string",
      name: "dimensions"
    });
    return config;
  }
}

❖ yarn start
❖ see Error:


error 5/28/19, 10:27 AM - [TypeORM] Query error: error: column "customFieldsDimensions" contains null values, "ALTER TABLE "product" ADD "customFieldsDimensions" character varying NOT NULL" -- [undefined]
error 5/28/19, 10:27 AM - [TypeOrmModule] Unable to connect to the database. Retrying (2)... trace:
QueryFailedError: column "customFieldsDimensions" contains null values
    at new QueryFailedError (/Volumes/www/slideshop/src/error/QueryFailedError.ts:9:9)
    at Query.callback (/Volumes/www/slideshop/src/driver/postgres/PostgresQueryRunner.ts:176:30)
    at Query.handleError (/Volumes/www/slideshop/node_modules/pg/lib/query.js:142:17)
    at Connection.connectedErrorMessageHandler (/Volumes/www/slideshop/node_modules/pg/lib/client.js:194:17)
    at Connection.emit (events.js:182:13)
    at Connection.EventEmitter.emit (domain.js:442:20)
    at Socket.<anonymous> (/Volumes/www/slideshop/node_modules/pg/lib/connection.js:126:12)
    at Socket.emit (events.js:182:13)
    at Socket.EventEmitter.emit (domain.js:442:20)
    at addChunk (_stream_readable.js:283:12)

Expected behavior
no errors on creation

Environment (please complete the following information):

  • @vendure/core version: 0.1.2-beta.2
  • Nodejs version: 10.13.0
  • Database (mysql/postgres etc): postgresql 11.3
@mavuio mavuio added the type: bug 🐛 Something isn't working label May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants