Skip to content

Commit

Permalink
Merge pull request #218 from dump-hr/adding-cascade-on-delete-to-job-…
Browse files Browse the repository at this point in the history
…table

adding cascade delete migration
  • Loading branch information
bdeak4 authored Feb 15, 2024
2 parents e9b6b65 + 1fa8f08 commit ec38997
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/api/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const job = pgTable('job', {
createdAt: timestamp('created_at').defaultNow(),
companyId: integer('company_id')
.notNull()
.references(() => company.id),
.references(() => company.id, { onDelete: 'cascade' }),
});

export const jobRelations = relations(job, ({ one }) => ({
Expand Down

0 comments on commit ec38997

Please sign in to comment.