© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago
harshcut

MySQL Timestamp shows Invalid Date

All my tables with
timestamp
timestamp
columns show
null
null
. And when clicked on show
Invalid Date
Invalid Date
. Below is my schema for
bookmarks
bookmarks
table. What am I doing wrong?

export const bookmarks = mysqlTable(
  'bookmarks',
  {
    userId: varchar('userId', { length: 255 }).references(() => user.id),
    episodeId: varchar('episodeId', { length: 50 }).references(() => episodes.id),
    createdOn: timestamp('createdOn').notNull().defaultNow(),
  },
  (b) => ({
    compoundKey: primaryKey({ columns: [b.userId, b.episodeId] }),
  })
)
export const bookmarks = mysqlTable(
  'bookmarks',
  {
    userId: varchar('userId', { length: 255 }).references(() => user.id),
    episodeId: varchar('episodeId', { length: 50 }).references(() => episodes.id),
    createdOn: timestamp('createdOn').notNull().defaultNow(),
  },
  (b) => ({
    compoundKey: primaryKey({ columns: [b.userId, b.episodeId] }),
  })
)
image.png
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Invalid default value for timestamp
Drizzle TeamDTDrizzle Team / help
3y ago
how to make date in timestamp
Drizzle TeamDTDrizzle Team / help
2y ago
dates in sqlite not being evaluated, causing "Invalid Date"
Drizzle TeamDTDrizzle Team / help
2y ago
Timestamp mode as date while drizzle-kit pull
Drizzle TeamDTDrizzle Team / help
13mo ago