Ali
Ali
Explore posts from servers
DTDrizzle Team
Created by Ali on 11/3/2024 in #help
Depreciated table
import { integer, text, unique, pgTable } from "drizzle-orm/pg-core";
export const user = pgTable('user', {
id: integer('id').unique(),
});
export const table = pgTable('table', {
id: integer('id').unique('custom_name'),
});
export const composite = pgTable('composite_example', {
id: integer('id'),
name: text('name'),
}, (t) => ({
unq: unique().on(t.id, t.name),
unq2: unique('custom_name').on(t.id, t.name)
}));
// In Postgres 15.0+ NULLS NOT DISTINCT is available
// This example demonstrates both available usages
export const userNulls = pgTable('user_nulls_example', {
id: integer('id').unique("custom_name", { nulls: 'not distinct' }),
}, (t) => ({
unq: unique().on(t.id).nullsNotDistinct()
}));
import { integer, text, unique, pgTable } from "drizzle-orm/pg-core";
export const user = pgTable('user', {
id: integer('id').unique(),
});
export const table = pgTable('table', {
id: integer('id').unique('custom_name'),
});
export const composite = pgTable('composite_example', {
id: integer('id'),
name: text('name'),
}, (t) => ({
unq: unique().on(t.id, t.name),
unq2: unique('custom_name').on(t.id, t.name)
}));
// In Postgres 15.0+ NULLS NOT DISTINCT is available
// This example demonstrates both available usages
export const userNulls = pgTable('user_nulls_example', {
id: integer('id').unique("custom_name", { nulls: 'not distinct' }),
}, (t) => ({
unq: unique().on(t.id).nullsNotDistinct()
}));
10 replies
DTDrizzle Team
Created by Ali on 11/3/2024 in #help
Depreciated table
for example
10 replies
DTDrizzle Team
Created by Ali on 11/3/2024 in #help
Depreciated table
it doesn't not use arrays here
10 replies
DTDrizzle Team
Created by Ali on 11/3/2024 in #help
Depreciated table
10 replies
DTDrizzle Team
Created by Ali on 11/3/2024 in #help
Depreciated table
const createTable: PgTableFn <"clinicsSessions", { id: IsPrimaryKey<NotNull<PgUUIDBuilderInitial<"">>>; year: NotNull<PgIntegerBuilderInitial<"">>; month: NotNull<...>; }>(name: "clinicsSessions", columns: { ...; }, extraConfig: (self: { ...; }) => PgTableExtraConfig) => PgTableWithColumns<...> (+3 overloads) @deprecated — This overload is deprecated. Use the other method overload instead.
10 replies
DTDrizzle Team
Created by Ali on 11/3/2024 in #help
Depreciated table
the issue seems to be probably related to
(t) => ({
unq: unique().on(t.year, t.month),
})
(t) => ({
unq: unique().on(t.year, t.month),
})
because deleting it removes the depreciation warning
10 replies