© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
XataX
Xata•2y ago•
8 replies
Storm

Drizzle ORM schema conflict with xata_createdat and xata_updatedat

This is my drizzle schema:
export const users = pgTable('users', {
    id: text('id').primaryKey(),
    email: text('email').unique(),
    createdAt: timestamp('created_at').defaultNow(),
    updatedAt: timestamp('updated_at', {
        mode: 'date',
        precision: 3,
    }).$onUpdate(() => new Date()),
})
export const users = pgTable('users', {
    id: text('id').primaryKey(),
    email: text('email').unique(),
    createdAt: timestamp('created_at').defaultNow(),
    updatedAt: timestamp('updated_at', {
        mode: 'date',
        precision: 3,
    }).$onUpdate(() => new Date()),
})

When I push my schema using
npx drizzle-kit push:pg
npx drizzle-kit push:pg
I get a popup from Xata telling to add
xata_createdat
xata_createdat
and
xata_updatedat
xata_updatedat
I do add them but then later when I change my drizzle schema (let's say I added a firstName column) and push it, Drizzle warns me that I'm going to drop
xata_createdat
xata_createdat
and
xata_updatedat
xata_updatedat


What am I supposed to in this case?

Thank you
Xata banner
XataJoin
This is Xata's community Discord server, where we discuss all things Xata: projects, features, dreams!
1,125Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Does type "serial" exist in Xata/Drizzle?
XataXXata / help
2y ago