@kipicore/dbcore 1.1.246 → 1.1.248

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.
@@ -0,0 +1,2 @@
1
+ export function up(queryInterface: any, Sequelize: any): Promise<void>;
2
+ export function down(queryInterface: any, Sequelize: any): Promise<void>;
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const table = await queryInterface.describeTable('academic_calendars');
4
+ if (!table.is_initial_data_added) {
5
+ await queryInterface.addColumn('academic_calendars', 'is_initial_data_added', {
6
+ type: Sequelize.BOOLEAN,
7
+ allowNull: true,
8
+ field: 'is_initial_data_added',
9
+ });
10
+ }
11
+ };
12
+ const down = async (queryInterface, Sequelize) => {
13
+ const table = await queryInterface.describeTable('academic_calendars');
14
+ if (table.is_initial_data_added) {
15
+ await queryInterface.removeColumn('academic_calendars', 'is_initial_data_added');
16
+ }
17
+ };
18
+ module.exports = {
19
+ up,
20
+ down,
21
+ };
@@ -11,4 +11,5 @@ export interface IAcademicCalendarModelAttributes extends IDefaultAttributes {
11
11
  startYear: number;
12
12
  endYear: number;
13
13
  isUpdated?: boolean;
14
+ isInitialDataAdded?: boolean;
14
15
  }
@@ -12,6 +12,7 @@ export declare class AcademicCalendarModel extends Model<IAcademicCalendarModelA
12
12
  baseId: string;
13
13
  startYear: number;
14
14
  endYear: number;
15
+ isInitialDataAdded: boolean;
15
16
  createdBy: string;
16
17
  updatedBy: string;
17
18
  deletedBy: string;
@@ -106,6 +106,12 @@ AcademicCalendarModel.init({
106
106
  field: 'is_updated',
107
107
  defaultValue: false,
108
108
  },
109
+ isInitialDataAdded: {
110
+ type: sequelize_1.DataTypes.BOOLEAN,
111
+ field: 'is_initial_data_added',
112
+ defaultValue: false,
113
+ allowNull: true,
114
+ },
109
115
  }, {
110
116
  modelName: 'AcademicCalendarModel',
111
117
  tableName: 'academic_calendars',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.246",
3
+ "version": "1.1.248",
4
4
  "description": "Reusable DB core package with Postgres, MongoDB, models, services, interfaces, and types",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",