prisma1 icon indicating copy to clipboard operation
prisma1 copied to clipboard

1.31.0-beta.5 Forcibly ads createdAt & updatedAt fields.

Open vivirancy opened this issue 7 years ago • 4 comments

Describe the bug Every model is forced to have createdAt and updatedAt fields, even though they are not defined within the data model.

To Reproduce Steps to reproduce the behavior:

  1. Create a data model without createdAt and/or modifiedAt.
  2. Run prisma deploy
  3. Check the database.
  4. Both fields exist, the logs show they were added by Prisma during deploy.

Expected behavior If createdAt or modifiedAt are not defined, they should be excluded from the generate database table.

Screenshots image image

Versions (please complete the following information):

  • Connector: Postgres
  • Prisma: 1.31.0-beta.5
  • Node: v10.15.3
  • OS: Windows 10

vivirancy avatar Apr 16 '19 04:04 vivirancy

I was able to somewhat fix the above issue by specifying the prototype flag. However I now have an issue where I cannot remove the updatedAt/createdAt fields on any models even when running deploy with force.

image

vivirancy avatar Apr 17 '19 04:04 vivirancy

@Flash619

I can no longer reproduce this with the new datamodel. image

You are getting that warning as you are upgrading to the new datamodel(there is no longer a prototype flag now as it is in the stable release now 1.31). New datamodel allows you to specify the createdAt and updatedAt field's names(See https://github.com/prisma/prisma/issues/3403)

pantharshit00 avatar Apr 21 '19 10:04 pantharshit00

@Flash619 Same problem, have you found a solution ?

Kisepro avatar Apr 23 '19 09:04 Kisepro

@Flash619 Same problem, have you found a solution ?

I don't fully recall, I know I did fix it.

I think I had gone through and made sure everything was on the latest (same) beta Prisma version, and I had to enable the 'prototype' flag in the docker-compose file. However, the prototype flag should no longer be required based on @pantharshit00 comment.

vivirancy avatar Apr 27 '19 16:04 vivirancy