Skip to content
Discussion options

You must be logged in to vote

Prepare executes every time, Create / Update, i wouldn't wanna generate a new id every time, by following that example
i can do

@column({
    prepare: (value: string) => value ? value : uuid()
  })

But that still will be called every time.

Now my code beforeCreate works, it does create a record with UUID, but when we do user.create the return response gives me an incrementing ID instead of thar UUID, in database UUID is stored only, so like earlier it may be a local variable there.

Replies: 6 comments 35 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@popovicieduard
Comment options

@jrishabh55
Comment options

@popovicieduard
Comment options

@jrishabh55
Comment options

Answer selected by jrishabh55
Comment options

You must be logged in to vote
21 replies
@RodolfoSilva
Comment options

@RodolfoSilva
Comment options

@thetutlage
Comment options

@RodolfoSilva
Comment options

@RodolfoSilva
Comment options

Comment options

You must be logged in to vote
4 replies
@dajpes
Comment options

@RodolfoSilva
Comment options

@EDMONDGIHOZO
Comment options

@carlmathisen
Comment options

Comment options

You must be logged in to vote
6 replies
@RodolfoSilva
Comment options

@gui8515
Comment options

@gmoreiraGP
Comment options

@McSneaky
Comment options

@gmoreiraGP
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet