MUG Knight
DTDrizzle Team
•Created by MUG Knight on 2/25/2025 in #help
Migration not setting DB column to NOT NULL
when I update my schema to set a column to use .notNull().Default("whatever") the migration files don't actually update the DB to alter the column to NOT NULL with a DEFAULT set. We are using the standard generate approach in drizzle-kit. Any ideas what we are doing wrong?
2 replies
DTDrizzle Team
•Created by MUG Knight on 11/26/2024 in #help
Unable to create a check constraint for NaN values
I am working to prevent any chance of NaN from being inserted into my DB, so I created a check constraint that looks like the following:
(table) => [
check("fancy_check_name", sql
Any Ideas?
${table.amount} <> NaN
),
],
When I run drizzle-kit's push method, I get the following error, "error: column "nan" does not exist"
Any combination of quotes or anything around NaN makes no difference.Any Ideas?
5 replies
DTDrizzle Team
•Created by MUG Knight on 10/7/2024 in #help
Adding record in Drizzle Studio with .generatedAlwaysAsIdentity error.
I have a table with a primary key column, defined as the following:
id: bigint("id", { mode: "number" })
.primaryKey()
.generatedAlwaysAsIdentity({ startWith: 1000 }),
If I try to add an item into the table via Drizzle Studio, I get the following error:
"cannot insert a non-DEFAULT value into column "id""
I can't find a combination of options/data entry to make this work. Any ideas?
2 replies