whitelabel-db 1.1.99 → 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.
@@ -0,0 +1,3 @@
1
+ import { QueryInterface } from 'sequelize';
2
+ export declare const up: (queryInterface: QueryInterface) => Promise<void>;
3
+ export declare const down: (queryInterface: QueryInterface) => Promise<void>;
@@ -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;
@@ -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[];
@@ -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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whitelabel-db",
3
- "version": "1.1.99",
3
+ "version": "1.2.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",