We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi;
My data is:
[{ "model": "Language", "data": { "code": "en", "name": "English", "flag": "gb" } }, { "model": "Language", "data": { "code": "tr", "name": "Türkçe", "flag": "tr" } }, { "model": "Language", "data": { "code": "sv", "name": "Svenska", "flag": "sv" } } ]
And code is:
var sequelize_fixtures = require('sequelize-fixtures'), models = { Language: require('../app/models/language') }; console.log("--------Fixtures started to load-------------"); sequelize_fixtures.loadFile('../fixtures/test_data.json', models, function() { console.log("Fixtures were loaded"); });
I see the fixtures loaded log, but there is no data in the db. Where am I wrong?
The text was updated successfully, but these errors were encountered:
I don't see anything wrong with what you posted, can't say. See if you're pointing to correct fixtures file, check database logs for errors
Sorry, something went wrong.
Ok
I've found the only way this works is if you use the absolute path to the file. E.g.
fixtures.loadFile(__dirname + '/../fixtures/*.json', models, function() { console.log('---fixtures loaded---'); });
No branches or pull requests
Hi;
My data is:
And code is:
I see the fixtures loaded log, but there is no data in the db. Where am I wrong?
The text was updated successfully, but these errors were encountered: