Files
hristudio/src/db/drop.ts
Sean O'Connor 29ce631901 fix: update user fields to match schema
- Replace firstName/lastName with name field in users API route
- Update user formatting in UsersTab component
- Add email fallback when name is not available
2024-12-04 14:45:24 -05:00

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();