I'm using graphql, typescript, mikro-orm and postgresql to implement crud on posts. The property createdAt is having issues:
DriverException: alter table "post" alter column "created_at" type timestamptz(0) using ("created_at"::timestamptz(0)); - cannot cast type jsonb to timestamp with time zone
This is the entity of the createdAt property:
@Field(() => String)
@Property({ type: "date" })
createdAt = new Date();
And these two are the migrations generated from the createdAt entity
this.addSql('alter table "post" drop constraint if exists "post_created_at_check";');
this.addSql('alter table "post" alter column "created_at" type timestamptz(0) using ("created_at"::timestamptz(0));');
How would I go by fixing this error? Which types do I need to change?