@kipicore/dbcore 1.1.405 → 1.1.407

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.
@@ -14,7 +14,7 @@ const postgresConfig = {
14
14
  password: process.env.PG_DB_PASSWORD,
15
15
  database: process.env.PG_DB_NAME,
16
16
  dbLogging: message => {
17
- if (!['test', 'production', 'development', 'local'].includes(process.env.NODE_ENV)) {
17
+ if (!['test', 'production', 'development', 'local', 'staging'].includes(process.env.NODE_ENV)) {
18
18
  console.log(message);
19
19
  }
20
20
  },
@@ -0,0 +1,2 @@
1
+ export function up(queryInterface: any, Sequelize: any): Promise<void>;
2
+ export function down(queryInterface: any): Promise<void>;
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const table = await queryInterface.describeTable('institutes');
4
+ if (!table.trial_plan_count) {
5
+ await queryInterface.addColumn('institutes', 'trial_plan_count', {
6
+ type: Sequelize.INTEGER,
7
+ field: 'trial_plan_count',
8
+ defaultValue: 0,
9
+ allowNull: false,
10
+ });
11
+ }
12
+ };
13
+ const down = async (queryInterface) => {
14
+ const table = await queryInterface.describeTable('institutes');
15
+ if (table.trial_plan_count) {
16
+ await queryInterface.removeColumn('institutes', 'trial_plan_count');
17
+ }
18
+ };
19
+ module.exports = {
20
+ up,
21
+ down,
22
+ };
@@ -39,4 +39,5 @@ export interface IInstituteAttributes extends IDefaultAttributes {
39
39
  otp?: string;
40
40
  emailVerification?: EMAIL_VERIFICATION;
41
41
  mobileVerification?: MOBILE_VERIFICATION;
42
+ trialPlanCount: number;
42
43
  }
@@ -136,6 +136,12 @@ InstituteModel.init({
136
136
  field: 'campus_id',
137
137
  allowNull: true,
138
138
  },
139
+ trialPlanCount: {
140
+ type: sequelize_1.DataTypes.INTEGER,
141
+ field: 'trial_plan_count',
142
+ defaultValue: 0,
143
+ allowNull: false,
144
+ },
139
145
  }, {
140
146
  modelName: 'InstituteModel',
141
147
  tableName: 'institutes',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.405",
3
+ "version": "1.1.407",
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",