whitelabel-db 1.1.98 → 1.1.99
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,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;
|
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,
|