Skip to content

Latest commit

 

History

History
79 lines (59 loc) · 3.19 KB

File metadata and controls

79 lines (59 loc) · 3.19 KB

Assignment ingester command

AssignmentIngesterCommand is responsible for ingesting assignment data into the application.

Prerequisites: user ingestion and line item ingestion must be done before starting assignment ingestion.

Usage

$ sudo -u www-data bin/console roster:ingest:assignment <path> [--storage=local] [--delimiter=1000] [--batch=1000]

Main arguments

Argument Description
path Relative path to the file [example: var/assignments.csv]

Main options

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 -h

CSV file format

Here 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.

Related environment variables

Variable Description
DATABASE_URL Database connection string. Supported formats are described here.

Examples

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 --force

Ingesting assignments from default (local) storage with custom column delimiter (;):

$ sudo -u www-data bin/console roster:ingest:assignment /path/to/file.csv --delimiter=; --force

Ingesting assignments from a custom storage:

$ sudo -u www-data bin/console roster:ingest:assignment /path/to/file.csv --storage=myCustomStorage --force

For configuring custom storages, please check the Storage registry documentation.