Skip to content

Commit e3764ee

Browse files
committed
unmodify migration files
1 parent 4af1d79 commit e3764ee

8 files changed

+16
-29
lines changed

backend/typescript/constants.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
export const MIN_SKILL_LEVEL = 1;
2-
export const MAX_SKILL_LEVEL = 5;
1+
export const MIN_COLOR_LEVEL = 1;
2+
export const MAX_COLOR_LEVEL = 5;
3+
4+
// below constants are not currently in use (for old migration files)
5+
export const MIN_BEHAVIOUR_LEVEL = 1;
6+
export const MAX_BEHAVIOUR_LEVEL = 4;

backend/typescript/migrations/2024.10.29T20.20.02.create-user-behaviour-table.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { DataType } from "sequelize-typescript";
2-
import { Migration } from "../umzug";
32

4-
// hard coded so that we can remove the constants from the constants.ts file
5-
const MIN_BEHAVIOUR_LEVEL = 1;
6-
const MAX_BEHAVIOUR_LEVEL = 4;
3+
import { Migration } from "../umzug";
4+
import { MIN_BEHAVIOUR_LEVEL, MAX_BEHAVIOUR_LEVEL } from "../constants";
75

86
const TABLE_NAME = "user_behaviours";
97
const CONSTRAINT_NAME = "unique_user_behaviour_skill";

backend/typescript/migrations/2024.10.29T20.29.50.add-pet-behaviour-columns.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { DataType } from "sequelize-typescript";
22
import { Migration } from "../umzug";
3-
4-
const MIN_BEHAVIOUR_LEVEL = 1;
5-
const MAX_BEHAVIOUR_LEVEL = 4;
3+
import { MIN_BEHAVIOUR_LEVEL, MAX_BEHAVIOUR_LEVEL } from "../constants";
64

75
const TABLE_NAME = "pet_behaviours";
86
const CONSTRAINT_NAME = "unique_pet_behaviour";

backend/typescript/migrations/2024.11.21T16.49.50.add-constraint-behaviour-level-details-table.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
import { DataType } from "sequelize-typescript";
12
import { Migration } from "../umzug";
2-
3-
const MIN_BEHAVIOUR_LEVEL = 1;
4-
const MAX_BEHAVIOUR_LEVEL = 4;
3+
import { MIN_BEHAVIOUR_LEVEL, MAX_BEHAVIOUR_LEVEL } from "../constants";
54

65
const TABLE_NAME = "behaviour_level_details";
76
const CONSTRAINT_NAME = "level_interval";

backend/typescript/migrations/2025.02.07T02.02.46.remove-behaviour-level-details-table.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import { DataType } from "sequelize-typescript";
2-
2+
import { MIN_BEHAVIOUR_LEVEL, MAX_BEHAVIOUR_LEVEL } from "../constants";
33
import { Migration } from "../umzug";
44

5-
// hard coded so that we can remove the constants from the constants.ts file
6-
const MIN_BEHAVIOUR_LEVEL = 1;
7-
const MAX_BEHAVIOUR_LEVEL = 4;
8-
95
const TABLE_NAME = "behaviour_level_details";
106
const CONSTRAINT_NAME = "unique_behaviour_level";
117
const CONSTRAINT_NAME_2 = "level_interval";

backend/typescript/migrations/2025.02.07T02.04.46.remove-pet-behaviour-table.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import { DataType } from "sequelize-typescript";
2-
2+
import { MIN_BEHAVIOUR_LEVEL, MAX_BEHAVIOUR_LEVEL } from "../constants";
33
import { Migration } from "../umzug";
44

5-
// hard coded so that we can remove the constants from the constants.ts file
6-
const MIN_BEHAVIOUR_LEVEL = 1;
7-
const MAX_BEHAVIOUR_LEVEL = 4;
8-
95
const TABLE_NAME = "pet_behaviours";
106
const CONSTRAINT_NAME = "unique_pet_behaviour";
117
const CONSTRAINT_NAME_2 = "skill_level_interval";

backend/typescript/migrations/2025.02.07T02.05.46.remove-user-behaviour-table.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import { DataType } from "sequelize-typescript";
2-
2+
import { MIN_BEHAVIOUR_LEVEL, MAX_BEHAVIOUR_LEVEL } from "../constants";
33
import { Migration } from "../umzug";
44

5-
// hard coded so that we can remove the constants from the constants.ts file
6-
const MIN_BEHAVIOUR_LEVEL = 1;
7-
const MAX_BEHAVIOUR_LEVEL = 4;
8-
95
const TABLE_NAME = "user_behaviours";
106
const CONSTRAINT_NAME = "unique_user_behaviour_skill";
117
const CONSTRAINT_NAME_2 = "max_level_interval";

backend/typescript/migrations/2025.02.07T02.07.46.add-pet-table-skill-column.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { DataType } from "sequelize-typescript";
2-
import { MIN_SKILL_LEVEL, MAX_SKILL_LEVEL } from "../constants";
2+
import { MIN_COLOR_LEVEL, MAX_COLOR_LEVEL } from "../constants";
33
import { Migration } from "../umzug";
44

55
const TABLE_NAME = "pets";
@@ -13,7 +13,7 @@ export const up: Migration = async ({ context: sequelize }) => {
1313
});
1414
await sequelize.query(
1515
`ALTER TABLE ${TABLE_NAME} ADD CONSTRAINT ${SKILL_LEVEL_INTERVAL}
16-
CHECK (skill_level BETWEEN ${MIN_SKILL_LEVEL} AND ${MAX_SKILL_LEVEL});`,
16+
CHECK (skill_level BETWEEN ${MIN_COLOR_LEVEL} AND ${MAX_COLOR_LEVEL});`,
1717
);
1818
};
1919

0 commit comments

Comments
 (0)