1.3 KiB
1.3 KiB
drizzle-orm-pg 0.15.0
- Set
notNulltotruein runtime, when.primaryKey()function was used inColumnBuilder - Set
no actionforOnDeleteandOnUpdatein runtime by default - Add internal version for ORM api
- Index name now becomes optional. You can write either
index('usersNameIdx')orindex(). In last case, drizzle will generate index name automatically based on table and column index was created on
Breaking changes
foreignKey() function api changes. Previosuly you need to pass callback function with table columns for FK. Right now no need for callback, just object with data for FK
Before
export const usersTable = pgTable(
'users_table',
{
id: serial('id').primaryKey(),
uuid: uuid('uuid').defaultRandom().notNull(),
homeCity: integer('home_city').notNull()
},
(users) => ({
// foreignKey had a callback as param
usersCityFK: foreignKey(() => ({ columns: [users.homeCity], foreignColumns: [cities.id] })),
}),
);
Now
export const usersTable = pgTable(
'users_table',
{
id: serial('id').primaryKey(),
uuid: uuid('uuid').defaultRandom().notNull(),
homeCity: integer('home_city').notNull()
},
(users) => ({
// foreignKey doesn't have a callback as param
usersCityFK: foreignKey({ columns: [users.homeCity], foreignColumns: [cities.id] }),
}),
);