base con autenticacion, registro, modulo encuestas

This commit is contained in:
2025-06-16 12:02:22 -04:00
commit 475e0754df
411 changed files with 26265 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import { NodePgDatabase } from 'drizzle-orm/node-postgres';
import * as schema from '../index';
import { states } from '../schema/general';
export async function seedStates(db: NodePgDatabase<typeof schema>) {
console.log('Seeding public state...');
// Insert roles
const statesArray = ['estado1', 'estado2', 'estado3'];
for (const item of statesArray) {
try {
await db.insert(states).values({
name: item
}).onConflictDoNothing();
// console.log(`State '${item}' created or already exists`);
} catch (error) {
console.error(`Error creating state '${item}':`, error);
}
}
console.log('All states seeded successfully');
}