feat(tournament): add sourceUrl field and implement repair logic for tournaments
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 16m19s
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 16m19s
This commit is contained in:
@@ -568,6 +568,12 @@ app.use((err, req, res, next) => {
|
||||
await renameColumnIfExists('official_tournaments', 'austragungsorte', 'venues', 'TEXT NULL');
|
||||
await renameColumnIfExists('official_tournaments', 'konkurrenztypen', 'competition_types', 'TEXT NULL');
|
||||
await renameColumnIfExists('official_tournaments', 'meldeschluesse', 'registration_deadlines', 'TEXT NULL');
|
||||
try {
|
||||
const [sourceUrlColumn] = await sequelize.query("SHOW COLUMNS FROM `official_tournaments` LIKE 'source_url'");
|
||||
if (sourceUrlColumn.length === 0) await sequelize.query('ALTER TABLE `official_tournaments` ADD COLUMN `source_url` VARCHAR(1000) NULL');
|
||||
} catch (error) {
|
||||
console.error('[migration] Failed to add official_tournaments.source_url:', error.message);
|
||||
}
|
||||
|
||||
const isDev = process.env.STAGE === 'dev';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user