Drizzle TeamDT
Drizzle Team13mo ago
nu

How to add comment on postgres table columns (and other one-time operations like add trigger)

I want to add comment on columns of my postgres table (COMMENT ON COLUMN). There is no native function in drizzle.
I can see suggestions like

export default {
  async up(db) {
    await db.execute(sql`COMMENT ON COLUMN users.username IS 'User\'s unique username';`);
    await db.execute(sql`COMMENT ON COLUMN users.email IS 'User\'s email address';`);
  },


But won't this be executed every time? I faced same doubt when trying to add trigger+function.
Was this page helpful?