Fix migrations and expand CONTRIBUTING.md docs (#661)

This commit is contained in:
Gabi
2022-05-31 11:41:42 -03:00
committed by GitHub
parent 974e75164b
commit 463f13877b
2 changed files with 10 additions and 0 deletions

View File

@@ -59,6 +59,11 @@ Firezone development requires access to a Postgresql instance. Versions 9.6 or
higher should work fine. Access can be configured using the [
.env](#the-env-file) described below.
**Note:** To use the default configuration without specifying the database URL in the `.env` file, you need to configure the `postgres` user with the password `postgres` to do so use the following command:
```sql
ALTER USER postgres WITH PASSWORD 'postgres';
```
### Pre-commit
We use [pre-commit](https://pre-commit.com) to catch any static analysis issues

View File

@@ -2,6 +2,11 @@ defmodule FzHttp.Repo.Migrations.AddUuids do
use Ecto.Migration
def change do
execute(
"CREATE EXTENSION pgcrypto",
"DROP EXTENSION pgcrypto"
)
execute(
"ALTER TABLE rules ADD COLUMN uuid uuid DEFAULT gen_random_uuid() NOT NULL",
"ALTER TABLE rules DROP COLUMN uuid"