[Doc] seeding database when using Models
See original GitHub issueI’m running 0.2.0-beta.3. I’ve defined models since I need support for relationships. Seems to work fine. But I haven’t any clue how to seed the database. If I’m running server.create('my-model');
I’m getting an error that I must define a factory. But can’t find any information in docs how models and factories play together.
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Data Seeding - EF Core - Microsoft Learn
Data seeding is the process of populating a database with an initial set of data. There are several ways this can be accomplished...
Read more >Database: Seeding - The PHP Framework For Web Artisans
Laravel includes the ability to seed your database with data using seed classes. All seed classes are stored in the database/seeders directory. By...
Read more >Seeding a database | Zell Liew
The process where you add initial content to a database is called seeding. Here, I teach you how to seed a database automatically....
Read more >Seeding your database - Prisma
This guide describes how to seed your database using Prisma Client and Prisma's integrated seeding functionality. Seeding allows you to consistently ...
Read more >Seeding test databases in 2021 - best practices - Synth
In this tutorial, we'll learn how to design a Prisma data model for a basic message board and how to seed test databases...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran into this error today. The Solution for me was to make sure that I had created the accompanying model and not only the factory. It would be nice to add some error handling that points out that a model is attempting to create a relationship on a model that is no defined.
My experience is the errors says something along the lines of cannot find on where() or find() on ‘undefined’ which in context makes sense but I think we can add more descriptive errors for this. Let me know if this is a good idea and if so I’ll take a stab at adding the error messages.
Super thanks for all work. This add-on is one of the primary reasons to why we use ember.
Mm great point - I’ve opened https://github.com/samselikoff/ember-cli-mirage/issues/997 and would love some help!
And thank you very much, I’m glad its solving your problems!