AOSP-NIT-Surat / poller

A simple polling app
2 stars 2 forks source link

Add models for polls, question and answer. #6

Open madrix01 opened 3 years ago

madrix01 commented 3 years ago
model User {
  id  String @unique
  username String
  email String
  password String
}

model Poll {
  id String @unique
  pollName String
  pollDescription String @default("") 
  createdBy String
  timeToActivate BigInt
  questions String[]
  timeToDeactivate BigInt
  isActive Boolean @default(false)
  adminPanel String[]
  urlId String
}

model Question {
    id String @unique
    pollId String
    content String
    options String[] // List of ids
    totalPolls Int @default(0)
    result Int[]
}

model Answer {
    id String @unique
    questionId String @unique
    content String
    totalPolls Int @default(0) 
}
neutr0nStar commented 3 years ago

I would like to do this, please assign this to me.

neutr0nStar commented 3 years ago

Does the user need to provide poll/question/answer id through API, or will it be generated on backend through the use of something like uuid ?

madrix01 commented 3 years ago

yes uuid should be good but for urlId u can use shortid is good