melhawnuhra
DTDrizzle Team
•Created by melhawnuhra on 10/14/2024 in #help
Need help migrating from "reference" declarations to "foreignKeys"
I'm doing some refactoring on our codebase (to eliminate circular dependencies)
One of the main culprits is the
<name>.table.ts
files we have defined for our schema.
I want to avoid generating unnecessary migrations, so was trying to use the same names that were automatically assigned for the references.
After making the logical changes and generating a migration, I end up with a whole bunch of lines dropping the existing foreign keys, but none adding. Like this:
An example of one change:
In trialSubscription.table.ts
:
In foreignKeys.ts
:
In db.ts
:
How can I accomplish what we need to do here? Assistance greatly appreciated!2 replies