Make Seeder
No need to create separate seeder files for each table. Seeder is available in the migration file. JetShift auto generate fake data based on the column type. You can just run the seeder command to seed the data.
Faker and Random Functions
JetShift supports Python’s faker and random functions to generate fake data.
Faker Functions
You can define custom faker data in the migration file. You need to add the seeder
key in the column definition. The seeder key value should be a valid faker function.
Python faker library is used to generate fake data. You can find the list of faker functions here.
Random Functions
JetShift also supports Python’s random module functions. You can use the random module functions as a seeder value.
Load Fake Data from CSV
You can also load fake data from a CSV file. To do this, you need to add seeders
directory in the app/migrations
directory.
Create a CSV file with the same name as the table name. The CSV file should contain the required column names in the first row.
Now, you need to add the data
key in the migration file and set it to true
.