Menu

The SQL your Drizzle schema doesn't know about
πŸ“°

The SQL your Drizzle schema doesn't know about

DEV Community: opensourceΒ·Odinaka Robert NnamaniΒ·2 days ago
#fbXiosys
#devtoopensource#devto#dev#drizzle#users
Reading 0:00
15s threshold

Open your schema.ts . It looks like your whole database: every table, every column, every index, typed and diffed.

Now go look at your migrations folder.

Somewhere in there is a file like 0007_custom.sql . It has the updated_at trigger. Maybe a CREATE EXTENSION pgcrypto . Maybe the column comments your data team asked for six months ago. Someone wrote it by hand with drizzle-kit generate --custom , and it's the only place any of that exists.

Your schema doesn't know about it. Your teammates don't either, until something breaks. And when a table gets dropped and recreated, Postgres drops its triggers with it, quietly.

If that sounds familiar, you're in big company.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.