@kipicore/dbcore 1.1.253 → 1.1.254

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,35 @@
1
+ 'use strict';
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const academic_calendars = await queryInterface.describeTable('academic_calendars');
4
+ if (!academic_calendars.is_active) {
5
+ await queryInterface.addColumn('academic_calendars', 'is_active', {
6
+ type: Sequelize.STRING,
7
+ allowNull: false,
8
+ field: 'is_active',
9
+ defaultValue: COMMAN_STATUS.ACTIVE,
10
+ });
11
+ }
12
+ const entity_wise_calendar = await queryInterface.describeTable('entity_wise_calendar');
13
+ if (!entity_wise_calendar.is_active) {
14
+ await queryInterface.addColumn('entity_wise_calendar', 'is_active', {
15
+ type: Sequelize.STRING,
16
+ allowNull: false,
17
+ field: 'is_active',
18
+ defaultValue: COMMAN_STATUS.ACTIVE,
19
+ });
20
+ }
21
+ };
22
+ const down = async (queryInterface, Sequelize) => {
23
+ const academic_calendars = await queryInterface.describeTable('academic_calendars');
24
+ if (academic_calendars.is_active) {
25
+ await queryInterface.removeColumn('academic_calendars', 'is_active');
26
+ }
27
+ const entity_wise_calendar = await queryInterface.describeTable('entity_wise_calendar');
28
+ if (entity_wise_calendar.is_active) {
29
+ await queryInterface.removeColumn('entity_wise_calendar', 'is_active');
30
+ }
31
+ };
32
+ module.exports = {
33
+ up,
34
+ down,
35
+ };
@@ -1,4 +1,4 @@
1
- import { ACADEMIC_CALENDARS_STATUS } from '../constants/app';
1
+ import { ACADEMIC_CALENDARS_STATUS, COMMAN_STATUS } from '../constants/app';
2
2
  import { IDefaultAttributes } from './commonInterface';
3
3
  export interface IAcademicCalendarModelAttributes extends IDefaultAttributes {
4
4
  id: string;
@@ -12,4 +12,5 @@ export interface IAcademicCalendarModelAttributes extends IDefaultAttributes {
12
12
  endYear: number;
13
13
  isUpdated?: boolean;
14
14
  isInitialDataAdded?: boolean;
15
+ isActive: COMMAN_STATUS;
15
16
  }
@@ -1,4 +1,4 @@
1
- import { ACADEMIC_CALENDARS_STATUS } from '../constants/app';
1
+ import { ACADEMIC_CALENDARS_STATUS, COMMAN_STATUS } from '../constants/app';
2
2
  import { IDefaultAttributes } from './commonInterface';
3
3
  export interface IEntityWiseCalendarModelAttributes extends IDefaultAttributes {
4
4
  id: string;
@@ -8,4 +8,5 @@ export interface IEntityWiseCalendarModelAttributes extends IDefaultAttributes {
8
8
  endDate: Date;
9
9
  startYear: number;
10
10
  endYear: number;
11
+ isActive: COMMAN_STATUS;
11
12
  }
@@ -1,7 +1,7 @@
1
1
  import { Model } from 'sequelize';
2
2
  import { IAcademicCalendarModelAttributes } from '../../interfaces/academicCalendarInterface';
3
3
  import { TAcademicCalendarModelCreationAttributes } from '../../types/academicCalendarType';
4
- import { ACADEMIC_CALENDARS_STATUS } from '../../constants/app';
4
+ import { ACADEMIC_CALENDARS_STATUS, COMMAN_STATUS } from '../../constants/app';
5
5
  export declare class AcademicCalendarModel extends Model<IAcademicCalendarModelAttributes, TAcademicCalendarModelCreationAttributes> {
6
6
  id: string;
7
7
  instituteId: string;
@@ -13,6 +13,7 @@ export declare class AcademicCalendarModel extends Model<IAcademicCalendarModelA
13
13
  startYear: number;
14
14
  endYear: number;
15
15
  isInitialDataAdded: boolean;
16
+ isActive: COMMAN_STATUS;
16
17
  createdBy: string;
17
18
  updatedBy: string;
18
19
  deletedBy: string;
@@ -112,6 +112,12 @@ AcademicCalendarModel.init({
112
112
  defaultValue: false,
113
113
  allowNull: true,
114
114
  },
115
+ isActive: {
116
+ type: sequelize_1.DataTypes.STRING,
117
+ field: 'is_active',
118
+ defaultValue: app_1.COMMAN_STATUS.ACTIVE,
119
+ allowNull: false,
120
+ },
115
121
  }, {
116
122
  modelName: 'AcademicCalendarModel',
117
123
  tableName: 'academic_calendars',
@@ -1,7 +1,7 @@
1
1
  import { Model } from 'sequelize';
2
2
  import { IEntityWiseCalendarModelAttributes } from '../../interfaces/entityWiseCalendarInterface';
3
3
  import { TEntityWiseCalendarModelCreationAttributes } from '../../types/entityWiseCalendarType';
4
- import { ACADEMIC_CALENDARS_STATUS } from '../../constants/app';
4
+ import { ACADEMIC_CALENDARS_STATUS, COMMAN_STATUS } from '../../constants/app';
5
5
  declare class EntityWiseCalendarModel extends Model<IEntityWiseCalendarModelAttributes, TEntityWiseCalendarModelCreationAttributes> {
6
6
  id: string;
7
7
  entityId: string;
@@ -10,6 +10,7 @@ declare class EntityWiseCalendarModel extends Model<IEntityWiseCalendarModelAttr
10
10
  endDate: Date;
11
11
  startYear: number;
12
12
  endYear: number;
13
+ isActive: COMMAN_STATUS;
13
14
  createdBy: string;
14
15
  updatedBy: string;
15
16
  deletedBy: string;
@@ -66,6 +66,12 @@ EntityWiseCalendarModel.init({
66
66
  field: 'end_year',
67
67
  allowNull: false,
68
68
  },
69
+ isActive: {
70
+ type: sequelize_1.DataTypes.STRING,
71
+ field: 'is_active',
72
+ defaultValue: app_1.COMMAN_STATUS.ACTIVE,
73
+ allowNull: false,
74
+ },
69
75
  }, {
70
76
  modelName: 'EntityWiseCalendar',
71
77
  tableName: 'entity_wise_calendar',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.253",
3
+ "version": "1.1.254",
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",