`drizzle-kit pull` v0.28.0 generating faulty schema file

Running drizzle-kit pull generates an incorrect schema file. Ex:
export const inviteCodes = mysqlTable("invite_codes", {
id: varchar({ length: 255 }).notNull(),
remainingUses: int("remaining_uses", , { unsigned: true }).default(1).notNull(),
},
(table) => {
return {
idxInviteCodesRemainingUses: index("idx_invite_codes_remaining_uses").on(table.remainingUses),
}
});
export const inviteCodes = mysqlTable("invite_codes", {
id: varchar({ length: 255 }).notNull(),
remainingUses: int("remaining_uses", , { unsigned: true }).default(1).notNull(),
},
(table) => {
return {
idxInviteCodesRemainingUses: index("idx_invite_codes_remaining_uses").on(table.remainingUses),
}
});
2 Replies
victor
victorOP3w ago
^ note the remainingUses definition having an extra comma another note: v0.27.0 works and generates the schema file correctly
MrKoops
MrKoops3w ago
i have the exact same problem: user table, settings table user.id is TEXT, foreign key in settings is set as INTEGER for user.id thus migration wants to recreate settings table :/ anybody a clue how to fix it?
Want results from more Discord servers?
Add your server