mirror of
https://github.com/soconnor0919/hristudio.git
synced 2025-12-11 22:54:45 -05:00
- Replace firstName/lastName with name field in users API route - Update user formatting in UsersTab component - Add email fallback when name is not available
21 lines
528 B
TypeScript
21 lines
528 B
TypeScript
import { sql } from '@vercel/postgres';
|
|
import { db } from './index';
|
|
import { config } from 'dotenv';
|
|
|
|
// load .env.local
|
|
config({ path: '.env.local' });
|
|
|
|
async function dropAllTables() {
|
|
try {
|
|
// drop all tables, regardless of name
|
|
await sql`
|
|
DROP TABLE IF EXISTS ${sql.raw(Object.values(tables).map(table => table.name).join(', '))}
|
|
`;
|
|
console.log('All tables dropped successfully');
|
|
} catch (error) {
|
|
console.error('Error dropping tables:', error);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
dropAllTables();
|