Seeding


Introduction

There are a number of situations where it may be usefull to populate the database with fake data. For example, you may want to test the Elasticsearch connector with fake data.

TRAX LRS provides some usefull seeding commands for that. Each time you run a seeding command, you decide how many new records you want to create, and how many exsiting records you want to update.

Commands

Seeding statements

php artisan statements:seed

When not provided in the command line, the following option will be asked.

Option Example of value Description
--owner 1 Internal ID of the LRS store
--entity 1 Internal ID of the LRS entity
--create 100 Number of new records to create
--update 10 Number of existing records to update

Seeding other xAPI data

php artisan agents:seed
php artisan activities:seed
php artisan agent-profiles:seed
php artisan activity-profiles:seed

When not provided in the command line, the following option will be asked.

Option Example of value Description
--owner 1 Internal ID of the LRS store
--create 100 Number of new records to create
--update 10 Number of existing records to update

Removing data

There are a few commands to remove generated data. Refer to the data deletion page.