How can I make reusable columns then building schema?

If I save part of column in variable
const username = varchar('username', { length: 30 }).unique().notNull()

and then add something
const username_reference = username.references(() => userSchema.username, { onUpdate: 'cascade' })

It will change first one to
It changes objects properties instead of making copy and that's reasonable but I need to make copy and can't figure out how
Was this page helpful?