Skip to content

Commit b0b391e

Browse files
authored
Merge pull request #40 from icefoganalytics/main
🐛 Align production and development environments: employee_benefit…
2 parents 4e69060 + 1dfeb0c commit b0b391e

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

api/src/db/migrations/2025.12.29T00.00.02.fix-employee-benefits-unique-index.ts

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
11
import { type Migration } from "@/db/umzug"
22

33
export async function up({ context: queryInterface }: Migration) {
4-
await queryInterface.removeIndex(
5-
"employee_benefits",
6-
"employee_benefits_centre_id_fiscal_period_id_unique"
7-
)
4+
try {
5+
await queryInterface.removeIndex(
6+
"employee_benefits",
7+
"employee_benefits_centre_id_fiscal_period_id_unique"
8+
)
9+
} catch (error) {
10+
console.debug(
11+
`Aligning production and development environments: employee_benefits_centre_id_fiscal_period_id_unique index does not exist: ${error}`,
12+
{ error }
13+
)
14+
}
15+
16+
try {
17+
await queryInterface.removeIndex(
18+
"employee_benefits",
19+
"employee_benefits_centre_id_fiscal_period_id"
20+
)
21+
} catch (error) {
22+
console.debug(
23+
`Aligning production and development environments: employee_benefits_centre_id_fiscal_period_id index does not exist: ${error}`,
24+
{ error }
25+
)
26+
}
827

928
await queryInterface.addIndex("employee_benefits", ["centre_id", "fiscal_period_id"], {
1029
name: "employee_benefits_centre_id_fiscal_period_id_unique",

0 commit comments

Comments
 (0)