• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

super3 / lowerproptax / 19655853963

25 Nov 2025 02:09AM UTC coverage: 99.611% (-0.4%) from 100.0%
19655853963

push

github

super3
Add database migrations with node-pg-migrate

- Replace raw SQL schema in init.js with migration runner
- Add initial migration for properties and assessments tables
- Add npm scripts: migrate:up, migrate:down, migrate:create
- Store migrations in src/db/migrations/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

82 of 82 branches covered (100.0%)

Branch coverage included in aggregate %.

8 of 9 new or added lines in 1 file covered. (88.89%)

174 of 175 relevant lines covered (99.43%)

7.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/src/db/init.js
1
import { runner } from 'node-pg-migrate';
2
import { dirname, join } from 'path';
3
import { fileURLToPath } from 'url';
4

5
const __dirname = dirname(fileURLToPath(import.meta.url));
1✔
6

7
// Initialize database by running migrations
8
export async function initDatabase() {
9
  // Skip migrations if DATABASE_URL is not set (test environment)
10
  if (!process.env.DATABASE_URL) {
2✔
11
    console.log('Skipping database setup - DATABASE_URL not set (tests will use mocked database)');
1✔
12
    return;
1✔
13
  }
14

15
  try {
1✔
16
    console.log('Running database migrations...');
1✔
17

18
    await runner({
1✔
19
      databaseUrl: process.env.DATABASE_URL,
20
      dir: join(__dirname, 'migrations'),
21
      direction: 'up',
22
      migrationsTable: 'pgmigrations',
23
      log: () => {} // Suppress verbose logging
24
    });
25

NEW
26
    console.log('Database migrations completed successfully');
×
27
  } catch (error) {
28
    console.error('Error running database migrations:', error);
1✔
29
    throw error;
1✔
30
  }
31
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc