@sphereon/ssi-sdk.data-store 0.32.1-feature.new.develop.274 → 0.32.1-feature.new.develop.278
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/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +1 -1
- package/dist/migrations/generic/11-FixCredentialClaimsReferenceUuid.d.ts +7 -0
- package/dist/migrations/generic/11-FixCredentialClaimsReferenceUuid.d.ts.map +1 -0
- package/dist/migrations/generic/11-FixCredentialClaimsReferenceUuid.js +80 -0
- package/dist/migrations/generic/11-FixCredentialClaimsReferenceUuid.js.map +1 -0
- package/dist/migrations/generic/index.d.ts.map +1 -1
- package/dist/migrations/generic/index.js +2 -1
- package/dist/migrations/generic/index.js.map +1 -1
- package/dist/migrations/postgres/1741895822987-FixCredentialClaimsReferencesUuid.d.ts +7 -0
- package/dist/migrations/postgres/1741895822987-FixCredentialClaimsReferencesUuid.d.ts.map +1 -0
- package/dist/migrations/postgres/1741895822987-FixCredentialClaimsReferencesUuid.js +34 -0
- package/dist/migrations/postgres/1741895822987-FixCredentialClaimsReferencesUuid.js.map +1 -0
- package/dist/migrations/sqlite/1741895822987-FixCredentialClaimsReferencesUuid.d.ts +7 -0
- package/dist/migrations/sqlite/1741895822987-FixCredentialClaimsReferencesUuid.d.ts.map +1 -0
- package/dist/migrations/sqlite/1741895822987-FixCredentialClaimsReferencesUuid.js +80 -0
- package/dist/migrations/sqlite/1741895822987-FixCredentialClaimsReferencesUuid.js.map +1 -0
- package/package.json +5 -5
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +1 -1
- package/src/migrations/generic/11-FixCredentialClaimsReferenceUuid.ts +66 -0
- package/src/migrations/generic/index.ts +2 -1
- package/src/migrations/postgres/1741895822987-FixCredentialClaimsReferencesUuid.ts +18 -0
- package/src/migrations/sqlite/1741895822987-FixCredentialClaimsReferencesUuid.ts +76 -0
|
@@ -35,7 +35,7 @@ __decorate([
|
|
|
35
35
|
__metadata("design:type", Array)
|
|
36
36
|
], CredentialLocaleBrandingEntity.prototype, "claims", void 0);
|
|
37
37
|
__decorate([
|
|
38
|
-
(0, typeorm_1.Column)('
|
|
38
|
+
(0, typeorm_1.Column)('uuid', { name: 'credentialBrandingId', nullable: false }),
|
|
39
39
|
__metadata("design:type", String)
|
|
40
40
|
], CredentialLocaleBrandingEntity.prototype, "credentialBrandingId", void 0);
|
|
41
41
|
exports.CredentialLocaleBrandingEntity = CredentialLocaleBrandingEntity = __decorate([
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
export declare class FixCredentialClaimsReferencesUuid1741895822987 implements MigrationInterface {
|
|
3
|
+
name: string;
|
|
4
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
5
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=11-FixCredentialClaimsReferenceUuid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"11-FixCredentialClaimsReferenceUuid.d.ts","sourceRoot":"","sources":["../../../src/migrations/generic/11-FixCredentialClaimsReferenceUuid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AASvE,qBAAa,8CAA+C,YAAW,kBAAkB;IACvF,IAAI,SAAkD;IAEzC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CA0B3D"}
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.FixCredentialClaimsReferencesUuid1741895822987 = void 0;
|
|
16
|
+
const debug_1 = __importDefault(require("debug"));
|
|
17
|
+
const _1685628974232_CreateIssuanceBranding_1 = require("../postgres/1685628974232-CreateIssuanceBranding");
|
|
18
|
+
const _1685628973231_CreateIssuanceBranding_1 = require("../sqlite/1685628973231-CreateIssuanceBranding");
|
|
19
|
+
const _1741895822987_FixCredentialClaimsReferencesUuid_1 = require("../postgres/1741895822987-FixCredentialClaimsReferencesUuid");
|
|
20
|
+
const _1741895822987_FixCredentialClaimsReferencesUuid_2 = require("../sqlite/1741895822987-FixCredentialClaimsReferencesUuid");
|
|
21
|
+
const debug = (0, debug_1.default)('sphereon:ssi-sdk:migrations');
|
|
22
|
+
class FixCredentialClaimsReferencesUuid1741895822987 {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.name = 'FixCredentialClaimsReferenceUuid1741895822987';
|
|
25
|
+
}
|
|
26
|
+
up(queryRunner) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
debug('migration: creating issuance branding uuid problem');
|
|
29
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
30
|
+
switch (dbType) {
|
|
31
|
+
case 'postgres': {
|
|
32
|
+
debug('using postgres migration file');
|
|
33
|
+
const mig = new _1741895822987_FixCredentialClaimsReferencesUuid_1.FixCredentialClaimsReferencesUuidPG1741895822987();
|
|
34
|
+
yield mig.up(queryRunner);
|
|
35
|
+
debug('Migration statements executed');
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
case 'sqlite':
|
|
39
|
+
case 'expo':
|
|
40
|
+
case 'react-native': {
|
|
41
|
+
debug('using sqlite/react-native migration file');
|
|
42
|
+
const mig = new _1741895822987_FixCredentialClaimsReferencesUuid_2.FixCredentialClaimsReferencesUuidSqlite1741895822987();
|
|
43
|
+
yield mig.up(queryRunner);
|
|
44
|
+
debug('Migration statements executed');
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
default:
|
|
48
|
+
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
down(queryRunner) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
debug('migration: reverting issuance branding uuid migration');
|
|
55
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
56
|
+
switch (dbType) {
|
|
57
|
+
case 'postgres': {
|
|
58
|
+
debug('using postgres migration file');
|
|
59
|
+
const mig = new _1685628974232_CreateIssuanceBranding_1.CreateIssuanceBranding1685628974232();
|
|
60
|
+
yield mig.down(queryRunner);
|
|
61
|
+
debug('Migration statements executed');
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
case 'sqlite':
|
|
65
|
+
case 'expo':
|
|
66
|
+
case 'react-native': {
|
|
67
|
+
debug('using sqlite/react-native migration file');
|
|
68
|
+
const mig = new _1685628973231_CreateIssuanceBranding_1.CreateIssuanceBranding1685628973231();
|
|
69
|
+
yield mig.down(queryRunner);
|
|
70
|
+
debug('Migration statements executed');
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
default:
|
|
74
|
+
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.FixCredentialClaimsReferencesUuid1741895822987 = FixCredentialClaimsReferencesUuid1741895822987;
|
|
80
|
+
//# sourceMappingURL=11-FixCredentialClaimsReferenceUuid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"11-FixCredentialClaimsReferenceUuid.js","sourceRoot":"","sources":["../../../src/migrations/generic/11-FixCredentialClaimsReferenceUuid.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,kDAAyB;AACzB,4GAAsG;AACtG,0GAAoG;AACpG,kIAA8H;AAC9H,gIAAgI;AAEhI,MAAM,KAAK,GAAmB,IAAA,eAAK,EAAC,6BAA6B,CAAC,CAAA;AAElE,MAAa,8CAA8C;IAA3D;QACE,SAAI,GAAG,+CAA+C,CAAA;IAuDxD,CAAC;IArDc,EAAE,CAAC,WAAwB;;YACtC,KAAK,CAAC,oDAAoD,CAAC,CAAA;YAC3D,MAAM,MAAM,GAAiB,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAA;YACvE,QAAQ,MAAM,EAAE,CAAC;gBACf,KAAK,UAAU,CAAC,CAAC,CAAC;oBAChB,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,MAAM,GAAG,GAAqD,IAAI,mGAAgD,EAAE,CAAA;oBACpH,MAAM,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;oBACzB,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,OAAM;gBACR,CAAC;gBACD,KAAK,QAAQ,CAAC;gBACd,KAAK,MAAM,CAAC;gBACZ,KAAK,cAAc,CAAC,CAAC,CAAC;oBACpB,KAAK,CAAC,0CAA0C,CAAC,CAAA;oBACjD,MAAM,GAAG,GAAyD,IAAI,uGAAoD,EAAE,CAAA;oBAC5H,MAAM,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;oBACzB,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,OAAM;gBACR,CAAC;gBACD;oBACE,OAAO,OAAO,CAAC,MAAM,CACnB,4FAA4F,MAAM,+GAA+G,CAClN,CAAA;YACL,CAAC;QACH,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,KAAK,CAAC,uDAAuD,CAAC,CAAA;YAC9D,MAAM,MAAM,GAAiB,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAA;YACvE,QAAQ,MAAM,EAAE,CAAC;gBACf,KAAK,UAAU,CAAC,CAAC,CAAC;oBAChB,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,MAAM,GAAG,GAAwC,IAAI,2EAAmC,EAAE,CAAA;oBAC1F,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;oBAC3B,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,OAAM;gBACR,CAAC;gBACD,KAAK,QAAQ,CAAC;gBACd,KAAK,MAAM,CAAC;gBACZ,KAAK,cAAc,CAAC,CAAC,CAAC;oBACpB,KAAK,CAAC,0CAA0C,CAAC,CAAA;oBACjD,MAAM,GAAG,GAAwC,IAAI,2EAAmC,EAAE,CAAA;oBAC1F,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;oBAC3B,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,OAAM;gBACR,CAAC;gBACD;oBACE,OAAO,OAAO,CAAC,MAAM,CACnB,4FAA4F,MAAM,+GAA+G,CAClN,CAAA;YACL,CAAC;QACH,CAAC;KAAA;CACF;AAxDD,wGAwDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/generic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAA;AAEhF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,oCAAoC,EAAE,MAAM,6BAA6B,CAAA;AAClF,OAAO,EAAE,oCAAoC,EAAE,MAAM,6BAA6B,CAAA;AAGlF,OAAO,EAAE,0CAA0C,EAAE,MAAM,oCAAoC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/generic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAA;AAEhF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,oCAAoC,EAAE,MAAM,6BAA6B,CAAA;AAClF,OAAO,EAAE,oCAAoC,EAAE,MAAM,6BAA6B,CAAA;AAGlF,OAAO,EAAE,0CAA0C,EAAE,MAAM,oCAAoC,CAAA;AAG/F;;;;;;GAMG;AAGH,eAAO,MAAM,0BAA0B,wCAKtC,CAAA;AACD,eAAO,MAAM,mCAAmC,gDAAwF,CAAA;AACxI,eAAO,MAAM,6BAA6B,0CAAkC,CAAA;AAC5E,eAAO,MAAM,8BAA8B,2CAAmC,CAAA;AAC9E,eAAO,MAAM,oCAAoC,iDAAyC,CAAA;AAC1F,eAAO,MAAM,+BAA+B,iDAAyC,CAAA;AACrF,eAAO,MAAM,yCAAyC,uDAA+C,CAAA;AAGrG,eAAO,MAAM,mBAAmB,wCAQ/B,CAAA"}
|
|
@@ -11,6 +11,7 @@ const _7_CreateMachineStateStore_1 = require("./7-CreateMachineStateStore");
|
|
|
11
11
|
const _8_CreateContacts_1 = require("./8-CreateContacts");
|
|
12
12
|
const _9_CreateContacts_1 = require("./9-CreateContacts");
|
|
13
13
|
const _10_CreatePresentationDefinitions_1 = require("./10-CreatePresentationDefinitions");
|
|
14
|
+
const _11_FixCredentialClaimsReferenceUuid_1 = require("./11-FixCredentialClaimsReferenceUuid");
|
|
14
15
|
/**
|
|
15
16
|
* The migrations array that SHOULD be used when initializing a TypeORM database connection.
|
|
16
17
|
*
|
|
@@ -25,7 +26,7 @@ exports.DataStoreContactMigrations = [
|
|
|
25
26
|
_8_CreateContacts_1.CreateContacts1708525189000,
|
|
26
27
|
_9_CreateContacts_1.CreateContacts1715761125000,
|
|
27
28
|
];
|
|
28
|
-
exports.DataStoreIssuanceBrandingMigrations = [_2_CreateIssuanceBranding_1.CreateIssuanceBranding1659463079429];
|
|
29
|
+
exports.DataStoreIssuanceBrandingMigrations = [_2_CreateIssuanceBranding_1.CreateIssuanceBranding1659463079429, _11_FixCredentialClaimsReferenceUuid_1.FixCredentialClaimsReferencesUuid1741895822987];
|
|
29
30
|
exports.DataStoreStatusListMigrations = [_4_CreateStatusList_1.CreateStatusList1693866470000];
|
|
30
31
|
exports.DataStoreEventLoggerMigrations = [_5_CreateAuditEvents_1.CreateAuditEvents1701635835330];
|
|
31
32
|
exports.DataStoreDigitalCredentialMigrations = [_6_CreateDigitalCredential_1.CreateDigitalCredential1708525189000];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/migrations/generic/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgE;AAChE,0EAAgF;AAChF,0DAAgE;AAChE,8DAAoE;AACpE,gEAAsE;AACtE,4EAAkF;AAClF,4EAAkF;AAClF,0DAAgE;AAChE,0DAAgE;AAChE,0FAA+F;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/migrations/generic/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgE;AAChE,0EAAgF;AAChF,0DAAgE;AAChE,8DAAoE;AACpE,gEAAsE;AACtE,4EAAkF;AAClF,4EAAkF;AAClF,0DAAgE;AAChE,0DAAgE;AAChE,0FAA+F;AAC/F,gGAAsG;AAEtG;;;;;;GAMG;AAEH,yJAAyJ;AAC5I,QAAA,0BAA0B,GAAG;IACxC,+CAA2B;IAC3B,+CAA2B;IAC3B,+CAA2B;IAC3B,+CAA2B;CAC5B,CAAA;AACY,QAAA,mCAAmC,GAAG,CAAC,+DAAmC,EAAE,qFAA8C,CAAC,CAAA;AAC3H,QAAA,6BAA6B,GAAG,CAAC,mDAA6B,CAAC,CAAA;AAC/D,QAAA,8BAA8B,GAAG,CAAC,qDAA8B,CAAC,CAAA;AACjE,QAAA,oCAAoC,GAAG,CAAC,iEAAoC,CAAC,CAAA;AAC7E,QAAA,+BAA+B,GAAG,CAAC,iEAAoC,CAAC,CAAA;AACxE,QAAA,yCAAyC,GAAG,CAAC,8EAA0C,CAAC,CAAA;AAErG,0BAA0B;AACb,QAAA,mBAAmB,GAAG;IACjC,GAAG,kCAA0B;IAC7B,GAAG,2CAAmC;IACtC,GAAG,qCAA6B;IAChC,GAAG,sCAA8B;IACjC,GAAG,4CAAoC;IACvC,GAAG,uCAA+B;IAClC,GAAG,iDAAyC;CAC7C,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
export declare class FixCredentialClaimsReferencesUuidPG1741895822987 implements MigrationInterface {
|
|
3
|
+
name: string;
|
|
4
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
5
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=1741895822987-FixCredentialClaimsReferencesUuid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1741895822987-FixCredentialClaimsReferencesUuid.d.ts","sourceRoot":"","sources":["../../../src/migrations/postgres/1741895822987-FixCredentialClaimsReferencesUuid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,qBAAa,gDAAiD,YAAW,kBAAkB;IACzF,IAAI,SAAmD;IAE1C,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAM3D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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.FixCredentialClaimsReferencesUuidPG1741895822987 = void 0;
|
|
13
|
+
class FixCredentialClaimsReferencesUuidPG1741895822987 {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'FixCredentialClaimsReferencesUuid1741895822987';
|
|
16
|
+
}
|
|
17
|
+
up(queryRunner) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
// Migrate varchar to uuid
|
|
20
|
+
yield queryRunner.query(`ALTER TABLE "CredentialClaims"`);
|
|
21
|
+
yield queryRunner.query(`ALTER COLUMN "credentialLocaleBrandingId" TYPE uuid USING "credentialLocaleBrandingId"::uuid;`);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
down(queryRunner) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
// Migrate uuid back to varchar
|
|
27
|
+
yield queryRunner.query(`ALTER TABLE "CredentialClaims"`);
|
|
28
|
+
yield queryRunner.query(`ALTER COLUMN "credentialLocaleBrandingId" TYPE character varying USING "credentialLocaleBrandingId"::text;
|
|
29
|
+
`);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.FixCredentialClaimsReferencesUuidPG1741895822987 = FixCredentialClaimsReferencesUuidPG1741895822987;
|
|
34
|
+
//# sourceMappingURL=1741895822987-FixCredentialClaimsReferencesUuid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1741895822987-FixCredentialClaimsReferencesUuid.js","sourceRoot":"","sources":["../../../src/migrations/postgres/1741895822987-FixCredentialClaimsReferencesUuid.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,gDAAgD;IAA7D;QACE,SAAI,GAAG,gDAAgD,CAAA;IAczD,CAAC;IAZc,EAAE,CAAC,WAAwB;;YACtC,0BAA0B;YAC1B,MAAM,WAAW,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAA;YACzD,MAAM,WAAW,CAAC,KAAK,CAAC,+FAA+F,CAAC,CAAA;QAC1H,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,+BAA+B;YAC/B,MAAM,WAAW,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAA;YACzD,MAAM,WAAW,CAAC,KAAK,CAAC;CAC3B,CAAC,CAAA;QACA,CAAC;KAAA;CACF;AAfD,4GAeC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
export declare class FixCredentialClaimsReferencesUuidSqlite1741895822987 implements MigrationInterface {
|
|
3
|
+
name: string;
|
|
4
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
5
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=1741895822987-FixCredentialClaimsReferencesUuid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1741895822987-FixCredentialClaimsReferencesUuid.d.ts","sourceRoot":"","sources":["../../../src/migrations/sqlite/1741895822987-FixCredentialClaimsReferencesUuid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,qBAAa,oDAAqD,YAAW,kBAAkB;IAC7F,IAAI,SAAmD;IAE1C,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAmC3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAmC3D"}
|
|
@@ -0,0 +1,80 @@
|
|
|
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.FixCredentialClaimsReferencesUuidSqlite1741895822987 = void 0;
|
|
13
|
+
class FixCredentialClaimsReferencesUuidSqlite1741895822987 {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'FixCredentialClaimsReferencesUuid1741895822987';
|
|
16
|
+
}
|
|
17
|
+
up(queryRunner) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
// Create a new table with the updated column type (uuid)
|
|
20
|
+
yield queryRunner.query(`
|
|
21
|
+
CREATE TABLE "CredentialClaims_new"
|
|
22
|
+
(
|
|
23
|
+
"id" uuid NOT NULL DEFAULT (lower(hex(randomblob(16)))),
|
|
24
|
+
"key" character varying(255) NOT NULL,
|
|
25
|
+
"name" character varying(255) NOT NULL,
|
|
26
|
+
"credentialLocaleBrandingId" uuid,
|
|
27
|
+
CONSTRAINT "PK_CredentialClaims_id" PRIMARY KEY ("id")
|
|
28
|
+
)
|
|
29
|
+
`);
|
|
30
|
+
// Copy data from the old table
|
|
31
|
+
yield queryRunner.query(`
|
|
32
|
+
INSERT INTO "CredentialClaims_new" ("id", "key", "name", "credentialLocaleBrandingId")
|
|
33
|
+
SELECT "id", "key", "name", "credentialLocaleBrandingId"
|
|
34
|
+
FROM "CredentialClaims"
|
|
35
|
+
`);
|
|
36
|
+
// Drop the old table
|
|
37
|
+
yield queryRunner.query(`DROP TABLE "CredentialClaims"`);
|
|
38
|
+
// Rename the new table to the original name
|
|
39
|
+
yield queryRunner.query(`ALTER TABLE "CredentialClaims_new" RENAME TO "CredentialClaims"`);
|
|
40
|
+
// Recreate the unique index
|
|
41
|
+
yield queryRunner.query(`
|
|
42
|
+
CREATE UNIQUE INDEX "IDX_CredentialClaimsEntity_credentialLocaleBranding_locale"
|
|
43
|
+
ON "CredentialClaims" ("credentialLocaleBrandingId", "key")
|
|
44
|
+
`);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
down(queryRunner) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
// Migrate uuid back to varchar
|
|
50
|
+
// Create a new table reverting the column back to character varying
|
|
51
|
+
yield queryRunner.query(`
|
|
52
|
+
CREATE TABLE "CredentialClaims_old"
|
|
53
|
+
(
|
|
54
|
+
"id" uuid NOT NULL DEFAULT (lower(hex(randomblob(16)))),
|
|
55
|
+
"key" character varying(255) NOT NULL,
|
|
56
|
+
"name" character varying(255) NOT NULL,
|
|
57
|
+
"credentialLocaleBrandingId" character varying,
|
|
58
|
+
CONSTRAINT "PK_CredentialClaims_id" PRIMARY KEY ("id")
|
|
59
|
+
)
|
|
60
|
+
`);
|
|
61
|
+
// Copy data from the current table
|
|
62
|
+
yield queryRunner.query(`
|
|
63
|
+
INSERT INTO "CredentialClaims_old" ("id", "key", "name", "credentialLocaleBrandingId")
|
|
64
|
+
SELECT "id", "key", "name", "credentialLocaleBrandingId"
|
|
65
|
+
FROM "CredentialClaims"
|
|
66
|
+
`);
|
|
67
|
+
// Drop the current table
|
|
68
|
+
yield queryRunner.query(`DROP TABLE "CredentialClaims"`);
|
|
69
|
+
// Rename the new table back to the original name
|
|
70
|
+
yield queryRunner.query(`ALTER TABLE "CredentialClaims_old" RENAME TO "CredentialClaims"`);
|
|
71
|
+
// Recreate the unique index
|
|
72
|
+
yield queryRunner.query(`
|
|
73
|
+
CREATE UNIQUE INDEX "IDX_CredentialClaimsEntity_credentialLocaleBranding_locale"
|
|
74
|
+
ON "CredentialClaims" ("credentialLocaleBrandingId", "key")
|
|
75
|
+
`);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.FixCredentialClaimsReferencesUuidSqlite1741895822987 = FixCredentialClaimsReferencesUuidSqlite1741895822987;
|
|
80
|
+
//# sourceMappingURL=1741895822987-FixCredentialClaimsReferencesUuid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1741895822987-FixCredentialClaimsReferencesUuid.js","sourceRoot":"","sources":["../../../src/migrations/sqlite/1741895822987-FixCredentialClaimsReferencesUuid.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,oDAAoD;IAAjE;QACE,SAAI,GAAG,gDAAgD,CAAA;IAwEzD,CAAC;IAtEc,EAAE,CAAC,WAAwB;;YAEtC,yDAAyD;YACzD,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;SASnB,CAAC,CAAA;YAEN,+BAA+B;YAC/B,MAAM,WAAW,CAAC,KAAK,CAAC;;;;SAInB,CAAC,CAAA;YAEN,qBAAqB;YACrB,MAAM,WAAW,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAA;YAExD,4CAA4C;YAC5C,MAAM,WAAW,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAA;YAE1F,4BAA4B;YAC5B,MAAM,WAAW,CAAC,KAAK,CAAC;;;SAGnB,CAAC,CAAA;QAER,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,+BAA+B;YAE/B,oEAAoE;YACpE,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;SASnB,CAAC,CAAA;YAEN,mCAAmC;YACnC,MAAM,WAAW,CAAC,KAAK,CAAC;;;;SAInB,CAAC,CAAA;YAEN,yBAAyB;YACzB,MAAM,WAAW,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAA;YAExD,iDAAiD;YACjD,MAAM,WAAW,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAA;YAE1F,4BAA4B;YAC5B,MAAM,WAAW,CAAC,KAAK,CAAC;;;SAGnB,CAAC,CAAA;QAER,CAAC;KAAA;CACF;AAzED,oHAyEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.data-store",
|
|
3
|
-
"version": "0.32.1-feature.new.develop.
|
|
3
|
+
"version": "0.32.1-feature.new.develop.278+6e14dc08",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"@sphereon/pex": "5.0.0-unstable.28",
|
|
19
19
|
"@sphereon/ssi-sdk-ext.did-utils": "0.27.1-next.21",
|
|
20
20
|
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.27.1-next.21",
|
|
21
|
-
"@sphereon/ssi-sdk.agent-config": "0.32.1-feature.new.develop.
|
|
22
|
-
"@sphereon/ssi-sdk.core": "0.32.1-feature.new.develop.
|
|
23
|
-
"@sphereon/ssi-types": "0.32.1-feature.new.develop.
|
|
21
|
+
"@sphereon/ssi-sdk.agent-config": "0.32.1-feature.new.develop.278+6e14dc08",
|
|
22
|
+
"@sphereon/ssi-sdk.core": "0.32.1-feature.new.develop.278+6e14dc08",
|
|
23
|
+
"@sphereon/ssi-types": "0.32.1-feature.new.develop.278+6e14dc08",
|
|
24
24
|
"@veramo/core": "4.2.0",
|
|
25
25
|
"@veramo/utils": "4.2.0",
|
|
26
26
|
"blakejs": "^1.2.1",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"Contact Store"
|
|
55
55
|
],
|
|
56
56
|
"nx": {},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "6e14dc08b386cc1dbab006c1cd32852f29725cf1"
|
|
58
58
|
}
|
|
@@ -21,6 +21,6 @@ export class CredentialLocaleBrandingEntity extends BaseLocaleBrandingEntity {
|
|
|
21
21
|
@JoinColumn({ name: 'claim_id' })
|
|
22
22
|
claims!: Array<CredentialClaimsEntity>
|
|
23
23
|
|
|
24
|
-
@Column('
|
|
24
|
+
@Column('uuid', { name: 'credentialBrandingId', nullable: false })
|
|
25
25
|
credentialBrandingId!: string
|
|
26
26
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import Debug from 'debug'
|
|
3
|
+
import { CreateIssuanceBranding1685628974232 } from '../postgres/1685628974232-CreateIssuanceBranding'
|
|
4
|
+
import { CreateIssuanceBranding1685628973231 } from '../sqlite/1685628973231-CreateIssuanceBranding'
|
|
5
|
+
import { FixCredentialClaimsReferencesUuidPG1741895822987 } from '../postgres/1741895822987-FixCredentialClaimsReferencesUuid'
|
|
6
|
+
import { FixCredentialClaimsReferencesUuidSqlite1741895822987 } from '../sqlite/1741895822987-FixCredentialClaimsReferencesUuid'
|
|
7
|
+
|
|
8
|
+
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:migrations')
|
|
9
|
+
|
|
10
|
+
export class FixCredentialClaimsReferencesUuid1741895822987 implements MigrationInterface {
|
|
11
|
+
name = 'FixCredentialClaimsReferenceUuid1741895822987'
|
|
12
|
+
|
|
13
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
14
|
+
debug('migration: creating issuance branding uuid problem')
|
|
15
|
+
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
16
|
+
switch (dbType) {
|
|
17
|
+
case 'postgres': {
|
|
18
|
+
debug('using postgres migration file')
|
|
19
|
+
const mig: FixCredentialClaimsReferencesUuidPG1741895822987 = new FixCredentialClaimsReferencesUuidPG1741895822987()
|
|
20
|
+
await mig.up(queryRunner)
|
|
21
|
+
debug('Migration statements executed')
|
|
22
|
+
return
|
|
23
|
+
}
|
|
24
|
+
case 'sqlite':
|
|
25
|
+
case 'expo':
|
|
26
|
+
case 'react-native': {
|
|
27
|
+
debug('using sqlite/react-native migration file')
|
|
28
|
+
const mig: FixCredentialClaimsReferencesUuidSqlite1741895822987 = new FixCredentialClaimsReferencesUuidSqlite1741895822987()
|
|
29
|
+
await mig.up(queryRunner)
|
|
30
|
+
debug('Migration statements executed')
|
|
31
|
+
return
|
|
32
|
+
}
|
|
33
|
+
default:
|
|
34
|
+
return Promise.reject(
|
|
35
|
+
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`,
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
41
|
+
debug('migration: reverting issuance branding uuid migration')
|
|
42
|
+
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
43
|
+
switch (dbType) {
|
|
44
|
+
case 'postgres': {
|
|
45
|
+
debug('using postgres migration file')
|
|
46
|
+
const mig: CreateIssuanceBranding1685628974232 = new CreateIssuanceBranding1685628974232()
|
|
47
|
+
await mig.down(queryRunner)
|
|
48
|
+
debug('Migration statements executed')
|
|
49
|
+
return
|
|
50
|
+
}
|
|
51
|
+
case 'sqlite':
|
|
52
|
+
case 'expo':
|
|
53
|
+
case 'react-native': {
|
|
54
|
+
debug('using sqlite/react-native migration file')
|
|
55
|
+
const mig: CreateIssuanceBranding1685628973231 = new CreateIssuanceBranding1685628973231()
|
|
56
|
+
await mig.down(queryRunner)
|
|
57
|
+
debug('Migration statements executed')
|
|
58
|
+
return
|
|
59
|
+
}
|
|
60
|
+
default:
|
|
61
|
+
return Promise.reject(
|
|
62
|
+
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`,
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -8,6 +8,7 @@ import { CreateMachineStateStore1708098041262 } from './7-CreateMachineStateStor
|
|
|
8
8
|
import { CreateContacts1708525189000 } from './8-CreateContacts'
|
|
9
9
|
import { CreateContacts1715761125000 } from './9-CreateContacts'
|
|
10
10
|
import { CreatePresentationDefinitions1716533767523 } from './10-CreatePresentationDefinitions'
|
|
11
|
+
import { FixCredentialClaimsReferencesUuid1741895822987 } from './11-FixCredentialClaimsReferenceUuid'
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* The migrations array that SHOULD be used when initializing a TypeORM database connection.
|
|
@@ -24,7 +25,7 @@ export const DataStoreContactMigrations = [
|
|
|
24
25
|
CreateContacts1708525189000,
|
|
25
26
|
CreateContacts1715761125000,
|
|
26
27
|
]
|
|
27
|
-
export const DataStoreIssuanceBrandingMigrations = [CreateIssuanceBranding1659463079429]
|
|
28
|
+
export const DataStoreIssuanceBrandingMigrations = [CreateIssuanceBranding1659463079429, FixCredentialClaimsReferencesUuid1741895822987]
|
|
28
29
|
export const DataStoreStatusListMigrations = [CreateStatusList1693866470000]
|
|
29
30
|
export const DataStoreEventLoggerMigrations = [CreateAuditEvents1701635835330]
|
|
30
31
|
export const DataStoreDigitalCredentialMigrations = [CreateDigitalCredential1708525189000]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
export class FixCredentialClaimsReferencesUuidPG1741895822987 implements MigrationInterface {
|
|
4
|
+
name = 'FixCredentialClaimsReferencesUuid1741895822987'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
// Migrate varchar to uuid
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "CredentialClaims"`)
|
|
9
|
+
await queryRunner.query(`ALTER COLUMN "credentialLocaleBrandingId" TYPE uuid USING "credentialLocaleBrandingId"::uuid;`)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
13
|
+
// Migrate uuid back to varchar
|
|
14
|
+
await queryRunner.query(`ALTER TABLE "CredentialClaims"`)
|
|
15
|
+
await queryRunner.query(`ALTER COLUMN "credentialLocaleBrandingId" TYPE character varying USING "credentialLocaleBrandingId"::text;
|
|
16
|
+
`)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
export class FixCredentialClaimsReferencesUuidSqlite1741895822987 implements MigrationInterface {
|
|
4
|
+
name = 'FixCredentialClaimsReferencesUuid1741895822987'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
|
|
8
|
+
// Create a new table with the updated column type (uuid)
|
|
9
|
+
await queryRunner.query(`
|
|
10
|
+
CREATE TABLE "CredentialClaims_new"
|
|
11
|
+
(
|
|
12
|
+
"id" uuid NOT NULL DEFAULT (lower(hex(randomblob(16)))),
|
|
13
|
+
"key" character varying(255) NOT NULL,
|
|
14
|
+
"name" character varying(255) NOT NULL,
|
|
15
|
+
"credentialLocaleBrandingId" uuid,
|
|
16
|
+
CONSTRAINT "PK_CredentialClaims_id" PRIMARY KEY ("id")
|
|
17
|
+
)
|
|
18
|
+
`)
|
|
19
|
+
|
|
20
|
+
// Copy data from the old table
|
|
21
|
+
await queryRunner.query(`
|
|
22
|
+
INSERT INTO "CredentialClaims_new" ("id", "key", "name", "credentialLocaleBrandingId")
|
|
23
|
+
SELECT "id", "key", "name", "credentialLocaleBrandingId"
|
|
24
|
+
FROM "CredentialClaims"
|
|
25
|
+
`)
|
|
26
|
+
|
|
27
|
+
// Drop the old table
|
|
28
|
+
await queryRunner.query(`DROP TABLE "CredentialClaims"`)
|
|
29
|
+
|
|
30
|
+
// Rename the new table to the original name
|
|
31
|
+
await queryRunner.query(`ALTER TABLE "CredentialClaims_new" RENAME TO "CredentialClaims"`)
|
|
32
|
+
|
|
33
|
+
// Recreate the unique index
|
|
34
|
+
await queryRunner.query(`
|
|
35
|
+
CREATE UNIQUE INDEX "IDX_CredentialClaimsEntity_credentialLocaleBranding_locale"
|
|
36
|
+
ON "CredentialClaims" ("credentialLocaleBrandingId", "key")
|
|
37
|
+
`)
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
42
|
+
// Migrate uuid back to varchar
|
|
43
|
+
|
|
44
|
+
// Create a new table reverting the column back to character varying
|
|
45
|
+
await queryRunner.query(`
|
|
46
|
+
CREATE TABLE "CredentialClaims_old"
|
|
47
|
+
(
|
|
48
|
+
"id" uuid NOT NULL DEFAULT (lower(hex(randomblob(16)))),
|
|
49
|
+
"key" character varying(255) NOT NULL,
|
|
50
|
+
"name" character varying(255) NOT NULL,
|
|
51
|
+
"credentialLocaleBrandingId" character varying,
|
|
52
|
+
CONSTRAINT "PK_CredentialClaims_id" PRIMARY KEY ("id")
|
|
53
|
+
)
|
|
54
|
+
`)
|
|
55
|
+
|
|
56
|
+
// Copy data from the current table
|
|
57
|
+
await queryRunner.query(`
|
|
58
|
+
INSERT INTO "CredentialClaims_old" ("id", "key", "name", "credentialLocaleBrandingId")
|
|
59
|
+
SELECT "id", "key", "name", "credentialLocaleBrandingId"
|
|
60
|
+
FROM "CredentialClaims"
|
|
61
|
+
`)
|
|
62
|
+
|
|
63
|
+
// Drop the current table
|
|
64
|
+
await queryRunner.query(`DROP TABLE "CredentialClaims"`)
|
|
65
|
+
|
|
66
|
+
// Rename the new table back to the original name
|
|
67
|
+
await queryRunner.query(`ALTER TABLE "CredentialClaims_old" RENAME TO "CredentialClaims"`)
|
|
68
|
+
|
|
69
|
+
// Recreate the unique index
|
|
70
|
+
await queryRunner.query(`
|
|
71
|
+
CREATE UNIQUE INDEX "IDX_CredentialClaimsEntity_credentialLocaleBranding_locale"
|
|
72
|
+
ON "CredentialClaims" ("credentialLocaleBrandingId", "key")
|
|
73
|
+
`)
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
}
|