@kipicore/dbcore 1.1.428 → 1.1.429

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const up = async (queryInterface, Sequelize) => {
3
- const tableName = 'visitor_book';
3
+ const tableName = 'visitor_books';
4
4
  const tableExists = await queryInterface
5
5
  .describeTable(tableName)
6
6
  .then(() => true)
@@ -78,7 +78,7 @@ const up = async (queryInterface, Sequelize) => {
78
78
  id: { type: Sequelize.UUID, defaultValue: Sequelize.UUIDV4, allowNull: false, primaryKey: true },
79
79
  fileStorageId: {
80
80
  type: Sequelize.UUID,
81
- allowNull: false,
81
+ allowNull: true,
82
82
  field: 'file_storage_id',
83
83
  },
84
84
  date: {
@@ -149,7 +149,7 @@ const up = async (queryInterface, Sequelize) => {
149
149
  }
150
150
  };
151
151
  const down = async (queryInterface) => {
152
- const tableName = 'visitor_book';
152
+ const tableName = 'visitor_books';
153
153
  const tableExists = await queryInterface
154
154
  .describeTable(tableName)
155
155
  .then(() => true)
@@ -62,7 +62,6 @@ VisitorBookModel.init({
62
62
  date: {
63
63
  type: sequelize_1.DataTypes.DATE,
64
64
  allowNull: true,
65
- field: 'start_date',
66
65
  },
67
66
  name: {
68
67
  type: sequelize_1.DataTypes.STRING,
@@ -89,7 +88,7 @@ VisitorBookModel.init({
89
88
  },
90
89
  }, {
91
90
  modelName: 'VisitorBookModel',
92
- tableName: 'visitor_book',
91
+ tableName: 'visitor_books',
93
92
  timestamps: true,
94
93
  sequelize: index_1.sequelize,
95
94
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.428",
3
+ "version": "1.1.429",
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",
@@ -1,2 +0,0 @@
1
- export function up(queryInterface: any, Sequelize: any): Promise<void>;
2
- export function down(queryInterface: any, Sequelize: any): Promise<void>;
@@ -1,26 +0,0 @@
1
- 'use strict';
2
- const up = async (queryInterface, Sequelize) => {
3
- const table = await queryInterface.describeTable('visitor_book');
4
- if (table.file_storage_id) {
5
- await queryInterface.changeColumn('visitor_book', 'file_storage_id', {
6
- type: Sequelize.UUID,
7
- allowNull: true,
8
- field: 'file_storage_id',
9
- });
10
- }
11
- };
12
- const down = async (queryInterface, Sequelize) => {
13
- const table = await queryInterface.describeTable('visitor_book');
14
- // Remove only if column exists
15
- if (table.file_storage_id) {
16
- await queryInterface.changeColumn('visitor_book', 'file_storage_id', {
17
- type: Sequelize.UUID,
18
- allowNull: false,
19
- field: 'file_storage_id',
20
- });
21
- }
22
- };
23
- module.exports = {
24
- up,
25
- down,
26
- };