© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
2 replies
DN_Dev

Foreign Key - On Delete

When using
.references(() => id, {onDelete: 'cascade'})
.references(() => id, {onDelete: 'cascade'})
however it doesn't seem like there's a similar option using
extraConfig
extraConfig
option, which I use mainly to name my foreign keys.

(table) => ({
        reference: foreignKey({
            columns: [table.some_id],
            foreignColumns: [some.id],
            name: 'some_id_fk',
        }),
    })
(table) => ({
        reference: foreignKey({
            columns: [table.some_id],
            foreignColumns: [some.id],
            name: 'some_id_fk',
        }),
    })


Can anyone confirm? Otherwise I'd have to manually overwrite migrations I guess
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

foreign key
Drizzle TeamDTDrizzle Team / help
3y ago
foreign key mismatch
Drizzle TeamDTDrizzle Team / help
2y ago
disambiguate foreign key relations
Drizzle TeamDTDrizzle Team / help
2y ago
Deferrable foreign key constraints
Drizzle TeamDTDrizzle Team / help
3y ago