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
This commit is contained in:
10
reset-db.sh
Executable file
10
reset-db.sh
Executable file
@@ -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
|
||||
Reference in New Issue
Block a user