#!/bin/bash
set -e

RDS_CERT_PATH="/etc/ssl/certs/rds-global-bundle.pem"

if [ ! -f "$RDS_CERT_PATH" ]; then
  echo "Downloading RDS certificate bundle..."
  curl -sSf https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem \
    -o "$RDS_CERT_PATH"
fi

pnpm run db:migrate:schema:up
