27 lines
888 B
TypeScript
27 lines
888 B
TypeScript
import db from '../src/database/models/index.js';
|
||
|
||
async function updateParticipantEnum() {
|
||
try {
|
||
console.log('🔄 Adding "architecture" to participantType enum...');
|
||
|
||
try {
|
||
await db.sequelize.query(`ALTER TYPE "enum_request_participants_participantType" ADD VALUE 'architecture'`);
|
||
console.log(`✅ Added: architecture`);
|
||
} catch (e: any) {
|
||
if (e.message.includes('already exists')) {
|
||
console.log(`ℹ️ Already exists: architecture`);
|
||
} else {
|
||
console.error(`❌ Error adding architecture:`, e.message);
|
||
}
|
||
}
|
||
|
||
console.log('\n✅ Database Enum successfully updated.');
|
||
} catch (error: any) {
|
||
console.error('❌ Critical failure:', error.message);
|
||
} finally {
|
||
process.exit(0);
|
||
}
|
||
}
|
||
|
||
updateParticipantEnum();
|