trlanzi
trlanzi
DTDrizzle Team
Created by joshborseth on 9/14/2023 in #help
TypeError: Cannot read properties of undefined (reading 'compositePrimaryKeys')
I've been seeing the Cannot read properties of undefined (reading 'compositePrimaryKeys') as well. Upgraded to 0.21.3 and now whenever I db push, it tells me:
You're about to change table1 primary key. This statements may fail and you table may left without primary key
You're about to change table1 primary key. This statements may fail and you table may left without primary key
I have not made any changes to this table and even if I db push several times in a row, it always says the same thing. Upgrading to 0.21.4 didn't fix this. Here that table's schema:
export const table1 = pgTable(
"table1",
{
id: uuid("id")
.notNull()
.references(() => table2.id, { onDelete: "cascade" }),
},
(fs) => {
return {
pk: primaryKey({
name: "pk",
columns: [fs.id],
}),
};
},
);
export const table1 = pgTable(
"table1",
{
id: uuid("id")
.notNull()
.references(() => table2.id, { onDelete: "cascade" }),
},
(fs) => {
return {
pk: primaryKey({
name: "pk",
columns: [fs.id],
}),
};
},
);
Updating the schema to the following works, but I'd imagine both would be valid, no?
export const table1 = pgTable(
"table1",
{
id: uuid("id")
.notNull()
.references(() => table2.id, { onDelete: "cascade" })
.primaryKey(),
},
);
export const table1 = pgTable(
"table1",
{
id: uuid("id")
.notNull()
.references(() => table2.id, { onDelete: "cascade" })
.primaryKey(),
},
);
44 replies