import { kysely } from "https://dotland.deno.dev/x/kysely_postgrs_js_dialect@v0.27.3/deps.ts";
const { ColumnDefinitionBuilder } = kysely;
Adds nulls not distinct
specifier.
Should be used with unique
constraint.
This only works on some dialects like PostgreSQL.
Examples
db.schema.createTable('person')
.addColumn('id', 'integer', col => col.primaryKey())
.addColumn('first_name', 'varchar(30)', col => col.unique().nullsNotDistinct())
.execute()
The generated SQL (PostgreSQL):
create table "person" (
"id" integer primary key,
"first_name" varchar(30) unique nulls not distinct
)