Confused on how to set up Drizzle and Postgres #2748
Unanswered
CordialGit
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to use Drizzle ORM, but something is not clear to me:
I want to create 4 Postgres Database Tables:
a.) Users Table: a table that will have normal user information.
Then there will be 3 additional tables for User interactions which records and stores a user's interaction on the website.
These are:
b.) Posts Table: a table with a One-to-Many Relationship -- where a user will have many Posts, many Comments, many Likes, many Thumbs Down, many Friends, many Groups, and many Pages, stored into this table.
c.) Purchases Table: a table which is a One-to-Many Relationship Table -- where a user will have many transactions listed to their name.
This table only keeps stock and inventory of all the Purchases that a user makes on my website.
d.) Points Table: a table which stores all the many Points, many Awards, and many Badges that a user will earn on the website.
QUESTION 1
In creating a Schema, I'm I going to create One(1) Schema per Table? -- in which case I will have 4 different Schemas?
Or
Is it one(1) Schema I will use to declare all the structure of the 4 Tables?
2.) How do I create Schema that will take note of all these four(4) Tables, and is able to link them to work together?
This is a big problem for me, and I am hoping that you can guide me on this, because I didn't see how to do it in the Documentation, and I've spent 4 days on it without hope on what to do exactly.
Regards.
Beta Was this translation helpful? Give feedback.
All reactions