The tutorial was great, and now I’m trying to make a real app and have some questions.
How can I edit the schema of a table after it has existed for a while? (How do migrations work?)
If I want to have 3 tables—Posts, Tags, and a many-to-many joiner table (maybe “PostTags”?)—how can I do it? I followed the example at Relations (Reference) | Prisma Docs but I think it broke things (I needed to remove lines from “sdl” files such as
tags: Tag and
name="name" where I expected to see
name="message". Was that a mistake? If not, it’s confusing, so could you please explain?
Hello! Glad you liked the tutorial!
Prisma wants you to edit the database schema only via migrations. So whether that’s changing a column name or data type or anything else, you make the change in
schema.prisma and create a new migration. They do a diff of that file compared to the latest state in the latest migration directory, and figure out everything that needs to change to bring the database up-to-date. You can read more in their docs: https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-migrate
Our SDL/service generation is still in development. I wouldn’t guarantee that the many-to-many generation is working 100% yet! Do you need to explicitly define the
TagsOnPosts table, or could you let Prisma do it for you? Did you see their syntax for the implicit version?
Ahhh that was a typo in the code snippets, I just fixed them, thanks!
Wow, that’s what I thought based on your tutorial, but it felt so unfamiliar to just edit the schema and have the tool automatically figure out the necessary steps (maybe too good to be true). I see in that link that this declarative rather than imperative migration system is still experimental, but that’s really exciting.
Oh ok. Yep, I saw the implicit version but tend to prefer explicit joiner tables (as it says " For example, to store when the relation was created."). I’ll either switch to implicit or wait for the SDL/service generation to be fixed.
I’m interested in building a basic React app that works natively on mobile but also on web. I have found Expo, which is interesting, but I’m having trouble understanding whether it’s a competitor/alternative to Redwood or whether they can be used together. In other words, if I would love to write React code just once and have the app work universally (on web, iOS, and Android), can Redwood handle that? What do you recommend?
How can I use SCSS files in Redwood?
I know redwoodjs /tutorial/wrapping-up mentions helpers for authentication. Do you have an estimate of when a code example of auth will be available (ideally an example that doesn’t require signing up for a paid plan such as Netlify Business Teams to use Netlify Identity)?
I’m VERY impressed with you all and will keep spreading the word!
Thanks very much for everything.