Skip to content

Commit d40e727

Browse files
committed
- Move migration files to latest folder
- Update unique constraint index field to default - Code lint
1 parent 2f72e23 commit d40e727

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

app/models/legend/legend.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { DEFAULT_COLUMNS } = require('../base');
1+
const {DEFAULT_COLUMNS} = require('../base');
22

33
module.exports = (sequelize, Sq) => {
44
const legend = sequelize.define(

app/routes/legend/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ router.route('/')
6262
.get(async (req, res) => {
6363
try {
6464
const legends = await db.models.legend.findAll();
65-
return res.json(legends.map((legend) => legend.view('public')));
65+
return res.json(legends.map((legend) => {return legend.view('public');}));
6666
} catch (error) {
6767
logger.error(`Error while retrieving legend images ${error}`);
6868
return res.status(HTTP_STATUS.INTERNAL_SERVER_ERROR).json({error: {message: 'Error while retrieving legend images'}});

migrations/v8.5.0/20260421000000-DEVSU-2310-create-legend-table.js renamed to migrations/latest/20260421000000-DEVSU-2310-create-legend-table.js

File renamed without changes.

migrations/v8.5.0/20260421000001-DEVSU-2310-update-pathway-analysis-legend-fk.js renamed to migrations/latest/20260421000001-DEVSU-2310-update-pathway-analysis-legend-fk.js

File renamed without changes.

migrations/latest/20260616000001-add-unique-default-legend-constraint.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module.exports = {
2-
up: async (queryInterface, Sequelize) => {
2+
up: async (queryInterface) => {
33
// Add unique partial index to enforce only one default legend globally
44
await queryInterface.addIndex('pathway_analysis_legends', {
5-
fields: [],
5+
fields: ['default'],
66
where: {
77
default: true,
88
deleted_at: null,
@@ -12,7 +12,7 @@ module.exports = {
1212
});
1313
},
1414

15-
down: async (queryInterface, Sequelize) => {
15+
down: async (queryInterface) => {
1616
// Remove the index if rollback is needed
1717
await queryInterface.removeIndex('pathway_analysis_legends', 'idx_one_default_legend');
1818
},

0 commit comments

Comments
 (0)