feat: with tx on all

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-10-03 23:08:12 +02:00
parent e774529b04
commit bc28451f8d
18 changed files with 256 additions and 28 deletions

4
scripts/db:shell.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
export PGPASSWORD="cuddle"
psql -h localhost -d cuddle -U cuddle

19
scripts/local_down.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
set -e
docker_compose_content=$(cat <<EOF
version: "3"
services:
postgres:
image: "postgres:latest"
environment:
POSTGRES_USER: cuddle
POSTGRES_PASSWORD: cuddle
POSTGRES_DB: cuddle
ports:
- "5432:5432"
EOF)
docker-compose -p cuddle_local -f <(echo "$docker_compose_content") down --remove-orphans --volumes

24
scripts/local_up.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
set -e
docker_compose_content=$(cat <<EOF
version: "3"
services:
postgres:
image: "postgres:latest"
environment:
POSTGRES_USER: cuddle
POSTGRES_PASSWORD: cuddle
POSTGRES_DB: cuddle
ports:
- "5432:5432"
EOF)
docker-compose -p cuddle_local -f <(echo "$docker_compose_content") up -d --remove-orphans
cat <<EOF > local.env
DATABASE_URL=postgres://cuddle:cuddle@localhost:5432/cuddle
EOF