ansipedantic
DTDrizzle Team
•Created by ansipedantic on 12/21/2023 in #help
Migrations with new notNull() columns
ok.. sorry for the confusion @solo - but your answer also helped me figure it out.. so thank you!
10 replies
DTDrizzle Team
•Created by ansipedantic on 12/21/2023 in #help
Migrations with new notNull() columns
so, i need to make sure to provide a .default(...) when adding a .notNull() to an existing table
10 replies
DTDrizzle Team
•Created by ansipedantic on 12/21/2023 in #help
Migrations with new notNull() columns
but i just tried again and it worked 😮
10 replies
DTDrizzle Team
•Created by ansipedantic on 12/21/2023 in #help
Migrations with new notNull() columns
oh hmm hang on.. I thought I had an issue w/ using
.notNull().default('asdf')
also throwing an error..10 replies
DTDrizzle Team
•Created by ansipedantic on 12/21/2023 in #help
Migrations with new notNull() columns
Hi @solo thanks for the reply. However, this is not the case I am trying to solve. I am adding a brand new column
foo
to an existing table.. I am not updating an existing column.
So, Step 1 in your above message is the equivilent of what I am trying to do, and what is causing the error10 replies
DTDrizzle Team
•Created by ansipedantic on 12/21/2023 in #help
Migrations with new notNull() columns
this is the migration file:
and this is the error when I run the
migrate(...)
code
10 replies
DTDrizzle Team
•Created by ansipedantic on 12/21/2023 in #help
Migrations with new notNull() columns
(I should add that if I add a
.default('bar')
it still has the same error... I presume that this default is only applied to newly inserted rows, so it doesn't help fix the existing rows...?)10 replies