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

Update the official tutorial with initial db migration #2621 #532

Open
chikamichi opened this issue Aug 2, 2021 · 4 comments
Open

Update the official tutorial with initial db migration #2621 #532

chikamichi opened this issue Aug 2, 2021 · 4 comments

Comments

@chikamichi
Copy link

What do you want and why?

Hi. Following along the official tutorial, I stumbled upon an "error" where the User table would be missing, preventing from signing up.

I figured it out easily: one must run blitz prisma migrate dev.

Possible implementation(s)

Before the Sign up as a user section, add another section "explaining" the need for data (including a table of users), SQLite as a default, the concept of a migration, the schema.prisma file and more importantly, the migration command.

Additional context

Using latest Blitz version as of 02/08/2021: 0.38.6

@flybayer
Copy link
Member

flybayer commented Aug 3, 2021

Thanks @chikamichi — certainly we can improve the tutorial here.

As for the migration command, you do not need to run that command unless something fails during new app setup. Because we automatically run that command during blitz new. If this step fails for some reason, this command will be listed in the next steps result of blitz new. But this could be added as a "troubleshooting" item in the tutorial.

@chikamichi
Copy link
Author

chikamichi commented Aug 3, 2021

Oh!

I overlooked the "Next steps:" section from the install output. When generating a new app, the Initializing SQLite database step is failing indeed.

More accurately: I followed along the tutorial, abiding by the textbook therefore running only those commands the tutorial is highlighting. Hence I didn't pay too much attention to the actual console output.

I could create a PR addressing that (basically: your message above), with a Info note for instance.

@chikamichi
Copy link
Author

As for the error, how could I find what's going wrong? It fails consistently at creating the SQLite DB when running blitz new.
Should I open an issue on https://github.com/blitz-js/blitz/issues?

@flybayer
Copy link
Member

flybayer commented Aug 4, 2021

As for the error, how could I find what's going wrong? It fails consistently at creating the SQLite DB when running blitz new.
Should I open an issue on https://github.com/blitz-js/blitz/issues?

Yeah that would be good. Essentially what we are doing is running during blitz new is running blitz prisma migrate dev --name "Initial migration"

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

4 participants