Replies: 2 comments 9 replies
-
Hi - I need a bit more context here. Which default value? Which id? What is |
Beta Was this translation helpful? Give feedback.
1 reply
-
For anyone wondering I just passed default expression with the type info, which arguably feels very wrong, but hey export async function up({context: cx}: {context: QueryInterface}) {
await cx.createTable(table, {
id: {
type: 'uuid DEFAULT uuid_generate_v4()',
primaryKey: true,
},
})
} |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would greatly appreciate the answer!
Right now it seems like I cannot do that? There is
defaultValue
, but whatever string it accepts it just passes it like escaped string?Same is for the dates, but I guess that is the same kind of question.
So, how to call a function to set a default value?
UPD. found
escape
and it looks like something I would use, but for pq it's set toundefined
Beta Was this translation helpful? Give feedback.
All reactions