0:00 The next thing we need to do is create a Drizzle schema 0:03 that will outline the 0:04 shape of the data that we're gonna save inside of our 0:06 PostgreSQL database, 0:07 just as we've done before. 0:11 So to support this, let's head back into our shared 0:14 infrastructure directory, 0:16 and inside of database PostgreSQL, we know we are storing 0:20 our schemas here. So we can add again our 0:24 new schema, the 0:26 orders.schema.ts. Now, you might be wondering 0:29 why we're keeping all of our schemas inside of this common 0:33 shared infrastructure folder, 0:35 and this is really just for convenience because right now we don't have that 0:39 many schemas. However, if you were to prefer to keep things in the 0:43 current architecture we have where we're sort of following a more vertical 0:47 architecture and keeping all of our 0:51 code related to the entity inside of the directory, you could just 0:55 as easily as we've done before, create an infrastructure folder 0:59 inside of order, and we'll actually do this later 1:03 on. But for example, if you wanted to create our schemas inside 1:07 of 1:07 the order directory just for order, you can easily do this, and 1:11 this will still follow the clean architecture. 1:14 So we could create a database directory in here and 1:18 another folder for schemas and put the order schema in 1:21 there. However, I like to follow, at least for smaller projects, like in 1:25 this case, keeping all of our shared schemas in one 1:28 spot 1:29 because it's just easier to keep track of them. 1:32 So choose whichever approach you like best. 1:35 I'll stick with the approach that we've been following so far. 1:38 And now in the order schema, let's go ahead and set this 1:42 up. The first thing we wanna do is create a 1:46 const orders table, 1:48 which will use our familiar pg table function, and we'll pass
The rest of the transcript is for members.
Sign in