@kipicore/dbcore 1.1.428 → 1.1.430
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} +4 -4
- package/dist/db/psql/migrations/{20260414055951-make_file_field_optional.js → 20260414093904-make_file_id_optional.js} +6 -9
- package/dist/models/psql/visitorBookModel.js +1 -2
- package/package.json +1 -1
- /package/dist/db/psql/migrations/{20260413120153-visitor_book_model.d.ts → 20260414091525-create_migration_for_visitor_books.d.ts} +0 -0
- /package/dist/db/psql/migrations/{20260414055951-make_file_field_optional.d.ts → 20260414093904-make_file_id_optional.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)
|
|
@@ -10,7 +10,7 @@ const up = async (queryInterface, Sequelize) => {
|
|
|
10
10
|
id: { type: Sequelize.UUID, defaultValue: Sequelize.UUIDV4, allowNull: false, primaryKey: true },
|
|
11
11
|
fileStorageId: {
|
|
12
12
|
type: Sequelize.UUID,
|
|
13
|
-
allowNull:
|
|
13
|
+
allowNull: true,
|
|
14
14
|
field: 'file_storage_id',
|
|
15
15
|
},
|
|
16
16
|
date: {
|
|
@@ -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)
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
const up = async (queryInterface, Sequelize) => {
|
|
3
|
-
const table = await queryInterface.describeTable('
|
|
4
|
-
if (table.file_storage_id) {
|
|
5
|
-
await queryInterface.changeColumn('
|
|
3
|
+
const table = await queryInterface.describeTable('visitor_books');
|
|
4
|
+
if (table.file_storage_id && table.file_storage_id.allowNull === false) {
|
|
5
|
+
await queryInterface.changeColumn('visitor_books', 'file_storage_id', {
|
|
6
6
|
type: Sequelize.UUID,
|
|
7
7
|
allowNull: true,
|
|
8
|
-
field: 'file_storage_id',
|
|
9
8
|
});
|
|
10
9
|
}
|
|
11
10
|
};
|
|
12
11
|
const down = async (queryInterface, Sequelize) => {
|
|
13
|
-
const table = await queryInterface.describeTable('
|
|
14
|
-
// Remove only if column exists
|
|
12
|
+
const table = await queryInterface.describeTable('visitor_books');
|
|
15
13
|
if (table.file_storage_id) {
|
|
16
|
-
await queryInterface.changeColumn('
|
|
14
|
+
await queryInterface.changeColumn('visitor_books', 'file_storage_id', {
|
|
17
15
|
type: Sequelize.UUID,
|
|
18
|
-
allowNull:
|
|
19
|
-
field: 'file_storage_id',
|
|
16
|
+
allowNull: true,
|
|
20
17
|
});
|
|
21
18
|
}
|
|
22
19
|
};
|
|
@@ -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
|
});
|
package/package.json
CHANGED
|
File without changes
|