@kipicore/dbcore 1.1.566 → 1.1.567

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): Promise<void>;
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+ const tableName = 'dynamic_variable_label';
3
+ const columnName = 'code';
4
+ const up = async (queryInterface, Sequelize) => {
5
+ const table = await queryInterface.describeTable(tableName);
6
+ if (!table[columnName]) {
7
+ await queryInterface.addColumn(tableName, columnName, {
8
+ type: Sequelize.STRING,
9
+ allowNull: true,
10
+ });
11
+ }
12
+ };
13
+ const down = async (queryInterface) => {
14
+ const table = await queryInterface.describeTable(tableName);
15
+ if (table[columnName]) {
16
+ await queryInterface.removeColumn(tableName, columnName);
17
+ }
18
+ };
19
+ module.exports = {
20
+ up,
21
+ down,
22
+ };
@@ -2,6 +2,7 @@ import { IDefaultAttributes } from './commonInterface';
2
2
  export interface IDynamicVariableLabelAttributes extends IDefaultAttributes {
3
3
  id: string;
4
4
  name: string;
5
+ code?: string;
5
6
  variableIds: string[];
6
7
  path?: string;
7
8
  userTypes: string[];
@@ -4,6 +4,7 @@ import { TDynamicVariableLabelCreationAttributes } from '../../types/dynamicVari
4
4
  export declare class DynamicVariableLabelModel extends Model<IDynamicVariableLabelAttributes, TDynamicVariableLabelCreationAttributes> {
5
5
  id: string;
6
6
  name: string;
7
+ code?: string;
7
8
  variableIds: string[];
8
9
  path?: string;
9
10
  userTypes: string[];
@@ -32,6 +32,10 @@ DynamicVariableLabelModel.init({
32
32
  type: sequelize_1.DataTypes.STRING,
33
33
  allowNull: true,
34
34
  },
35
+ code: {
36
+ type: sequelize_1.DataTypes.STRING,
37
+ allowNull: true,
38
+ },
35
39
  variableIds: {
36
40
  type: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.UUID),
37
41
  allowNull: true,
@@ -45,7 +49,7 @@ DynamicVariableLabelModel.init({
45
49
  type: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.STRING),
46
50
  allowNull: true,
47
51
  field: 'user_types',
48
- defaultValue: []
52
+ defaultValue: [],
49
53
  },
50
54
  }, {
51
55
  modelName: 'DynamicVariableLabelModel',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.566",
3
+ "version": "1.1.567",
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",