Skip to content

Commit

Permalink
No more manual uuid-ossp creation
Browse files Browse the repository at this point in the history
  • Loading branch information
neongreen committed Aug 6, 2023
1 parent e5dd59a commit 40645a9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PGDATABASE=db_dev
PGHOST=localhost
PGPORT=3999

# For docker-compose
# For docker compose
POSTGRES_PASSWORD=password
POSTGRES_USER=user
POSTGRES_DB=db_dev
Expand All @@ -32,4 +32,4 @@ NEXT_PUBLIC_BEEMINDER_CLIENT_ID=6a2dv586au2n75iq86be7u3k
BEEMINDER_CLIENT_SECRET=8d1i5xw9q0apogmnqwoylaegx

# For the frontend
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_APP_URL=http://localhost:3000
4 changes: 1 addition & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ jobs:
run: npm ci

- name: Create DB tables
run: |
echo 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp";' | npx prisma db execute --preview-feature --schema=prisma/schema.prisma --stdin
npx prisma db push
run: npx prisma db push

# Note: we always install Chromium because we use it in playwright-setup.ts, but ideally it should be fixed
- name: Install Playwright
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ Then:
git submodule update --init --recursive # pull submodules
volta install dotenv-cli # install dotenv
brew install postgres # install psql
docker-compose up -d # run services
ln -s .env.development .env # for convenience
docker compose up -d # run services

# Initialize the DB if it's empty
dotenv -- psql -c 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp";'
npx prisma db push
dotenv -e .env.development -- npx prisma db push
```

You should also run the GraphQL codegen watcher, at least until https://github.com/capaj/graphql-codegen-vscode/issues/21 is fixed:
Expand All @@ -28,6 +26,13 @@ You should also run the GraphQL codegen watcher, at least until https://github.c
npm run gql:watch
```

If you want to remove the databases, run:

```bash
docker compose down
docker volume rm $(docker volume ls -q | grep woc_)
```

## Local development - running the app

Check that the services are running:
Expand Down

0 comments on commit 40645a9

Please sign in to comment.