AssignmentIngesterCommand is responsible for ingesting assignment data into the application.
Prerequisites: user ingestion and line item ingestion must be done before starting assignment ingestion.
$ sudo -u www-data bin/console roster:ingest:assignment <path> [--storage=local] [--delimiter=1000] [--batch=1000]| Argument | Description |
|---|---|
| path | Relative path to the file [example: var/assignments.csv] |
| Option | Description |
|---|---|
| -s, --storage | Filesystem storage identifier [default: local] More information can be found here. |
| -d, --delimiter | CSV delimiter [default: ,] |
| -b, --batch | Batch size [default: 1000] |
| -f, --force | To apply database modifications or not [default: false] |
For the full list of options please refer to the helper option:
$ sudo -u www-data bin/console roster:ingest:assignment -hHere is an example csv structure:
username,lineItemSlug
user_1,slug_1
user_2,slug_1
user_3,slug_2
user_4,slug_2| Column | Description |
|---|---|
username |
Unique identifier of the user. |
lineItemSlug |
Slug (external identifier) of the line item the created assignment will be linked to. |
| Variable | Description |
|---|---|
DATABASE_URL |
Database connection string. Supported formats are described here. |
Ingesting assignments from default (local) storage with custom batch size:
$ sudo -u www-data bin/console roster:ingest:assignment /path/to/file.csv --batch=10000 --forceIngesting assignments from default (local) storage with custom column delimiter (;):
$ sudo -u www-data bin/console roster:ingest:assignment /path/to/file.csv --delimiter=; --forceIngesting assignments from a custom storage:
$ sudo -u www-data bin/console roster:ingest:assignment /path/to/file.csv --storage=myCustomStorage --forceFor configuring custom storages, please check the Storage registry documentation.