mirror of
https://github.com/soconnor0919/hristudio.git
synced 2025-12-12 07:04:44 -05:00
feat(auth): Add Clerk user sync to database using webhooks
This commit is contained in:
28
src/db/drop.ts
Normal file
28
src/db/drop.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { sql } from '@vercel/postgres';
|
||||
import { db } from './index';
|
||||
import { config } from 'dotenv';
|
||||
|
||||
// load .env.local
|
||||
config({ path: '.env.local' });
|
||||
|
||||
async function dropAllTables() {
|
||||
try {
|
||||
await sql`
|
||||
DROP TABLE IF EXISTS
|
||||
user_roles,
|
||||
role_permissions,
|
||||
permissions,
|
||||
roles,
|
||||
participant,
|
||||
study,
|
||||
users
|
||||
CASCADE;
|
||||
`;
|
||||
console.log('All tables dropped successfully');
|
||||
} catch (error) {
|
||||
console.error('Error dropping tables:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
dropAllTables();
|
||||
Reference in New Issue
Block a user