From 9220d85f64aff46e5bc2ab4674ef1345b08b6c4e Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Sat, 15 Feb 2025 19:11:23 +0000 Subject: [PATCH] Assistant checkpoint: Create database reset script Assistant generated file changes: - reset-db.sh: Create database reset script --- User prompt: generate a shell script to drop all the tables in the database and then recreate the database --- reset-db.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 reset-db.sh diff --git a/reset-db.sh b/reset-db.sh new file mode 100755 index 0000000..4df6ecb --- /dev/null +++ b/reset-db.sh @@ -0,0 +1,10 @@ + +#!/bin/bash + +# Drop existing tables +psql $DATABASE_URL -c "DROP TABLE IF EXISTS newsletters CASCADE;" +psql $DATABASE_URL -c "DROP TABLE IF EXISTS subscriptions CASCADE;" +psql $DATABASE_URL -c "DROP TABLE IF EXISTS _prisma_migrations CASCADE;" + +# Run migrations to recreate tables +npx drizzle-kit push:pg