Questions tagged [seeding]

The tag has no usage guidance.

0
votes
2answers
52 views

Automatic Random Test Data Generation of Documents for Seeding a MongoDB Database

I'm using JSON Generator https://next.json-generator.com to seed my MongoDB. I'm finding trouble to generate a random set (from one to six) of colors out of the predefined group. I've succeded to ...
0
votes
1answer
29 views

Laravel Factories and Seeding: Static array of arrays

For some of my tables, I'd like to insert a fixed amount of rows with specific data. This is my categories factory: $factory->define(Category::class, function (Faker $faker) { return [ ...
1
vote
1answer
22 views

Laravel factory / seeder creating double records specified

I have Users and UserProfiles. All Users have one and only one UserProfile. My UserTableSeeder class is creating 25 records and for each record, outputting a UserProfile. For some reason, I am ...
0
votes
0answers
24 views

Is there a way to seed 3+ hierarchical levels (One-To-Many) including a self-reference relationship with a JSON?

I'm building a API and I'd like to be able to seed data from different JSON file each containing a JSON tree. It was working fine until I encounter a "Parent/Children Self-Reference" Relationship. I ...
0
votes
1answer
36 views

Laravel Model seeding in factory with column related to column on same table

I'm seeding some fake data in laravel I have table Schema::create('categories', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('parent_id')->...
0
votes
1answer
46 views

How to use Ruby tap method to pre-fill seed data

I am using Ruby `s tap method in my seed.rb like this:- PaymentMode.find_or_create_by(name: "Cash").tap do |pm| pm.instrument = false pm.bank_account_allocation = false pm.save! end In ...
0
votes
1answer
28 views

bittorrent webseed with authentication

I am designing a platform for serving media content for media makers, that works with web torrent. But for premium users we want serve high availability of content (for old media, that maybe has not ...
0
votes
1answer
31 views

Error: Invalid seed file: seed.js must have a seed function

I'm trying to seed some data into a database. The seed file is written in Typescript, then compiled into Javascript for knex to run. When I try and run the seed file I get the error listed in the ...
0
votes
0answers
16 views

Cakephp How to keep syncing Product database table rows in with dev table rows

I have a table lets call it permissions I want to keep it in sync from my local dev server with product as easy as possible. In current state, im building new seed file every time (overriding old one) ...
1
vote
1answer
25 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 ...
2
votes
0answers
111 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
20 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
96 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
74 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
193 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
47 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
116 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
58 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
62 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
240 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
150 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
71 views

Seeding with chained relationship in Laravel 5.7

I have a User, Company and BusinessUnit 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
74 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
209 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
30 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
27 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
52 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
2k 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 ...
1
vote
1answer
38 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
111 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
420 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
178 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
79 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
28 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
189 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
12 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 ...
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
205 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
170 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
96 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
83 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
55 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
508 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 ...
4
votes
0answers
320 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
100 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 ...
-1
votes
2answers
1k 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
37 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 ...

http://mssss.yulina-kosm.ru