2 ms·
FYI, the correct method is created_at: timestamp('created_at').defaultNow(), // Add created_at column definition Which Claude 3 Sonnet correctly produces.
by paradite 3y ago
FYI, the correct method is
created_at: timestamp('created_at').defaultNow(), // Add created_at column definition
Which Claude 3 Sonnet correctly produces.
ChatGPT Classic (GPT-4) gives:
created_at: timestamp('created_at').default(sql`NOW()`), // Add this line
Which is okay, but not ideal. And it also misses the need to import `sql` template tag.
Your share link gives:
created_at: timestamp('created_at').default('NOW()'),
Which would throw a TypeScript error for the wrong type used in arguments for `default`.