Type Generated from $inferInsert does not change after column type update

I have a table called identities in a schema called identity. When I changed the phone_country_code column type from text to numeric, the sql generated from drizzle-kit was correct, but the type generated from inferInsert still has the old string type. (see attached image).
// Table definition
phoneCountryCode: numeric('phone_country_code').notNull(),

// Infer Insert
export type NewIdentityEntity = typeof identitiesTable.$inferInsert;
// Table definition
phoneCountryCode: numeric('phone_country_code').notNull(),

// Infer Insert
export type NewIdentityEntity = typeof identitiesTable.$inferInsert;
Version Information: - "drizzle-orm": "^0.28.6", - "drizzle-kit": "^0.19.13",
No description
2 Replies
Angelelz
Angelelz14mo ago
Di you try restarting your LSP?
san4d
san4dOP14mo ago
Yes. I'm using VS Code if that helps. This happened again with a different table in a different project. Both cases involved the numeric type. Looking at the pg-core code, this behavior is expected:
export type PgNumericBuilderInitial<TName extends string> = PgNumericBuilder<{
name: TName;
dataType: 'string';
columnType: 'PgNumeric';
data: string;
driverParam: string;
enumValues: undefined;
}>;
export type PgNumericBuilderInitial<TName extends string> = PgNumericBuilder<{
name: TName;
dataType: 'string';
columnType: 'PgNumeric';
data: string;
driverParam: string;
enumValues: undefined;
}>;
I expect it has something to do with the arbitrary precision.
Want results from more Discord servers?
Add your server