@kipicore/dbcore 1.1.427 → 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.
- package/dist/db/psql/migrations/{20260413120153-visitor_book_model.js → 20260414091525-create_migration_for_visitor_books.js} +3 -3
- package/dist/models/psql/visitorBookModel.js +1 -2
- package/dist/types/userHasOfferAndDiscountType.d.ts +2 -1
- package/package.json +1 -1
- package/dist/db/psql/migrations/20260414055951-make_file_field_optional.d.ts +0 -2
- package/dist/db/psql/migrations/20260414055951-make_file_field_optional.js +0 -26
- /package/dist/db/psql/migrations/{20260413120153-visitor_book_model.d.ts → 20260414091525-create_migration_for_visitor_books.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const up = async (queryInterface, Sequelize) => {
|
|
3
|
-
const tableName = '
|
|
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:
|
|
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 = '
|
|
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: '
|
|
91
|
+
tableName: 'visitor_books',
|
|
93
92
|
timestamps: true,
|
|
94
93
|
sequelize: index_1.sequelize,
|
|
95
94
|
});
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { Optional } from 'sequelize';
|
|
1
2
|
import { IUserHasOfferAndDiscountModelAttributes } from '../interfaces/userHasOfferAndDiscountInterface';
|
|
2
|
-
export type TUserHasOfferAndDiscountModelCreationAttributes =
|
|
3
|
+
export type TUserHasOfferAndDiscountModelCreationAttributes = Optional<IUserHasOfferAndDiscountModelAttributes, 'id'>;
|
package/package.json
CHANGED
|
@@ -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
|
-
};
|