whitelabel-db 1.1.98 → 1.2.0
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/migrations/025-add-creator-bio-social-media.d.ts +3 -0
- package/dist/migrations/025-add-creator-bio-social-media.js +54 -0
- package/dist/migrations/026-add-hotel-bookings-last-30-days.d.ts +3 -0
- package/dist/migrations/026-add-hotel-bookings-last-30-days.js +40 -0
- package/dist/models/Creator.d.ts +2 -0
- package/dist/models/Creator.js +14 -0
- package/dist/models/Hotel.d.ts +1 -0
- package/dist/models/Hotel.js +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
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 bio and social media columns to creators table
|
|
14
|
+
const sequelize_1 = require("sequelize");
|
|
15
|
+
const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
try {
|
|
17
|
+
console.log('Adding bio and socialMediaLinks columns to creators table');
|
|
18
|
+
// Add bio column
|
|
19
|
+
yield queryInterface.addColumn('creators', 'bio', {
|
|
20
|
+
type: sequelize_1.DataTypes.TEXT,
|
|
21
|
+
allowNull: true,
|
|
22
|
+
});
|
|
23
|
+
console.log('bio column added successfully');
|
|
24
|
+
// Add socialMediaLinks column as JSONB
|
|
25
|
+
yield queryInterface.addColumn('creators', 'socialMediaLinks', {
|
|
26
|
+
type: sequelize_1.DataTypes.JSONB,
|
|
27
|
+
allowNull: true,
|
|
28
|
+
});
|
|
29
|
+
console.log('socialMediaLinks column added successfully');
|
|
30
|
+
console.log('Bio and social media columns added to creators table successfully');
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
console.error('Error while adding bio and social media columns:', error.message);
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
exports.up = up;
|
|
38
|
+
const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
+
try {
|
|
40
|
+
console.log('Removing bio and socialMediaLinks columns from creators table');
|
|
41
|
+
// Remove socialMediaLinks column
|
|
42
|
+
yield queryInterface.removeColumn('creators', 'socialMediaLinks');
|
|
43
|
+
console.log('socialMediaLinks column removed successfully');
|
|
44
|
+
// Remove bio column
|
|
45
|
+
yield queryInterface.removeColumn('creators', 'bio');
|
|
46
|
+
console.log('bio column removed successfully');
|
|
47
|
+
console.log('Bio and social media columns removed from creators table successfully');
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
console.error('Error while removing bio and social media columns:', error.message);
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
exports.down = down;
|
|
@@ -0,0 +1,40 @@
|
|
|
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 bookingsLast30Days column to static_hotels table.
|
|
14
|
+
const sequelize_1 = require("sequelize");
|
|
15
|
+
const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
try {
|
|
17
|
+
// Add bookingsLast30Days column
|
|
18
|
+
yield queryInterface.addColumn('static_hotels', 'bookingsLast30Days', {
|
|
19
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
20
|
+
allowNull: true,
|
|
21
|
+
defaultValue: 0,
|
|
22
|
+
});
|
|
23
|
+
console.log('bookingsLast30Days column added successfully.');
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
console.error('Error while adding bookingsLast30Days column:', error.message);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
exports.up = up;
|
|
30
|
+
const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
try {
|
|
32
|
+
// Remove bookingsLast30Days column
|
|
33
|
+
yield queryInterface.removeColumn('static_hotels', 'bookingsLast30Days');
|
|
34
|
+
console.log('bookingsLast30Days column removed successfully.');
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
console.error('Error while removing bookingsLast30Days column:', error.message);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
exports.down = down;
|
package/dist/models/Creator.d.ts
CHANGED
package/dist/models/Creator.js
CHANGED
|
@@ -59,6 +59,20 @@ __decorate([
|
|
|
59
59
|
}),
|
|
60
60
|
__metadata("design:type", String)
|
|
61
61
|
], Creator.prototype, "coverImage", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, sequelize_typescript_1.Column)({
|
|
64
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
|
65
|
+
allowNull: true,
|
|
66
|
+
}),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], Creator.prototype, "bio", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, sequelize_typescript_1.Column)({
|
|
71
|
+
type: sequelize_typescript_1.DataType.JSONB,
|
|
72
|
+
allowNull: true,
|
|
73
|
+
}),
|
|
74
|
+
__metadata("design:type", Object)
|
|
75
|
+
], Creator.prototype, "socialMediaLinks", void 0);
|
|
62
76
|
__decorate([
|
|
63
77
|
(0, sequelize_typescript_1.Column)({
|
|
64
78
|
type: sequelize_typescript_1.DataType.DATE,
|
package/dist/models/Hotel.d.ts
CHANGED
|
@@ -108,6 +108,7 @@ export declare class Hotel extends Model<Partial<Hotel>> {
|
|
|
108
108
|
isAccessible: boolean;
|
|
109
109
|
parking?: string;
|
|
110
110
|
video?: string;
|
|
111
|
+
bookingsLast30Days: number;
|
|
111
112
|
accessibility: HotelAccessibility;
|
|
112
113
|
translations: HotelTranslation[];
|
|
113
114
|
hotelFacilityRelations: HotelFacility[];
|
package/dist/models/Hotel.js
CHANGED
|
@@ -444,6 +444,14 @@ __decorate([
|
|
|
444
444
|
}),
|
|
445
445
|
__metadata("design:type", String)
|
|
446
446
|
], Hotel.prototype, "video", void 0);
|
|
447
|
+
__decorate([
|
|
448
|
+
(0, sequelize_typescript_1.Column)({
|
|
449
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
|
450
|
+
allowNull: true,
|
|
451
|
+
defaultValue: 0,
|
|
452
|
+
}),
|
|
453
|
+
__metadata("design:type", Number)
|
|
454
|
+
], Hotel.prototype, "bookingsLast30Days", void 0);
|
|
447
455
|
__decorate([
|
|
448
456
|
(0, sequelize_typescript_1.HasOne)(() => HotelAccessibility_1.HotelAccessibility),
|
|
449
457
|
__metadata("design:type", HotelAccessibility_1.HotelAccessibility)
|