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

Command yarn rw prisma db seed redundant #64

Open
adriatic opened this issue Jun 24, 2022 · 1 comment
Open

Command yarn rw prisma db seed redundant #64

adriatic opened this issue Jun 24, 2022 · 1 comment

Comments

@adriatic
Copy link

adriatic commented Jun 24, 2022

Added on Jan 22, 2023

Seeing that this is still an open issue (most likely because it is trivial and I did not close it already), I wanted to verify this problem report using today's version of RW (see the list of files below), I believe that my original report was correct and that the sequence of commands defined in Setup"

Please verify and close either way (eventually remove the line yarn rw prisma db seed from Setup instructions

My final report

The following instructions

git clone https://github.com/redwoodjs/redwood-tutorial
cd redwood-tutorial
yarn install
yarn rw prisma migrate dev
yarn rw prisma db seed
yarn rw dev

have a redundant command yarn rw prisma db seed, because the execution of yarn rw prisma migrate dev "internally" invokes the seed command yarn rw exec seed;

image


Definition of my context

nik$ yarn info
├─ @redwoodjs/core@npm:3.2.0
│  ├─ Version: 3.2.0
│  │
│  ├─ Exported Binaries
│  │  ├─ cross-env
│  │  ├─ eslint
│  │  ├─ jest
│  │  ├─ nodemon
│  │  ├─ redwood
│  │  ├─ rimraf
│  │  ├─ rw
│  │  ├─ rw-api-server-watch
│  │  ├─ rw-gen
│  │  ├─ rw-gen-watch
│  │  ├─ rw-log-formatter
│  │  └─ rwfw
│  │
│  └─ Dependencies
│     ├─ @babel/core@npm:7.19.3 → npm:7.19.3
│     ├─ @babel/runtime-corejs3@npm:7.19.1 → npm:7.19.1
│     ├─ @redwoodjs/cli@npm:3.2.0 → npm:3.2.0
│     ├─ @redwoodjs/eslint-config@npm:3.2.0 → npm:3.2.0
│     ├─ @redwoodjs/internal@npm:3.2.0 → npm:3.2.0
│     ├─ @redwoodjs/testing@npm:3.2.0 → npm:3.2.0
│     ├─ babel-plugin-auto-import@npm:1.1.0 → npm:1.1.0
│     ├─ babel-plugin-module-resolver@npm:4.1.0 → npm:4.1.0
│     ├─ babel-timing@npm:0.9.1 → npm:0.9.1
│     ├─ core-js@npm:3.25.5 → npm:3.25.5
│     ├─ esbuild@npm:0.15.10 → npm:0.15.10
│     ├─ fast-glob@npm:3.2.12 → npm:3.2.12
│     ├─ graphql@npm:16.6.0 → npm:16.6.0
│     ├─ lodash.escaperegexp@npm:4.1.2 → npm:4.1.2
│     ├─ nodemon@npm:2.0.20 → npm:2.0.20
│     ├─ react-refresh@npm:0.14.0 → npm:0.14.0
│     ├─ rimraf@npm:3.0.2 → npm:3.0.2
│     ├─ svg-react-loader@npm:0.4.6 → npm:0.4.6
│     ├─ typescript@patch:[email protected]#~builtin<compat/typescript> → patch:typescript@npm%3A4.7.4#~builtin<compat/typescript>::version=4.7.4&hash=7ad353
│     ├─ webpack-bundle-analyzer@npm:4.5.0 → npm:4.5.0
│     ├─ webpack-merge@npm:5.8.0 → npm:5.8.0
│     ├─ @babel/cli@npm:7.19.3 → npm:7.19.3 [6562c]
│     ├─ @babel/eslint-plugin@npm:7.19.1 → npm:7.19.1 [6562c]
│     ├─ @babel/node@npm:7.19.1 → npm:7.19.1 [6562c]
│     ├─ @babel/plugin-proposal-class-properties@npm:^7.0.0 → npm:7.18.6 [a1e68]
│     ├─ @babel/plugin-proposal-decorators@npm:^7.12.12 → npm:7.19.3 [e4585]
│     ├─ @babel/plugin-proposal-private-methods@npm:^7.12.1 → npm:7.18.6 [e4585]
│     ├─ @babel/plugin-proposal-private-property-in-object@npm:^7.12.1 → npm:7.18.6 [e4585]
│     ├─ @babel/plugin-transform-runtime@npm:7.19.1 → npm:7.19.1 [6562c]
│     ├─ @babel/preset-env@npm:^7.12.11 → npm:7.19.3 [e4585]
│     ├─ @babel/preset-react@npm:^7.12.10 → npm:7.18.6 [e4585]
│     ├─ @babel/preset-typescript@npm:^7.12.7 → npm:7.18.6 [e4585]
│     ├─ @pmmmwh/react-refresh-webpack-plugin@npm:0.5.7 → npm:0.5.7 [6562c]
│     ├─ babel-loader@npm:8.2.5 → npm:8.2.5 [6562c]
│     ├─ babel-plugin-graphql-tag@npm:3.3.0 → npm:3.3.0 [6562c]
│     ├─ babel-plugin-inline-react-svg@npm:2.0.1 → npm:2.0.1 [6562c]
│     ├─ copy-webpack-plugin@npm:11.0.0 → npm:11.0.0 [6562c]
│     ├─ css-loader@npm:6.7.1 → npm:6.7.1 [6562c]
│     ├─ css-minimizer-webpack-plugin@npm:4.0.0 → npm:4.0.0 [6562c]
│     ├─ dotenv-webpack@npm:8.0.1 → npm:8.0.1 [6562c]
│     ├─ file-loader@npm:6.2.0 → npm:6.2.0 [6562c]
│     ├─ graphql-tag@npm:2.12.6 → npm:2.12.6 [73e5c]
│     ├─ html-webpack-plugin@npm:5.5.0 → npm:5.5.0 [6562c]
│     ├─ mini-css-extract-plugin@npm:2.6.1 → npm:2.6.1 [6562c]
│     ├─ null-loader@npm:4.0.1 → npm:4.0.1 [6562c]
│     ├─ style-loader@npm:3.3.1 → npm:3.3.1 [6562c]
│     ├─ url-loader@npm:4.1.1 → npm:4.1.1 [6562c]
│     ├─ webpack-cli@npm:4.10.0 → npm:4.10.0 [6562c]
│     ├─ webpack-dev-server@npm:4.11.0 → npm:4.11.0 [6562c]
│     ├─ webpack-manifest-plugin@npm:5.0.0 → npm:5.0.0 [6562c]
│     ├─ webpack-retry-chunk-load-plugin@npm:3.1.1 → npm:3.1.1 [6562c]
│     └─ webpack@npm:5.74.0 → npm:5.74.0 [6562c]
│
└─ root-workspace-0b6124@workspace:.
   ├─ Version: 0.0.0
   │
   └─ Dependencies
      └─ @redwoodjs/core@npm:3.2.0 → npm:3.2.0


Added later

Please ignore this issue (delete it) - I proved to myself that both instructions

yarn rw prisma migrate dev
yarn rw prisma db seed

are needed.



Summary

The command yarn rw prisma migrate dev implicitly includes the action caused by the following command (yarn rw prisma db seed).


The tutorial section using-the-example-repo explains the need to run the following list of six commands;

git clone https://github.com/redwoodjs/redwood-tutorial
cd redwood-tutorial
yarn install
yarn rw prisma migrate dev
yarn rw prisma db seed
yarn rw g secret

needed to make the clone of the Redwood Blog application complete (up to the functionality of the first four chapters of the RedwoodJS Tutorial Application.

The claim written as a title of this issue (Command yarn rw prisma db seed redundant) is easily verified by inspecting the log of the yarn rw prisma migrate dev command (see below)

nik$ yarn rw prisma migrate dev

Running Prisma CLI...
$ yarn prisma migrate dev --schema /Users/nik/dev/work/redwood/rw-community/redwood-tutorial-postgresql/api/db/schema.prisma

Prisma schema loaded from api/db/schema.prisma
Datasource "db": SQLite database "dev.db" at "file:./dev.db"

SQLite database dev.db created at file:./dev.db

Applying migration `20210222013102_init_database`
Applying migration `20220208231150_create_user`

The following migration(s) have been applied:

migrations/
  └─ 20210222013102_init_database/
    └─ migration.sql
  └─ 20220208231150_create_user/
    └─ migration.sql

Your database is now in sync with your schema.

✔ Generated Prisma Client (3.14.0 | library) to ./node_modules/@prisma/client in
 116ms

Running seed command `yarn rw exec seed` ...
[09:17:39] Generating Prisma client [started]
[09:17:39] Generating Prisma client [completed]
[09:17:39] Running script [started]
  Seeded "Welcome to the blog!"
  Seeded "A little more about me"
  Seeded "What is the meaning of life?"

  Seeded admin user:

    Email: [email protected]
    Password: admin

  (Please don't use this login in a production environment)

[09:17:39] Running script [completed]

🌱  The seed command has been executed.
@adriatic
Copy link
Author

adriatic commented Jul 23, 2023

I believe that my explanation about the redundancy of the command yarn rw prisma db seed redundant in the text:

git clone https://github.com/redwoodjs/redwood-tutorial
cd redwood-tutorial
yarn install
yarn rw prisma migrate dev
yarn rw prisma db seed
yarn rw dev

in the Setup section has been validated many times in the last couple of years. Taking the liberty that all bugs are worth fixing (otherwise the discoverers of minor bugs will get depressed and not report them) I would suggest addressing such reports.

There are several other issues like "bring the tutorial to RW r.x" that were addressed log time ago.

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

No branches or pull requests

1 participant