Create and implement the Prisma schema for the user and seller models to store data in PostgreSQL. These models are essential for a website offering rental services for daily-use items. The schema should define the structure for both user and seller data, ensuring efficient and scalable storage.
Requirements
User Model:
Basic user information (e.g., id, name, email, password).
Address or location field.
Contact number.
Role: User.
Seller Model:
Basic seller information (e.g., id, name, email, password).
Business details like storeName.
Location/address field.
Role: Seller.
Ratings/feedback (optional for future improvements).
Common Considerations:
Use PostgreSQL as the database.
Use id as the primary key with UUID type for uniqueness.
Add createdAt and updatedAt timestamps for both models.
Ensure the schema aligns with Prisma ORM conventions.
Example Schema (Suggested)
model User {
id String @id @default(uuid())
name String
email String @unique
password String
address String?
contact String?
role String @default("user")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Seller {
id String @id @default(uuid())
name String
email String @unique
password String
storeName String
location String?
contact String?
role String @default("seller")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
### Use Case
Base will be formed for auth functionality
### Benefits
_No response_
### Priority
High
### Record
- [X] I agree to follow this project's Code of Conduct
- [X] I'm a GSSOC contributor
- [X] I want to work on this issue
- [X] I'm willing to provide further clarification or assistance if needed.
Is there an existing issue for this?
Feature Description
Add Prisma Schema for User and Seller Models
Description
Create and implement the Prisma schema for the
user
andseller
models to store data in PostgreSQL. These models are essential for a website offering rental services for daily-use items. The schema should define the structure for both user and seller data, ensuring efficient and scalable storage.Requirements
User Model:
id
,name
,email
,password
).Seller Model:
id
,name
,email
,password
).storeName
.Common Considerations:
id
as the primary key withUUID
type for uniqueness.Example Schema (Suggested)