Questions tagged [seeding]

The tag has no usage guidance.

1
vote
1answer
17 views

In Django, can you run seed data without always generating a migration?

I'm using Django and Python 3.7. I have created a YAML file with seed data for my db ... ./myapp/fixtures/seed_data.yaml How do I run this without generating a new migration for it, as is specified ...
-1
votes
0answers
15 views

Create selection boxes based on matching variables

This is a very hard one to explain. I am very terrible at PHP but have a uni project to create a tournament seeding application. Basically at my current stage I have a selection box, this links with ...
2
votes
0answers
36 views

Stuck trying to use Random object for my Intro to Computer Programming with Java homework

Briefly, I have textbook lab assignments for this class and I'm currently doing a module on objects. This lab has me using a random number generator but due to auto grading it needs repeatability. It ...
0
votes
1answer
19 views

Entity Framework not inserting data at all

First time I am facing this, when using the base.Seed(context) or using the context.SaveChanges() EF will not insert any data into the database. This is my setup: Context public ...
-2
votes
2answers
25 views

MongoDB seed script for 10million entries takes 30 minutes

I have a project im working on and I have to seed a database with 10 million random rows, which i have successfully done. However it takes about 30 minutes for it to complete, which is expected, but i ...
0
votes
1answer
34 views

Insert value into identity column in Core 2.2

Trying to seed database in MSSQL server. 'Id' column is set to identity. I fail to understand why EF needs data for 'Id: public class Location { public int? Id { get; set; } public string ...
0
votes
1answer
61 views

Seed MongoDB Data

The function below adds data to the database, to the Food collection, only if the collection foods is equal to zero. The idea is to be able to only seed the database once. This is working perfectly. ...
-1
votes
1answer
31 views

Tournament Tree seeding with n Teams, m Groups, k Proceeder and Lucky loser

Imagine a tournament with 6 groups and 4 Teams per group. 2 Teams of each group (called "proceeder" from now on) proceed to the elimination phase (tournament tree / bracket stage...). Now that there ...
-2
votes
2answers
69 views

EF Core 2.1 with Seed method and NotMapped attribute

