<commit_before># Setup

## Prerequisites

- [Elixir](http://elixir-lang.org/) (tested with Elixir version 1.4.1)
- [PostgreSQL](https://www.postgresql.org/) (tested with PostgreSQL 9.6.1)


## Build

Get dependencies and compile:

```sh
$ mix deps.get
$ mix compile
```

Create a database `participate_api_dev` and insert initial data:

```sh
$ mix ecto.setup
```

Start the API server:

```sh
$ mix phoenix.server
```

## Running tests

Create a database `participate_api_test`:

_ToDo: Should this be an `ecto` command?_

```sh
$ createdb participate_api_test
```

Run all tests:

```sh
$ mix espec
```
<commit_msg>Document database migration in README<commit_after># Setup

## Prerequisites

- [Elixir](http://elixir-lang.org/) (tested with Elixir version 1.4.1)
- [PostgreSQL](https://www.postgresql.org/) (tested with PostgreSQL 9.6.1)


## Build

Get dependencies and compile:

```sh
$ mix deps.get
$ mix compile
```

Create a database `participate_api_dev` and insert initial data:

```sh
$ mix ecto.setup
```

To migrate an existing database to a new version of the API server do this instead:

```sh
$ mix ecto.migrate
```

Start the API server:

```sh
$ mix phoenix.server
```

## Running tests

Create a database `participate_api_test`:

_ToDo: Should this be an `ecto` command?_

```sh
$ createdb participate_api_test
```

Run all tests:

```sh
$ mix espec
```

{'fraction_non_alphanumeric': 0.14056809905316825, 'fraction_numerical': 0.00873998543335761, 'mean_word_length': 4.305019305019305, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6450503', 'n_tokens_mistral': 525, 'n_tokens_neox': 483, 'n_words': 151}