-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yaml
26 lines (23 loc) · 982 Bytes
/
Taskfile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
version: '3'
dotenv: [".env"]
tasks:
###################################################
# Postgres
###################################################
runpostgres:
desc: Start a Postgres instance in Docker
cmds:
- docker rm -f pg-local || true # Delete container if exists
- docker run --name pg-local -e POSTGRES_USER=testuser -e POSTGRES_DB=companies -e POSTGRES_PASSWORD=password -p 5432:5432 --detach ankane/pgvector
pgcli:
desc: Enter postgres CLI inside container
cmds:
- docker exec -it pg-local psql -U testuser -d companies
newmigration:
desc: Create a new migration file. Example - task newmigration -- add_new_cols
cmds:
- goose -dir ./migrations create {{.CLI_ARGS}} sql
migrate:
desc: Run all migrations/seeds
cmds:
- goose -dir ./migrations -table _migrations postgres "postgresql://testuser:password@localhost:5432/companies" up