Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Second default(now()) doesn't work #183

Closed
siberian-man opened this issue Aug 11, 2019 · 5 comments
Closed

Second default(now()) doesn't work #183

siberian-man opened this issue Aug 11, 2019 · 5 comments
Assignees
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug.
Milestone

Comments

@siberian-man
Copy link

siberian-man commented Aug 11, 2019

If default(now()) is used more that once in a model, it doesn't work:

model Email {
  creationMoment                DateTime    @default(now())
  id                            ID
  confirmationExpirationMoment  DateTime    @default(now())
}

confirmationExpirationMoment doesn't have default value and the following error occurs:

Error in connector: Error querying the database: MySqlError { ERROR 1364 (HY000): Field 'confirmationExpirationMoment' doesn't have a default value }
@schickling schickling added candidate bug/1-repro-available A reproduction exists and needs to be confirmed. labels Aug 12, 2019
@timsuchanek timsuchanek added the kind/bug A reported bug. label Aug 12, 2019
@janpio janpio added bug/2-confirmed We have confirmed that this is a bug. and removed bug/1-repro-available A reproduction exists and needs to be confirmed. labels Aug 15, 2019
@janpio janpio self-assigned this Aug 15, 2019
@timsuchanek
Copy link
Contributor

@mavilein confirms that this is reproducible, but relates to a bigger work item related to the expression system, which needs to be implemented first.

@janpio janpio removed their assignment Aug 15, 2019
@janpio janpio removed the candidate label Aug 15, 2019
@divyenduz
Copy link

Internal note: This is a lift issue, introspection does not produce @defaut(now()) afaik. I tried it on a DB and this was the result, since now() is a Prisma schema function concept, it is not reflected in the database.

image

@mavilein
Copy link
Member

mavilein commented Jan 9, 2020

This is not a lift but a query engine issue. We are free to decide whether we implement now() through a db level concept or simply do in the query engine. We decided to do it in the query engine.

@mavilein
Copy link
Member

This should be fixed now. Please retest this.

@divyenduz
Copy link

This is not reproducible anymore.

@mavilein mavilein added this to the Preview 20 milestone Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug.
Projects
None yet
Development

No branches or pull requests

6 participants