Closed lynnaloo closed 8 years ago
Maybe this will get you by for now: if you specify a primary key in your fixture, the record with that id will be updated rather than created.
@lynnaloo do you have a suggested spec? I like the idea you alluded to of respecting the migrate
option per collection.
Also, I'd like to point out that there is a marginally related bug in waterline-fixtures: https://github.com/devinivy/waterline-fixtures/issues/2
@devinivy I simplified my fixtures more and it looks like my issue is with the nested models. Even if I specify the primary key id
, it tries to add them again to the join table and gets a constraint violation.
Edit: I can now get this to work if migrate
is set to alter
, but then it does not work to initially create the database.
Sadly gotta drop this– the problems around fixtures/migrations are a hard enough to merit their own tools! Next version of dogwater wont have fixtures (#40).
Right now, the fixtures seem to be loading every time the server starts, even if
migrate: safe
is set in the models. If there are no unique fields, then it duplicates the data. If there are unique fields, then the plugin fails on server startup. I'd like the option to just load the fixtures on a blank database only.