Migrate database from SQLite to PostgreSQL

- Replace SQLite with PostgreSQL using Neon as provider
- Add environment-based database URL configuration
- Create separate test database setup with DATABASE_URL_TEST
- Reset migration history and generate fresh PostgreSQL schema
- Add comprehensive migration documentation
- Include database unit tests for connection validation
This commit is contained in:
Max Kowalski
2025-06-27 21:25:48 +02:00
parent 6f9ac219c2
commit 185bb6da58
7 changed files with 442 additions and 186 deletions

View File

@ -13,6 +13,11 @@ global.console = {
process.env.NEXTAUTH_SECRET = 'test-secret';
process.env.NEXTAUTH_URL = 'http://localhost:3000';
// Use test database for all database operations during tests
if (process.env.DATABASE_URL_TEST) {
process.env.DATABASE_URL = process.env.DATABASE_URL_TEST;
}
// Mock node-fetch for transcript fetcher tests
vi.mock('node-fetch', () => ({
default: vi.fn(),