whitelabel-db 1.1.50 → 1.1.51

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,48 @@
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 certificateHtml column to static_hotels_accessibility table.
14
+ const sequelize_1 = require("sequelize");
15
+ const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
16
+ try {
17
+ yield queryInterface.addColumn('static_hotels_accessibility', 'certificateHtml', {
18
+ type: sequelize_1.DataTypes.STRING,
19
+ allowNull: true,
20
+ });
21
+ console.log('certificateHtml column has been added successfully.');
22
+ yield queryInterface.addIndex('static_hotels_accessibility', {
23
+ fields: ['certificateHtml'],
24
+ name: 'static_hotels_accessibility_certificate_html',
25
+ });
26
+ console.log('All indexes added successfully.');
27
+ console.log('All columns and indexes added successfully.');
28
+ }
29
+ catch (error) {
30
+ console.error('Error while adding columns or indexes:', error.message);
31
+ throw error; // Re-throw to ensure migration failure is logged and handled.
32
+ }
33
+ });
34
+ exports.up = up;
35
+ const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
36
+ try {
37
+ // Remove indexes
38
+ yield queryInterface.removeIndex('static_hotels_accessibility', 'static_hotels_accessibility_certificate_html');
39
+ // Remove columns
40
+ yield queryInterface.removeColumn('static_hotels_accessibility', 'certificateHtml');
41
+ console.log('All columns and indexes removed successfully.');
42
+ }
43
+ catch (error) {
44
+ console.error('Error while removing columns or indexes:', error.message);
45
+ throw error; // Re-throw to ensure migration failure is logged and handled.
46
+ }
47
+ });
48
+ exports.down = down;
@@ -59,6 +59,7 @@ export declare class HotelAccessibility extends Model<HotelAccessibility> {
59
59
  hotel?: Hotel;
60
60
  certificateId: string;
61
61
  certificateUrl: string;
62
+ certificateHtml: string;
62
63
  crouchesCaneImpairedScore: number;
63
64
  elderlyImpairedScore: number;
64
65
  electricWheelchairScore: number;
@@ -425,6 +425,13 @@ __decorate([
425
425
  }),
426
426
  __metadata("design:type", String)
427
427
  ], HotelAccessibility.prototype, "certificateUrl", void 0);
428
+ __decorate([
429
+ (0, sequelize_typescript_1.Column)({
430
+ type: sequelize_typescript_1.DataType.STRING,
431
+ allowNull: true,
432
+ }),
433
+ __metadata("design:type", String)
434
+ ], HotelAccessibility.prototype, "certificateHtml", void 0);
428
435
  __decorate([
429
436
  (0, sequelize_typescript_1.Column)({
430
437
  type: sequelize_typescript_1.DataType.INTEGER,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whitelabel-db",
3
- "version": "1.1.50",
3
+ "version": "1.1.51",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",