Fadi
Fadi
DTDrizzle Team
Created by Fadi on 7/24/2024 in #help
Extending Relations
True but wouldn't running introspect again re write the file? The relations are generated in a separate file from the schemas. One of these relations would be
export const usersInAuthRelations = relations(usersInAuth, ({ many, one }) => ({
mfa_factorsInAuths: many(mfa_factorsInAuth),
sessionsInAuths: many(sessionsInAuth),
identitiesInAuths: many(identitiesInAuth),
one_time_tokensInAuths: many(one_time_tokensInAuth),
// companyUser: one(companyUsers, { fields: [usersInAuth.id], references: [companyUsers.id] }),
// applicant: one(applicants, { fields: [usersInAuth.id], references: [applicants.id] }),
}));
export const usersInAuthRelations = relations(usersInAuth, ({ many, one }) => ({
mfa_factorsInAuths: many(mfa_factorsInAuth),
sessionsInAuths: many(sessionsInAuth),
identitiesInAuths: many(identitiesInAuth),
one_time_tokensInAuths: many(one_time_tokensInAuth),
// companyUser: one(companyUsers, { fields: [usersInAuth.id], references: [companyUsers.id] }),
// applicant: one(applicants, { fields: [usersInAuth.id], references: [applicants.id] }),
}));
I preferably would want to add the companyUser and application relation in my own schema files since this generated file would be over written if I run introspect the database again.
6 replies