I can in Prisma create columns without data, without time?
my model at the moment:
model modelName {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
lastNumber Int
}
Actual results:
2 2022-04-19 12:28:04.591+00 45
I want to generate records like this:
2 2022-04-19 45
To store only the date portion you could use the native @db.date attribute.
That would just store the date and not store the time.
In your schema file you could update the model as below to just store the date portion:
model modelName {
id Int @id @default(autoincrement())
createdAt DateTime @default(now()) @db.Date
lastNumber Int
}
Here's a reference to Prisma's PostgreSQL DateTime attribute: Reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With