# Fixtures

Fixtures are mock data for testing and development. They are stored in the `data/fixtures` directory. Fixtures are meant to be loaded after seed data, and can depend on seed data records.

### Syntax

```
$ vela fixtures <action>
```

The action can be one of the following:

- [`generate`](/fixtures/generate) - Generate fixture files from the database schema
- [`load`](/fixtures/load) - Load fixtures into the database
- [`clear`](/fixtures/clear) - Clear loaded fixtures
- [`reset`](/fixtures/reset) - Clear and reload fixtures
- [`regen`](/fixtures/regen) - Clear, regenerate the files, and reload them

### Fixtures vs seeds

[Seeds](/seeds) are real data your application needs to function, kept in version control and loaded into production. Fixtures are throwaway mock data for development and tests. Fixture records are given ids prefixed with `vela`, which is how `clear` knows what to remove — data you created yourself is never touched.

### In tests

[`vela test:server`](/test/server) loads fixtures, after seeds, into its throwaway database before every run. Tests share that database, so treat fixture records as read-only and create your own for anything a test changes.