- Remove task CRUD/epic/search/relation/version tools (moved to Jira) - Add migration scripts: migrate-tasks-to-jira, jira-admin, prepare-all-projects - Add consolidate-projects.ts for merging duplicate Jira projects - Add validate-migration.ts for post-migration integrity checks - Add jira_issue_key columns migration (030) - Consolidate 11 duplicate projects (LIT→LITE, CARD→CS, etc.) - Delete 92 placeholder issues, 11 empty source projects - Remove SG project completely - 2,798 tasks migrated across 46 Jira projects Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
52 lines
1.2 KiB
JavaScript
52 lines
1.2 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Run a specific migration file
|
|
* Usage: node run-migration.js migrations/017_fix_archives_embedding_dimension.sql
|
|
*/
|
|
|
|
import pg from 'pg';
|
|
import { readFileSync } from 'fs';
|
|
import { resolve } from 'path';
|
|
|
|
const { Pool } = pg;
|
|
|
|
// Configuration - Direct WireGuard connection to INFRA VM PostgreSQL
|
|
const config = {
|
|
host: process.env.POSTGRES_HOST || 'postgres.agiliton.internal',
|
|
port: 5432,
|
|
database: 'agiliton',
|
|
user: 'agiliton',
|
|
password: 'QtqiwCOAUpQNF6pjzOMAREzUny2bY8V1',
|
|
};
|
|
|
|
async function runMigration(migrationFile) {
|
|
const pool = new Pool(config);
|
|
|
|
try {
|
|
// Read migration SQL
|
|
const sql = readFileSync(resolve(migrationFile), 'utf-8');
|
|
|
|
console.log(`Running migration: ${migrationFile}`);
|
|
console.log('SQL:', sql);
|
|
|
|
// Execute migration
|
|
await pool.query(sql);
|
|
|
|
console.log('Migration completed successfully!');
|
|
} catch (error) {
|
|
console.error('Migration failed:', error);
|
|
process.exit(1);
|
|
} finally {
|
|
await pool.end();
|
|
}
|
|
}
|
|
|
|
// Get migration file from command line
|
|
const migrationFile = process.argv[2];
|
|
if (!migrationFile) {
|
|
console.error('Usage: node run-migration.js <migration-file.sql>');
|
|
process.exit(1);
|
|
}
|
|
|
|
runMigration(migrationFile);
|