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

No longer allowed to migrate due to MissingPrimaryColumnError in JobRecordBuffer #2952

Closed
jakelawrence opened this issue Jul 16, 2024 · 2 comments
Labels
type: bug 🐛 Something isn't working

Comments

@jakelawrence
Copy link

jakelawrence commented Jul 16, 2024

Describe the bug
When I spin up a new instance of Vendure and go to migrate, I get an error saying that the entity JobRecordBuffer does not have a primary column.

To Reproduce
Steps to reproduce the behavior:
Create a new vendure instance using SQLite or SQL.js. Does not matter if there is sample data or not.
Navigate into vendure project directory and run npx vendure migrate

Expected behavior
The migration to run

Environment:

  • @vendure/core version: 2.2.7
  • Nodejs version: v20.15.1
  • Database (mysql/postgres etc): SQLite or SQL.js

error

@jakelawrence jakelawrence added the type: bug 🐛 Something isn't working label Jul 16, 2024
@michaelbromley
Copy link
Member

Hi,

Thanks for the report. I just tested this on a fresh install of 2.2.7 using SQLite:

  1. Added a custom field to Product, { name: 'test', type: 'string' }
  2. npx vendure migrate to generate a migration
  3. npx vendure migrate to run pending migrations

Result:
image

I'm not sure what the difference is in your setup. I'm also on Windows but I ran the CLI through git bash, although I can't image that would make a difference.

I have seen that error in the past, but I'm not sure what caused it. Can you run

npm ls typeorm
npm ls @nestjs/core
npm ls @nestjs/typeorm

and see if you have any version conflicts causing multiple versions of any of those packages to get installed?

@jakelawrence
Copy link
Author

Hi,

I went to install a fresh build of Vendure and it prompted me to download the newest version of Vendure 3.0.0 within the CLI. Not sure why it wasn't doing that before but with that, it seems to be working now. Thank you for taking the time to check on that!

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