numeric additionalFields defaultValue field does not work

additionalFields: {
credits: {
type: "number",
required: false,
defaultValue: 5,
input: false,
},
},
additionalFields: {
credits: {
type: "number",
required: false,
defaultValue: 5,
input: false,
},
},
I just want to have users start with 5 credits. I don't want them to input it, (so obviously its not required) yet the generated .sql just gives
create table "user" ("id" text not null primary key, "name" text not null, "email" text not null unique, "emailVerified" boolean not null, "image" text, "createdAt" timestamp not null, "updatedAt" timestamp not null, "credits" integer);
create table "user" ("id" text not null primary key, "name" text not null, "email" text not null unique, "emailVerified" boolean not null, "image" text, "createdAt" timestamp not null, "updatedAt" timestamp not null, "credits" integer);
not using the defaultValue at all
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?