Open seanaye opened 2 years ago
@seanaye I had (have) the same issue as you. I too have made a models file and was exporting them as a default array - but it turns out this breaks the link function.
The only way I could get it to work is exporting them not as default nor as an array, and putting them in like this : database.link([ Model1, Model2, ... ])
Not very graceful, but works (kinda). Now I have an issue where I have to drop the database every time I restart my server otherwise I get an error about existing foreign key.
I have the following two models defined
And this function to sync to database
When I run the application I get the following in my logs
I have tried with and without
{drop: true}
same error.If I remove the
Relationships.oneToOne(OrganizationCustomData, OrganizationUpdates)
then the tables are created in the db properlyDeno version:
denodb version: 1.0.40