I have a question, why my Strategy property is null, when i getting all DbSet from context? How to [NotMapped] property make visible in my backend? My class looks like this: public class Machine { ...
0
votes
1answer
53 views

EF Core 2.1.1 Seed method with consturctor call

Why property setted in constructor of seeding class is equal to 0? I have my own seed method: public static void Seed(this ModelBuilder modelBuilder) { Random random = new Random(); ...
0
votes
1answer
42 views

EF Core 2.1.1 Seed data not working with override double

could you tell me why in my DB i get 0 values on after Seed method? This is how it looks like: public static void Seed(this ModelBuilder modelBuilder) { int countOfWorkers = 10; ...
0
votes
1answer
126 views

Dynamo db Seed data insertion not working when deploying to aws

I have a serverless framework and dynamo db in my local. I am trying to seed data . When i do 'sls offline start', seed data is getting inserted into my local dynamo db. but when i deploy it to aws ...
0
votes
0answers
80 views

Sequelize CLI complains about “Unexpected Identifier” when attempting to run db:seed:all

I am trying to set up a seeder for my Sequelize models. I have a single 1-many association. All of my syntax appears to be correct and passes through my linter (semistandard) successfully. Whenever I ...
0
votes
1answer
64 views

Seeding with chained relationship in Laravel 5.7

I have a User, Company and BussinessUnit model, already created the relationships and I want to do database seeding using model factory with this condition: Each User has one Company Each ...
1
vote
1answer
38 views

Why does exporting from Excel to Csv cause Laravel Seeder to fail silently when using Flynsarmy csv seeder package?

I'm using this package: https://github.com/Flynsarmy/laravel-csv-seeder Flynsarmy Csv seeder works fine if I manually create a file and save it as a csv, then seed my database. Artisan responds with ...
0
votes
1answer
114 views

SQLSTATE[HY000]: General error: 1364 Field 'album_id' doesn't have a default value

I want to link multiple images to multiple albums. I got the following error: SQLSTATE[HY000]: General error: 1364 Field 'album_id' doesn't have a default value I don't want to have a default ...
0
votes
2answers
28 views

EF seed is not applied when run

I need to add some dummy data to my database and wanted to use Seed as described here however I cannot get it to work. When I run Update-database, it says that it is Running Seed method, but when it ...
0
votes
1answer
24 views

Seed data to PSQL with Sequelize has different IDs every time seed script runs

I have a seedDB script to seed data into my PSQL database. The data comes in fine for the most part, but the IDs for the Genre table and are different every time I run my seed:db script. The artist ...
0
votes
3answers
48 views

Entity Framework inserting duplicates on Seeding database [duplicate]

EDIT---- From here i tried assigning Id's in the seeding method and this was OK for Languages but not when i added Address to the customer and assign Id's as well to these addresses, than it created ...
0
votes
1answer
19 views

When is mt_rand seeded?

At what moment is the seed for mt_rand selected? According to several sources php should reseed this PRNG in every new process. This works perfectly on my windows machine. On the linux machine ...
3
votes
2answers
859 views

ASP.NET Core 2.2 Create IdentityUser

Brand new to ASP.Net Core. Having to create an asp.net core 2.2 project with Identity (and have users seeded). I can't find any documentation on how to do this exactly. I was able to find the code ...
0
votes
1answer
40 views

Seeding method is inserting additional Entities with NULL values

I am having this strange behavior all of a sudden (i have compared my files in version control (tfs) to be sure i did not change anything and i didn't found anything different). I am seeding my ...
0
votes
1answer
30 views

Will setting Rails model attributes with the same value make changed? return true?

I'm looking to make my db:seed task a little more dynamic by allowing certain entries in my application to be created or updated (or nothing at all) based on the values of in db/seeds.rb and the ...
2
votes
1answer
91 views

Seeding profile pictures stored in S3 from Faker

I'm working on a Rails application and I have a has_one_attached profile picture for active storage in S3 and I would like to seed data from Faker for their avatar images when I seed my users. Here ...
0
votes
0answers
344 views

How to resolve sircular dependencies in EF Core 2.1 initialization seed?

I have forum data entities: Topic - Id - Title - Text - LastMessageId (nullable) Message - Id - Text - TopicId I need to seed it using new Entity Framework Core 2.1 system of ...
1
vote
0answers
114 views

Laravel seeder - check if unique slug exists already

I am seeding a database table ('games') from several csv files. The table has a many-to-many-relationship with another table ('consoles'). The code works for the first csv file... I am expecting to ...
-1
votes
3answers
59 views

Excel VBA Seed based on the date

I'm working on a programm where I use a seed. This seed should be based on the date, so every single day i get a new value. Using the seed several times a day should not change the value getting back. ...
0
votes
0answers
23 views

TFS CF Migration seed method fails due to code trying to access azure key vault

We are setting up azure key vault to use for always encrypted columns in SQL. I have gotten all of the code setup and the CF migrations, update-database, work perfectly on my local machine but when I ...
0
votes
1answer
132 views

Laravel tries to seed column that is not asked for

I have a strange problem and an hour of googling and searching through stackoverflow didn't get me any closer to a solution. What happens is that when I trye to seed a table (let's call it my_table ...
0
votes
0answers
10 views

Entity Code First Seeding issue on primary key

All my tables have autogenerated and a generated id. [Required, Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] [MaxLength(50)] public string Id { get; set; } /// <summary> /// This is ...
2
votes
0answers
154 views

Tensorflow: set seed by tensor

I would like to build graph with some random values in it. Then I would like to evaluate the graph with different seeds. Here is an example what i'm trying to achieve import tensorflow as tf seed ...
1
vote
0answers
8 views

Seed Method Doesn't Populate Tables

The database is create successfully as well as the tables. However, whether I put the seed code in the configuration file or as a initializer. The tables are never populated with data. Things I have ...
0
votes
0answers
135 views

MongoDB plus docker-compose: How to create a user and a database

I was reading up on the docker documentation for mongodb on how to create a user and an empty database with docker-compose. Turns out you can't. There won't be a database unless you insert actual data....
0
votes
0answers
14 views

Set new seed for particular subset of data in table

It must be first understood, I am dangerously ignorant in SQL. I can only do very basic things, generally following code I find exactly (changing in my pertinent information). Our company uses a SQL ...
0
votes
1answer
124 views

Hooks when seeding objects

In my model code, I encrypt the user's password with the hook beforeCreate. In a seeder I'm creating 10 users with queryInterface.bulkInsert. As I've understood it, hooks are bypassed when using ...
1
vote
1answer
93 views

Java method for rolling dice returns 'doubles' every time [duplicate]

I am creating a game where a user has to roll two dice and do certain things according to what is rolled. I have one method for rolling the dice, which I call twice to stimulate rolling two dice. ...
2
votes
1answer
65 views

Get SQL Error 20006 during Laravel migration

I'm trying to migrate some data by using laravel seeders. My seeder takes some records from a MSSQL database and insert it into a MySQL. The point is that it takes the data correctly from MSSQL but, ...
1
vote
0answers
46 views

EF Core 2.1 seeding guidance

Please provide some guidance for the following problem: I have two data configurations to support, each including different initial data. Imagine two types of customers, pet supply stores and book ...
0
votes
1answer
422 views

Adding image to seed database in rails 5.2 active storage

Just trying to add an image to my seed file. Having a little issue when trying to add using the new active storage in Rails 5.2 Can anyone spot what's happening. Here is the code followed by error in ...
3
votes
0answers
287 views

EF Core 2.1 HasData() creating deletes and re-inserts for unchanged entities on subsequent migrations

Update 8/29/18 Seeing this issue in inline new-ing of seed data as well. Opened an EF Core issue. Will update the question with any findings. I am trying to use EF Core 2.1's seeding mechanism. ...
0
votes
1answer
81 views

Environment check in OnModelCreating

I am seeding my data in OnModelCreating method in ApplicationDbContext.cs. I would like to always add some data, but also to add some data conditionally (only if the environment is development). How ...
-2
votes
2answers
934 views

How can i seed with faker a random id or null in Laravel?

I am trying to seed a parent_id column with a random id of the same table or let it be null. This i thought it will work: ... 'parent_id' => $faker->boolean() ? Page::all()->random()->id ...
0
votes
1answer
35 views

Ignoring a single fixture file while seeding database

I am hosting a project on heroku, written in rails. I have a fixture file (comments.yml) that I use during testing, but which I do not want to include when seeding my database (via 'heroku run rails ...
2
votes
4answers
171 views

Randomly rounding 0.5 up or down with a seed in R

I have a data set containing non-integer values that I want to round to the closest integer. This is pretty easy, but I need a function that does two things in addition to just rounding: It should ...
0
votes
1answer
176 views

Laravel 5 - Transfer MySQL data from Dev to Staging/Production [duplicate]

I am having this question that I have been scratch my head for hours... I have build a Laravel 5.4 app that's ready to be tested on staging. I am able to create the database and run migration. So ...
1
vote
1answer
117 views

Incorrectly nested style tag found then seeding database in laravel

then I try to seed my laravel database i get: Incorrectly nested style tag found. I have done everything as is required in documentation and can't understand the reason of this error Symfony\...
1
vote
0answers
441 views

EF Core Fluent API HasData breaks auto-increment primary key

Essentially, whenever I seed data with EF Core using the HasData method as shown here, it will only allow me to seed the data if I give each seeded entity an ID. I shouldn't have to, because, the ID ...
1
vote
1answer
43 views

Laravel seeding not working on cloned repository

Database seeding using laravel model factories works perfectly on my local(original) repo/laravel project file, but when I clone the remote from github,seeding throws this error: Column n ot ...
1
vote
2answers
172 views

Seeding Development database with data from Production

I'm dealing with a complex Rails application that uses Postgresql. Creating seeds from scratch may be too complicated (there are many models and activation steps that can only work in a very specific ...
0
votes
2answers
429 views

Spring boot: What is the right way to seed the databse?

I have a Spring Boot application and would like to seed the database the first time the application runs, but not every time the application runs, and then only if the data does not already exist. My ...

http://mssss.yulina-kosm.ru