Giter Club home page Giter Club logo

Comments (2)

oliverbenns avatar oliverbenns commented on July 25, 2024 1

I had a similar issue recently that I spent way too much time on. This is due to the way babel exports work. In short, I had to revert to module.exports as opposed to export default for my fixtures.

from sequelize-fixtures.

ajfisher avatar ajfisher commented on July 25, 2024

Got to the bottom of this so here's the notes for someone who comes along behind.

If you have a broken up set of models (not all defined in the one file) then you'll more than likely be using a models/index.js file to define all the sequelize stuff as well as the relationships between them. This code will also have a loader for all your models so your application can use them.

Instead of defining the models to use the way it says to do it in the readme get your returned models from the index.js file

var models = require('./models');

And then pass that as the models definition to the fixture loader. This will have all of your models defined the way the fixture loader is assuming it will come with actual objects as the models.

from sequelize-fixtures.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.