Show raw Jira status everywhere instead of mapping to Open/In Progress/Closed
- Drop CHECK constraint on jira_tickets.status to allow any status string - Store raw Jira status directly in status column during sync (remove mapJiraStatusToLocal) - Remove VALID_TICKET_STATUSES validation on create/update endpoints - Remove separate Jira Status column from table (status IS the Jira status now) - Update frontend status badges to color-code dynamically based on status category - Update Open Tickets widget and CVE detail view to use isClosedStatus() helper - Make filter dropdown dynamic based on actual ticket statuses - Add migration script for dropping the constraint on other deployments
This commit is contained in:
18
backend/migrations/drop_jira_status_check_constraint.js
Normal file
18
backend/migrations/drop_jira_status_check_constraint.js
Normal file
@@ -0,0 +1,18 @@
|
||||
// Migration: Drop CHECK constraint on jira_tickets.status
|
||||
// Allows storing raw Jira status strings (e.g. "Approval/Handoff", "Prioritizing")
|
||||
// instead of mapping to the limited set of Open/In Progress/Closed.
|
||||
// Idempotent — safe to run multiple times.
|
||||
|
||||
const pool = require('../db');
|
||||
|
||||
async function run() {
|
||||
console.log('[Migration] Dropping jira_tickets_status_check constraint...');
|
||||
await pool.query(`ALTER TABLE jira_tickets DROP CONSTRAINT IF EXISTS jira_tickets_status_check`);
|
||||
console.log('✓ jira_tickets status CHECK constraint dropped (or did not exist)');
|
||||
await pool.end();
|
||||
}
|
||||
|
||||
run().catch(err => {
|
||||
console.error('Migration failed:', err.message);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user