Replies: 2 comments 4 replies
-
please where you able to solve this ? i’m having this same issue |
Beta Was this translation helpful? Give feedback.
2 replies
-
You can use the export const users = pgTable("users", {
id: uuid().primaryKey(),
githubId: integer().notNull().default(0), // new
}); If you need the default value to be some dynamic value, you can use function getRandomInt(max: number) {
return Math.floor(Math.random() * max);
}
export const users = pgTable("users", {
id: uuid().primaryKey(),
githubId: integer().notNull().$default(() => getRandomInt(100)), // new
}); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to add a new column in the existing data, but every time I try to do that I get a new error.
I also don't want to delete my whole data and start from scratch,
is there any way to add new column may be fill it with some default data to not have null values and then start populating the data along with other columns simultaneously.
TIA
Beta Was this translation helpful? Give feedback.
All reactions