whitelabel-db 1.3.5 → 1.3.6
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,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.down = exports.up = void 0;
|
|
13
|
+
// Purpose: Add paymentData column to bookings table.
|
|
14
|
+
const sequelize_1 = require("sequelize");
|
|
15
|
+
const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
try {
|
|
17
|
+
const tableDescription = yield queryInterface.describeTable('bookings');
|
|
18
|
+
const existingColumns = Object.keys(tableDescription);
|
|
19
|
+
if (existingColumns.includes('paymentData')) {
|
|
20
|
+
console.log('paymentData column already exists, skipping migration.');
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
yield queryInterface.addColumn('bookings', 'paymentData', {
|
|
24
|
+
type: sequelize_1.DataTypes.JSONB,
|
|
25
|
+
allowNull: false,
|
|
26
|
+
defaultValue: {},
|
|
27
|
+
});
|
|
28
|
+
console.log('paymentData column added successfully.');
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
console.error('Error while adding paymentData column:', error.message);
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
exports.up = up;
|
|
36
|
+
const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
+
try {
|
|
38
|
+
yield queryInterface.removeColumn('bookings', 'paymentData');
|
|
39
|
+
console.log('paymentData column removed successfully.');
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
console.error('Error while removing paymentData column:', error.message);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
exports.down = down;
|
package/dist/models/Booking.d.ts
CHANGED
package/dist/models/Booking.js
CHANGED
|
@@ -59,6 +59,14 @@ __decorate([
|
|
|
59
59
|
}),
|
|
60
60
|
__metadata("design:type", Object)
|
|
61
61
|
], Booking.prototype, "bookingInputData", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, sequelize_typescript_1.Column)({
|
|
64
|
+
type: sequelize_typescript_1.DataType.JSONB,
|
|
65
|
+
allowNull: false,
|
|
66
|
+
defaultValue: {},
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:type", Object)
|
|
69
|
+
], Booking.prototype, "paymentData", void 0);
|
|
62
70
|
__decorate([
|
|
63
71
|
(0, sequelize_typescript_1.ForeignKey)(() => Project_1.Project),
|
|
64
72
|
sequelize_typescript_1.Index,
|