Skip to main content

⚡️ Design a Schema

Before Design a Schema of the application you need a clear UI design of the application. You can use Figma, Adobe XD, Sketch, or any other design tool to design the UI of the application.It will help you to understand the data structure of the application.

Syntax

Prisma has an easy to understand syntax for creating models. Its based on the GraphQL language which is based on JSON. So you'll feel right at home. I highly recommend installing the Prisma VS Code plugin. It lints and cleans up your schema file.

User

  • id: String (Primary Key) - A unique identifier for the user.
  • createdAt: DateTime - The date and time the user was created.
  • username: String - The username of the user.
  • password: String - The password of the user.
  • updates: Update[] - The updates the user has made.
model User {
id String @id @default(uuid())
createdAt DateTime @default(now())
username String @unique
password String
}

Above is our User schema