Questions tagged [seeding]
525 questions
24
votes
3 answers
Sequelize: seed with associations
I have 2 models, Courses and Videos, for example. And Courses has many Videos.
// course.js
'use strict';
module.exports = (sequelize, DataTypes) => {
const Course = sequelize.define('Course', {
title: DataTypes.STRING,
description:…

zett
- 397
- 1
- 2
- 8
24
votes
2 answers
Entity framework migration and seeding specific update
does anyone know how you can seed a specific update using EF 5 migrations? I have existing database, alredy has lookups populated, and am developing some Audit functionality. I have created an AuditType entity and Audit. When I call update-database,…

CheGuevarasBeret
- 1,364
- 2
- 14
- 33
19
votes
4 answers
Constructors on classes extending Eloquent
I just started a new website and I wanted to make use of Eloquent. In the process of seeding my database, I noticed that I would get empty rows added if I had included any kind of constructor on the model that extends eloquent. For example,…

vikingsfan19
- 531
- 1
- 5
- 14
18
votes
1 answer
You cannot call create unless the parent is saved error when seeding in rails
I'm trying to populate my SQLite3 database with a simple seed file that is supposed to create a bunch o movies entries in the Film table and then create some comments to this movies that are stored in Comments table.
formats = %w(Beta VHS IMAX HD…

Cristi
- 445
- 2
- 4
- 14
18
votes
3 answers
What does the integer while setting the seed mean?
I want to randomly select n rows from my data set using the sample() function in R. I was getting different outputs each time and hence used set.seed() function to get the same output. I know that each integer in the set.seed() will give me a unique…

Prateek Kulkarni
- 481
- 2
- 5
- 12
17
votes
5 answers
Seed initial data in Entity Framework 7 RC 1 and ASP.NET MVC 6
It seems that in Entity Framework 7 there is no native support for seed data yet (https://github.com/aspnet/EntityFramework/issues/629).
There is no DbMigrationsConfiguration class, no Seed method in the template code provided by Microsoft.
So how…

Nikolay Kostov
- 16,433
- 23
- 85
- 123
15
votes
6 answers
How do I specify a single file to be seed only
I am using knex for seeding and I have a folder called development where I have all the seeds files.
What I would want is: How to seed single file.
The command I am using is: knex seed:run --env=development
But this command is to seed all the files…

Lulzim
- 547
- 4
- 9
- 22
15
votes
1 answer
Seeding a Database with Code First Entity Framework - Foreign key syntax
I am trying to find the correct syntax to seed a database with test data. I have a foreign key to my product table. It is the category. I have seeded the database with the values for categories, but stuck on how to add that relationship to the…

Jeff Pearce
- 581
- 7
- 15
15
votes
1 answer
`sample()` gives different values with same `set.seed()`
I was creating some random samples and plotting them and noticed a strange behavior. Sampled values were different after loading ggplot2:
set.seed(111)
library(ggplot2)
sample(1:10, 10)
# [1] 8 4 5 3 7 1 6 2 10 …

N8TRO
- 3,348
- 3
- 22
- 40
11
votes
2 answers
Is it possible to seed only with aria2?
I build a little tool (IoT) with an Intel Compute Stick which downloads a torrent content and then seed it.
And it works.
Now I want to seed the files I have downloaded EVEN after a restart and without re-downloading them (for obvious…

Victor Castro
- 1,232
- 21
- 40
11
votes
3 answers
How to seed database in yii2?
I am new to Yii framework.
I want to seed my database like it can be done in Laravel framework using Faker.
I tried this http://www.yiiframework.com/forum/index.php/topic/59655-how-to-seed-yii2-database/ but it does not provide much details.
I would…

Faisal Qureshi
- 231
- 1
- 2
- 9
10
votes
3 answers
Is there a maximum character limit to random seed?
Is there a maximum number of characters (and therfore value) to the seed in Python?
import random
random.seed(13) # fine
random.seed(1234567890) # also…

Ghoul Fool
- 6,249
- 10
- 67
- 125
10
votes
1 answer
Entity Framework - Seed AddOrUpdate with multi column index as identifier
I am trying to seed a database using the context.AddOrUpdate method, but the problem is that I need to make the inserted data unique based on a multi column index.
[Table("climbing_grades")]
public class ClimbingGrade : EntityBase
{
///…

Silthus
- 1,679
- 1
- 23
- 27
9
votes
2 answers
Array to string conversion (SQL: insert into
I'm trying to insert data from a Seeder in Laravel 5.6 and I'm having a problem with the field that is json type. I want this field ('stops') to be an array (for example of ten integers not repeated).
The table seeder (RoutesTableSeeder.php) is…

Ber Tsacianegu del Tepuy
- 361
- 1
- 4
- 18
9
votes
5 answers
Asp.net core Identity "The INSERT statement conflicted with the FOREIGN KEY constraint "
I create ASP.NET CORE application with ASP.NET CORE Identity.
I create seed class for saving new users and roles for first startup application. Inside this seed class I get following error when I add Role To User.
The INSERT statement conflicted…

Elvin Mammadov
- 25,329
- 11
- 40
- 82