Generating random data
Now that our database and model definition have been updated, we need to generate some random data to populate our database and make our dashboard more interesting. We also need to set some random values for the new columns of the to-dos that already exist in the database. Let’s create a new migration to script and run our data generation:
julia> using SearchLight julia> SearchLight.Migrations.new("generate fake todos")
In the resulting migration file, add the following code:
module GenerateFakeTodos using ..Main.TodoMVC.Todos using SearchLight using Dates using Faker randcategory() = rand(Todos.CATEGORIES) randdate() = Dates.today() - Day(rand(0:90)) randduration() = rand(10:240) function up() for i in 1:1_000 Todo( todo = Faker.sentence(), completed = rand([true, false]), user_id = DbId...