Load seed data into the database.
Syntax
$ vela seeds load
$ vela seeds load -t productionThis loads the records in the data/seeds directory into the database. Seed files are loaded in alphabetical order and prefixed with a number to ensure a deterministic loading order.
Loading only ever adds. A record whose id is already in the database is left exactly as it is, so the command is safe to run any number of times, and a record edited in the admin panel is never overwritten by its seed file. The output says how many records were created and how many were already there.
Because records are matched by id, every seed record needs one. A file with a record that has none is refused before anything is written. vela seeds save always writes ids.
A record in an auth collection that has no password is created with a random one, and its owner sets their own through a password reset. A password written into the seed file is used as it is.
The app’s hooks apply to seed records as they do to any other write.
Targets
Without -t, seeds are loaded into the local database, the one you develop against. With -t, they are loaded into a deployed copy of the app over SSH, using the superuser credentials kept on the server:
$ vela seeds load -t production
$ vela seeds load -t staging
$ vela seeds load -t preview:feature/mapsvela deploy already loads seeds into the target it deploys, so naming a target is for the times between deploys, or after a deploy reported that its seeds did not all load.
Options
-t, --target <target>- Which copy of the app to act on, defaults tolocal--server <ssh>- Server this target runs on, recorded on first use-i, --identity <file>- SSH private key to authenticate with--ssh-port <port>- SSH port--accept-host-keys- Trust an unknown host key on first connect (CI)
vela test:server loads seeds into its own database automatically.