Skip to content
Discussion options

You must be logged in to vote

I'm working on a future drift version that will properly expose information about constraints on columns, but at the moment it is indeed very tricky to get access to that.

One thing you could do is:

  1. Create a GenerationContext.fromDb(yourDatabase).
  2. Call yourColumn.writeColumnDefinition(thatContext).
  3. Check GenerationContext.sql to see whether it contains ON UPDATE / ON DELETE as a substring.

I know this isn't great, but that seems to be the only way to get that information at the moment.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@CharlotteJu
Comment options

@simolus3
Comment options

Answer selected by CharlotteJu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants