redwoodjs/redwood-tutorial

Sample tutorial should be updated to newest version to avoid Comment test error

arcticfly opened this issue · 5 comments

As documented in this issue in the learn.redwood.js repository, the current RedwoodJS version that this tutorial uses includes a bug that results in the following error when running the default 'returns all comments' test (or 'return a list of all comments' test, depending on the version you're reading) in comments.test.js.

Invalid `prisma.executeRaw()` invocation:

      Raw query failed. Code: `23503`. Message: `update or delete on table "Post" violates foreign key constraint "Comment_postId_fkey" on table "Comment"

However, the latest version of RedwoodJS (as of this post it was 0.41.0) includes a fix (see this PR) which resolves this error. Simply upgrading the version of RedwoodJS in the example repo provided to the reader (this repo) will resolve this error for all future readers.

This process may include going through all code modifications from 0.38.0 to 0.41.0 as documented here: https://github.com/redwoodjs/redwood/releases.

I've started the upgrade process myself, but I imagine that starting with the current sample project and going through the upgrade process (which is what I've been attempting) is less efficient than starting a new project from scratch and running whatever commands we need to create Posts, Comments, etc.

@cannikin should I continue the upgrade process from the initial repository, or do you think this issue should be handled differently?

You should try the upgrade! I don't think it's too bad... if you follow along with each version's release notes there are sometimes automated codemods that'll make any changes you need automatically.

Okay #18 is ready for review

Should now be updated to use @redwoodjs/core version v0.41.0