@kipicore/dbcore 1.1.356 → 1.1.357
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/db/psql/migrations/20260327071320-add-substitute-date-lecture-model.d.ts +2 -0
- package/dist/db/psql/migrations/20260327071320-add-substitute-date-lecture-model.js +21 -0
- package/dist/interfaces/lectureInterface.d.ts +1 -0
- package/dist/models/psql/lectureModel.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const up = async (queryInterface, Sequelize) => {
|
|
3
|
+
const table = await queryInterface.describeTable('lectures');
|
|
4
|
+
if (!table.substitute_date) {
|
|
5
|
+
await queryInterface.addColumn('lectures', 'substitute_date', {
|
|
6
|
+
type: Sequelize.DATE,
|
|
7
|
+
allowNull: true,
|
|
8
|
+
field: 'substitute_date',
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const down = async (queryInterface) => {
|
|
13
|
+
const table = await queryInterface.describeTable('lectures');
|
|
14
|
+
if (table.substitute_date) {
|
|
15
|
+
await queryInterface.removeColumn('lectures', 'substitute_date');
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
module.exports = {
|
|
19
|
+
up,
|
|
20
|
+
down,
|
|
21
|
+
};
|
|
@@ -232,5 +232,6 @@ LectureModel.init({
|
|
|
232
232
|
field: 'academic_calendar_id',
|
|
233
233
|
allowNull: true,
|
|
234
234
|
},
|
|
235
|
+
substituteDate: { type: sequelize_1.DataTypes.DATE, field: 'substitute_date', allowNull: true },
|
|
235
236
|
}, { modelName: 'LectureModel', tableName: 'lectures', timestamps: true, sequelize: index_1.sequelize });
|
|
236
237
|
exports.default = LectureModel;
|
package/package.json
CHANGED