adonisjs / lucid

AdonisJS SQL ORM. Supports PostgreSQL, MySQL, MSSQL, Redshift, SQLite and many more
https://lucid.adonisjs.com/
MIT License
1.08k stars 195 forks source link

DateTime<boolean> | Type 'DateTime<boolean>' is missing the following properties from type 'Date' #979

Closed mohamadrezaalirezaei closed 8 months ago

mohamadrezaalirezaei commented 11 months ago

Prerequisites

Hi Why the type of createdAt in my model is "AnswerWallet.createdAt: DateTime < boolean > WHAT IS DateTime < boolean > ??

This is my Model

import { DateTime } from 'luxon' import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'

export default class Answer extends BaseModel {

@column() public questionId: string

@column() public answer: string

@column.dateTime({ autoCreate: true }) public createdAt: DateTime;

@column.dateTime({ autoCreate: true, autoUpdate: true }) public updatedAt: DateTime; }

Package version

"@adonisjs/core": "^5.9.0", "@adonisjs/lucid": "^18.4.2", "@adonisjs/redis": "^7.3.4", "@adonisjs/repl": "^3.1.11", "luxon": "^3.4.4",

Node.js and npm version

Node.js Version : 18.17.1 Npm Version: 9.6.7

RomainLanz commented 9 months ago

Hey @mohamadrezaalirezaei! 👋🏻

You are showing the model Answer, but your "error" shows AnswerWallet. Could you please provide a reproduction because I am not able to replicate your issue.

thetutlage commented 9 months ago

And please format your code examples. Its almost impossible to read anything

RomainLanz commented 8 months ago

Closing since no answer from issue reporter.