Base Schema / Table definition

Hi! i may be a bit lost here, but i haven't found any other documentations related to this.

I'm trying to have a base schema that will be used in all of my other schemas, example:

The base schema would include this columns and their references:
createdAt: date("created_at").defaultNow(),
updatedAt: date("updated_at"),
createdBy: integer("created_by").references(() => users.id),
updatedBy: integer("updated_by").references(() => users.id),
isActive: boolean("is_active").default(true),

Is there a way to make this reusable for all instances, including the relations object that would be related to this?
Was this page helpful?