Skip to content

Commit

Permalink
Change completed_credits in studyplan table from an integer into …
Browse files Browse the repository at this point in the history
…a double
  • Loading branch information
valtterikantanen committed Jul 3, 2024
1 parent 7d90763 commit 3dd40cb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions services/backend/src/models/studyplan.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Model, ARRAY, DATE, INTEGER, STRING } = require('sequelize')
const { Model, ARRAY, DATE, DOUBLE, STRING } = require('sequelize')

const { dbConnections } = require('../database/connection')

Expand Down Expand Up @@ -42,7 +42,7 @@ Studyplan.init(
type: STRING,
},
completed_credits: {
type: INTEGER,
type: DOUBLE,
},
curriculum_period_id: {
type: STRING,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { DOUBLE, INTEGER } = require('sequelize')

module.exports = {
up: async queryInterface => {
await queryInterface.changeColumn('studyplan', 'completed_credits', {
type: DOUBLE,
})
},
down: async queryInterface => {
await queryInterface.changeColumn('studyplan', 'completed_credits', {
type: INTEGER,
})
},
}
4 changes: 2 additions & 2 deletions updater/sis-updater-worker/src/db/models/studyplan.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Model, ARRAY, DATE, INTEGER, STRING } = require('sequelize')
const { Model, ARRAY, DATE, DOUBLE, STRING } = require('sequelize')

const { dbConnections } = require('../connection')

Expand Down Expand Up @@ -42,7 +42,7 @@ Studyplan.init(
type: STRING,
},
completed_credits: {
type: INTEGER,
type: DOUBLE,
},
curriculum_period_id: {
type: STRING,
Expand Down

0 comments on commit 3dd40cb

Please sign in to comment.