Closed azamaulanaaa closed 1 month ago
What's your drizzle schema? Can't replicate this using any of mine including the test ones.
this is my schema hope it helps
export const entities = pgTable("entities", {
id: serial("id").primaryKey().notNull(),
createdAt: timestamp("created_at").defaultNow().notNull(),
name: text("name").notNull(),
});
export const entitiesRelations = relations(entities, ({ many }) => ({
financeSalaries: many(financeSalaries),
}));
export const financeSalaries = pgTable(
"finance_salaries",
{
id: serial("id").primaryKey().notNull(),
createdAt: timestamp("created_at").defaultNow().notNull(),
activatedAt: timestamp("activated_at").defaultNow().notNull(),
value: jsonb("value").notNull(),
entityId: integer("entity_id")
.notNull()
.references(() => entities.id, {
onDelete: "restrict",
onUpdate: "cascade",
}),
},
(table) => ({
activatedAtIndex: index().on(table.activatedAt),
entityIdIndex: index().on(table.entityId),
entityIdValueUnique: unique().on(table.entityId, table.value),
}),
);
export const financeSalariesRelations = relations(
financeSalaries,
({ one }) => ({
entity: one(entities, {
fields: [financeSalaries.entityId],
references: [entities.id],
}),
}),
);
same problem but on mysql database, so it does not depend on dbms
Fixed - v0.7.2
package
query
response
Note:
in version 0.6, everything works just fine. Updating to 0.7 got the problem. thanks