#!/bin/sh

DIR="$(cd "$(dirname "$0")" && pwd)"

# Start the local Postgres database
"$DIR"/start

# Ensure the stop script is called on exit
trap '"$DIR"/stop' EXIT

# Generate Zod schemas from the Postgres database schema
zod-pg -o ./app/database/schema/generated --exclude '(knex|awsdms)_.*' --zod-version 4 --no-case-transform --json-schema-import-location '../../../json' --connection-string "postgresql://postgres:postgres@localhost:5432/songwhip_api"
