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
11 lines
305 B
Bash
Executable File
11 lines
305 B
Bash
Executable File
|
|
#!/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
|