feat(db): add PostgreSQL connection, migration runner, and seed data

- Add pool export and graceful shutdown hook to db/index.ts
- Create migrate.ts — programmatic migration runner using drizzle-orm/migrator
- Create seed.ts — idempotent seed script with sample users, subscriptions,
  watchlist items, exposures, alerts, blog posts, properties, and removal requests
- Create db.test.ts — unit tests for db, migrate, and seed module exports
- Add web/.env.example documenting DATABASE_URL
- Add db:generate, db:push, db:migrate, db:seed scripts to web/package.json
This commit is contained in:
2026-05-25 15:39:20 -04:00
parent bc20aeaeb6
commit 052e08c17b
7 changed files with 376 additions and 1 deletions

1
web/.env.example Normal file
View File

@@ -0,0 +1 @@
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/shieldai"