@javalabs/prisma-client 1.0.25 → 1.0.27

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.
Files changed (121) hide show
  1. package/package.json +5 -5
  2. package/prisma/schema.prisma +0 -4
  3. package/dist/index.d.ts +0 -7
  4. package/dist/index.js +0 -34
  5. package/dist/index.js.map +0 -1
  6. package/dist/prisma-factory.service.d.ts +0 -9
  7. package/dist/prisma-factory.service.js +0 -47
  8. package/dist/prisma-factory.service.js.map +0 -1
  9. package/dist/prisma.module.d.ts +0 -2
  10. package/dist/prisma.module.js +0 -23
  11. package/dist/prisma.module.js.map +0 -1
  12. package/dist/prisma.service.d.ts +0 -6
  13. package/dist/prisma.service.js +0 -27
  14. package/dist/prisma.service.js.map +0 -1
  15. package/dist/scripts/add-uuid-to-table.d.ts +0 -8
  16. package/dist/scripts/add-uuid-to-table.js +0 -98
  17. package/dist/scripts/add-uuid-to-table.js.map +0 -1
  18. package/dist/scripts/create-tenant-schemas.d.ts +0 -1
  19. package/dist/scripts/create-tenant-schemas.js +0 -117
  20. package/dist/scripts/create-tenant-schemas.js.map +0 -1
  21. package/dist/scripts/data-migration/batch-migrator.d.ts +0 -20
  22. package/dist/scripts/data-migration/batch-migrator.js +0 -134
  23. package/dist/scripts/data-migration/batch-migrator.js.map +0 -1
  24. package/dist/scripts/data-migration/data-transformer.d.ts +0 -26
  25. package/dist/scripts/data-migration/data-transformer.js +0 -278
  26. package/dist/scripts/data-migration/data-transformer.js.map +0 -1
  27. package/dist/scripts/data-migration/db-connector.d.ts +0 -12
  28. package/dist/scripts/data-migration/db-connector.js +0 -94
  29. package/dist/scripts/data-migration/db-connector.js.map +0 -1
  30. package/dist/scripts/data-migration/dependency-resolver.d.ts +0 -18
  31. package/dist/scripts/data-migration/dependency-resolver.js +0 -132
  32. package/dist/scripts/data-migration/dependency-resolver.js.map +0 -1
  33. package/dist/scripts/data-migration/entity-discovery.d.ts +0 -11
  34. package/dist/scripts/data-migration/entity-discovery.js +0 -152
  35. package/dist/scripts/data-migration/entity-discovery.js.map +0 -1
  36. package/dist/scripts/data-migration/foreign-key-manager.d.ts +0 -18
  37. package/dist/scripts/data-migration/foreign-key-manager.js +0 -160
  38. package/dist/scripts/data-migration/foreign-key-manager.js.map +0 -1
  39. package/dist/scripts/data-migration/migration-tool.d.ts +0 -48
  40. package/dist/scripts/data-migration/migration-tool.js +0 -290
  41. package/dist/scripts/data-migration/migration-tool.js.map +0 -1
  42. package/dist/scripts/data-migration/schema-utils.d.ts +0 -18
  43. package/dist/scripts/data-migration/schema-utils.js +0 -207
  44. package/dist/scripts/data-migration/schema-utils.js.map +0 -1
  45. package/dist/scripts/data-migration/tenant-migrator.d.ts +0 -15
  46. package/dist/scripts/data-migration/tenant-migrator.js +0 -117
  47. package/dist/scripts/data-migration/tenant-migrator.js.map +0 -1
  48. package/dist/scripts/data-migration/typecast-manager.d.ts +0 -9
  49. package/dist/scripts/data-migration/typecast-manager.js +0 -179
  50. package/dist/scripts/data-migration/typecast-manager.js.map +0 -1
  51. package/dist/scripts/data-migration/types.d.ts +0 -100
  52. package/dist/scripts/data-migration/types.js +0 -3
  53. package/dist/scripts/data-migration/types.js.map +0 -1
  54. package/dist/scripts/database-initializer.d.ts +0 -5
  55. package/dist/scripts/database-initializer.js +0 -45
  56. package/dist/scripts/database-initializer.js.map +0 -1
  57. package/dist/scripts/drop-database.d.ts +0 -10
  58. package/dist/scripts/drop-database.js +0 -81
  59. package/dist/scripts/drop-database.js.map +0 -1
  60. package/dist/scripts/encrypt-user-passwords.d.ts +0 -1
  61. package/dist/scripts/encrypt-user-passwords.js +0 -33
  62. package/dist/scripts/encrypt-user-passwords.js.map +0 -1
  63. package/dist/scripts/error-handler.d.ts +0 -12
  64. package/dist/scripts/error-handler.js +0 -82
  65. package/dist/scripts/error-handler.js.map +0 -1
  66. package/dist/scripts/fix-data-types.d.ts +0 -10
  67. package/dist/scripts/fix-data-types.js +0 -185
  68. package/dist/scripts/fix-data-types.js.map +0 -1
  69. package/dist/scripts/fix-enum-values.d.ts +0 -17
  70. package/dist/scripts/fix-enum-values.js +0 -234
  71. package/dist/scripts/fix-enum-values.js.map +0 -1
  72. package/dist/scripts/fix-schema-discrepancies.d.ts +0 -21
  73. package/dist/scripts/fix-schema-discrepancies.js +0 -240
  74. package/dist/scripts/fix-schema-discrepancies.js.map +0 -1
  75. package/dist/scripts/fix-table-indexes.d.ts +0 -26
  76. package/dist/scripts/fix-table-indexes.js +0 -460
  77. package/dist/scripts/fix-table-indexes.js.map +0 -1
  78. package/dist/scripts/migrate-schema-structure.d.ts +0 -1
  79. package/dist/scripts/migrate-schema-structure.js +0 -76
  80. package/dist/scripts/migrate-schema-structure.js.map +0 -1
  81. package/dist/scripts/migrate-uuid.d.ts +0 -2
  82. package/dist/scripts/migrate-uuid.js +0 -57
  83. package/dist/scripts/migrate-uuid.js.map +0 -1
  84. package/dist/scripts/post-migration-validator.d.ts +0 -34
  85. package/dist/scripts/post-migration-validator.js +0 -363
  86. package/dist/scripts/post-migration-validator.js.map +0 -1
  87. package/dist/scripts/pre-migration-validator.d.ts +0 -25
  88. package/dist/scripts/pre-migration-validator.js +0 -491
  89. package/dist/scripts/pre-migration-validator.js.map +0 -1
  90. package/dist/scripts/reset-database.d.ts +0 -17
  91. package/dist/scripts/reset-database.js +0 -202
  92. package/dist/scripts/reset-database.js.map +0 -1
  93. package/dist/scripts/retry-failed-migrations.d.ts +0 -14
  94. package/dist/scripts/retry-failed-migrations.js +0 -301
  95. package/dist/scripts/retry-failed-migrations.js.map +0 -1
  96. package/dist/scripts/run-migration.d.ts +0 -1
  97. package/dist/scripts/run-migration.js +0 -512
  98. package/dist/scripts/run-migration.js.map +0 -1
  99. package/dist/scripts/schema-sync.d.ts +0 -1
  100. package/dist/scripts/schema-sync.js +0 -85
  101. package/dist/scripts/schema-sync.js.map +0 -1
  102. package/dist/scripts/sequence-sync-cli.d.ts +0 -2
  103. package/dist/scripts/sequence-sync-cli.js +0 -287
  104. package/dist/scripts/sequence-sync-cli.js.map +0 -1
  105. package/dist/scripts/sequence-synchronizer.d.ts +0 -8
  106. package/dist/scripts/sequence-synchronizer.js +0 -88
  107. package/dist/scripts/sequence-synchronizer.js.map +0 -1
  108. package/dist/scripts/sync-enum-types.d.ts +0 -13
  109. package/dist/scripts/sync-enum-types.js +0 -139
  110. package/dist/scripts/sync-enum-types.js.map +0 -1
  111. package/dist/scripts/sync-enum-values.d.ts +0 -20
  112. package/dist/scripts/sync-enum-values.js +0 -336
  113. package/dist/scripts/sync-enum-values.js.map +0 -1
  114. package/dist/scripts/truncate-database.d.ts +0 -10
  115. package/dist/scripts/truncate-database.js +0 -100
  116. package/dist/scripts/truncate-database.js.map +0 -1
  117. package/dist/scripts/verify-migration-setup.d.ts +0 -11
  118. package/dist/scripts/verify-migration-setup.js +0 -120
  119. package/dist/scripts/verify-migration-setup.js.map +0 -1
  120. package/dist/tsconfig.tsbuildinfo +0 -1
  121. package/prisma/migrations/add_athena_match_fields.sql +0 -13
@@ -1,202 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DatabaseResetTool = void 0;
4
- const pg = require("pg");
5
- const dotenv = require("dotenv");
6
- const common_1 = require("@nestjs/common");
7
- const child_process_1 = require("child_process");
8
- const client_1 = require("@prisma/client");
9
- dotenv.config();
10
- class DatabaseResetTool {
11
- constructor(databaseUrl) {
12
- this.databaseUrl = databaseUrl;
13
- this.logger = new common_1.Logger("DatabaseResetTool");
14
- this.pool = new pg.Pool({
15
- connectionString: this.databaseUrl,
16
- });
17
- const adminUrl = this.databaseUrl.replace(/\/[^/]+$/, "/postgres");
18
- this.adminPool = new pg.Pool({
19
- connectionString: adminUrl,
20
- });
21
- this.prisma = new client_1.PrismaClient({
22
- datasources: {
23
- db: {
24
- url: this.databaseUrl,
25
- },
26
- },
27
- });
28
- }
29
- async resetDatabase(recreateDb = false) {
30
- try {
31
- this.logger.log("Starting complete database reset process");
32
- const dbName = this.extractDatabaseName(this.databaseUrl);
33
- if (!dbName) {
34
- throw new Error("Could not extract database name from connection URL");
35
- }
36
- await this.dropAllSchemas();
37
- await this.dropAllPublicTables();
38
- await this.dropAllCustomTypes();
39
- if (recreateDb) {
40
- await this.terminateConnections(dbName);
41
- await this.adminPool.query(`DROP DATABASE IF EXISTS "${dbName}"`);
42
- this.logger.log(`Recreating database: ${dbName}`);
43
- await this.adminPool.query(`CREATE DATABASE "${dbName}"`);
44
- this.logger.log("Running prisma migrate to recreate base schema");
45
- try {
46
- (0, child_process_1.execSync)(`DATABASE_URL="${this.databaseUrl}" npx prisma migrate deploy`, {
47
- stdio: 'inherit'
48
- });
49
- }
50
- catch (migrationError) {
51
- this.logger.error(`Error running prisma migrate: ${migrationError.message}`);
52
- }
53
- }
54
- this.logger.log("Database has been completely reset");
55
- return true;
56
- }
57
- catch (error) {
58
- this.logger.error(`Error resetting database: ${error.message}`, error.stack);
59
- return false;
60
- }
61
- finally {
62
- await this.cleanup();
63
- }
64
- }
65
- async dropAllSchemas() {
66
- this.logger.log("Dropping all custom schemas");
67
- try {
68
- const schemas = await this.getCustomSchemas();
69
- this.logger.log(`Found ${schemas.length} custom schemas to drop`);
70
- await this.pool.query(`SET session_replication_role = 'replica'`);
71
- for (const schema of schemas) {
72
- try {
73
- await this.pool.query(`DROP SCHEMA IF EXISTS "${schema}" CASCADE`);
74
- this.logger.log(`Dropped schema: ${schema}`);
75
- }
76
- catch (error) {
77
- this.logger.error(`Error dropping schema ${schema}: ${error.message}`);
78
- }
79
- }
80
- await this.pool.query(`SET session_replication_role = 'origin'`);
81
- }
82
- catch (error) {
83
- this.logger.error(`Error dropping schemas: ${error.message}`);
84
- }
85
- }
86
- async dropAllPublicTables() {
87
- this.logger.log("Dropping all tables in public schema");
88
- try {
89
- const tables = await this.getPublicTables();
90
- this.logger.log(`Found ${tables.length} tables in public schema to drop`);
91
- if (tables.length > 0) {
92
- await this.pool.query(`SET session_replication_role = 'replica'`);
93
- const tableList = tables.map(table => `"${table}"`).join(", ");
94
- if (tableList) {
95
- await this.pool.query(`DROP TABLE IF EXISTS ${tableList} CASCADE`);
96
- this.logger.log("Dropped all tables in public schema");
97
- }
98
- await this.pool.query(`SET session_replication_role = 'origin'`);
99
- }
100
- }
101
- catch (error) {
102
- this.logger.error(`Error dropping public tables: ${error.message}`);
103
- }
104
- }
105
- async dropAllCustomTypes() {
106
- this.logger.log("Dropping all custom types (enums, domains, etc.)");
107
- try {
108
- const typesQuery = `
109
- SELECT t.typname AS name
110
- FROM pg_type t
111
- JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace
112
- WHERE n.nspname = 'public'
113
- AND t.typtype = 'e' -- enum types
114
- `;
115
- const typesResult = await this.pool.query(typesQuery);
116
- const types = typesResult.rows.map(row => row.name);
117
- this.logger.log(`Found ${types.length} custom types to drop`);
118
- for (const type of types) {
119
- try {
120
- await this.pool.query(`DROP TYPE IF EXISTS "${type}" CASCADE`);
121
- this.logger.log(`Dropped type: ${type}`);
122
- }
123
- catch (error) {
124
- this.logger.error(`Error dropping type ${type}: ${error.message}`);
125
- }
126
- }
127
- }
128
- catch (error) {
129
- this.logger.error(`Error dropping custom types: ${error.message}`);
130
- }
131
- }
132
- async getCustomSchemas() {
133
- const result = await this.pool.query(`
134
- SELECT schema_name
135
- FROM information_schema.schemata
136
- WHERE schema_name NOT IN ('public', 'information_schema', 'pg_catalog', 'pg_toast')
137
- AND schema_name NOT LIKE 'pg_%'
138
- `);
139
- return result.rows.map(row => row.schema_name);
140
- }
141
- async getPublicTables() {
142
- const result = await this.pool.query(`
143
- SELECT table_name
144
- FROM information_schema.tables
145
- WHERE table_schema = 'public'
146
- AND table_type = 'BASE TABLE'
147
- `);
148
- return result.rows.map(row => row.table_name);
149
- }
150
- extractDatabaseName(url) {
151
- const matches = url.match(/\/([^/?]+)($|\?)/);
152
- return matches ? matches[1] : null;
153
- }
154
- async terminateConnections(dbName) {
155
- this.logger.log(`Terminating all connections to database: ${dbName}`);
156
- try {
157
- await this.adminPool.query(`
158
- SELECT pg_terminate_backend(pg_stat_activity.pid)
159
- FROM pg_stat_activity
160
- WHERE pg_stat_activity.datname = $1
161
- AND pid <> pg_backend_pid()
162
- `, [dbName]);
163
- this.logger.log("All connections terminated successfully");
164
- }
165
- catch (error) {
166
- this.logger.error(`Error terminating connections: ${error.message}`);
167
- }
168
- }
169
- async cleanup() {
170
- this.logger.log("Cleaning up database connections");
171
- await this.prisma.$disconnect();
172
- await this.pool.end();
173
- await this.adminPool.end();
174
- }
175
- }
176
- exports.DatabaseResetTool = DatabaseResetTool;
177
- if (require.main === module) {
178
- const run = async () => {
179
- try {
180
- dotenv.config();
181
- const databaseUrl = process.argv[2] || process.env.DATABASE_URL;
182
- if (!databaseUrl) {
183
- console.error("Error: DATABASE_URL not found in environment variables or command line arguments");
184
- process.exit(1);
185
- }
186
- const recreateFlag = process.argv.includes('--recreate') || process.argv.includes('-r');
187
- const resetTool = new DatabaseResetTool(databaseUrl);
188
- const success = await resetTool.resetDatabase(recreateFlag);
189
- if (!success) {
190
- console.error("Database reset failed");
191
- process.exit(1);
192
- }
193
- process.exit(0);
194
- }
195
- catch (error) {
196
- console.error("Error:", error.message);
197
- process.exit(1);
198
- }
199
- };
200
- run();
201
- }
202
- //# sourceMappingURL=reset-database.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reset-database.js","sourceRoot":"","sources":["../../src/scripts/reset-database.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,iCAAiC;AACjC,2CAAwC;AACxC,iDAAyC;AACzC,2CAA8C;AAE9C,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAa,iBAAiB;IAM5B,YAA6B,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;QAL/B,WAAM,GAAG,IAAI,eAAM,CAAC,mBAAmB,CAAC,CAAC;QAOxD,IAAI,CAAC,IAAI,GAAG,IAAI,EAAE,CAAC,IAAI,CAAC;YACtB,gBAAgB,EAAE,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EAAE,CAAC;IAC5B,MAAM,GAAG,GAAG,KAAK,IAAI,EAAE;QACrB,IAAI,CAAC;YAEH,MAAM,CAAC,MAAM,EAAE,CAAC;YAGhB,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;YAEhE,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,OAAO,CAAC,KAAK,CAAC,kFAAkF,CAAC,CAAC;gBAClG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YAGD,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAExF,MAAM,SAAS,GAAG,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC;YACrD,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;YAE5D,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;gBACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC;IAEF,GAAG,EAAE,CAAC;AACR,CAAC"}
@@ -1,14 +0,0 @@
1
- export declare class FailedMigrationRetry {
2
- private readonly errorLogPath;
3
- private readonly logger;
4
- private readonly targetPrisma;
5
- private readonly targetPool;
6
- private readonly errorHandler;
7
- private schemaCache;
8
- constructor(errorLogPath: string);
9
- retryFailedMigrations(): Promise<void>;
10
- private getTableSchema;
11
- private getEnumValues;
12
- private findMatchingEnumValue;
13
- private cleanup;
14
- }
@@ -1,301 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FailedMigrationRetry = void 0;
4
- const fs = require("fs");
5
- const client_1 = require("@prisma/client");
6
- const dotenv = require("dotenv");
7
- const common_1 = require("@nestjs/common");
8
- const pg = require("pg");
9
- const error_handler_1 = require("./error-handler");
10
- dotenv.config();
11
- class FailedMigrationRetry {
12
- constructor(errorLogPath) {
13
- this.errorLogPath = errorLogPath;
14
- this.logger = new common_1.Logger("FailedMigrationRetry");
15
- this.schemaCache = {};
16
- this.targetPool = new pg.Pool({
17
- connectionString: process.env.DATABASE_URL,
18
- });
19
- this.targetPrisma = new client_1.PrismaClient({
20
- datasources: {
21
- db: {
22
- url: process.env.DATABASE_URL,
23
- },
24
- },
25
- });
26
- this.errorHandler = new error_handler_1.MigrationErrorHandler();
27
- }
28
- async retryFailedMigrations() {
29
- try {
30
- this.logger.log(`Loading error log from: ${this.errorLogPath}`);
31
- if (!fs.existsSync(this.errorLogPath)) {
32
- this.logger.error(`Error log file not found: ${this.errorLogPath}`);
33
- return;
34
- }
35
- const errorLogContent = fs.readFileSync(this.errorLogPath, "utf8");
36
- const errorLog = JSON.parse(errorLogContent);
37
- let totalErrors = 0;
38
- let retrySuccessCount = 0;
39
- let retryFailCount = 0;
40
- for (const tenantId in errorLog) {
41
- const tenantErrors = errorLog[tenantId];
42
- if (tenantErrors.length === 0)
43
- continue;
44
- totalErrors += tenantErrors.length;
45
- this.logger.log(`Processing ${tenantErrors.length} errors for tenant: ${tenantId}`);
46
- const tenantPrisma = new client_1.PrismaClient({
47
- datasources: {
48
- db: {
49
- url: `${process.env.DATABASE_URL}?schema=${tenantId}`,
50
- },
51
- },
52
- transactionOptions: {
53
- maxWait: 120000,
54
- timeout: 120000,
55
- },
56
- });
57
- for (const errorEntry of tenantErrors) {
58
- const { entity, recordId, data } = errorEntry;
59
- this.logger.log(`Retrying ${entity} with ID ${recordId}`);
60
- try {
61
- if (!this.schemaCache[`${tenantId}.${entity}`]) {
62
- this.schemaCache[`${tenantId}.${entity}`] =
63
- await this.getTableSchema(entity, tenantId);
64
- }
65
- const tableSchema = this.schemaCache[`${tenantId}.${entity}`];
66
- if (!tableSchema || tableSchema.length === 0) {
67
- this.logger.warn(`Schema not found for ${entity} in tenant ${tenantId}. Skipping.`);
68
- retryFailCount++;
69
- continue;
70
- }
71
- const createData = {};
72
- const updateData = {};
73
- const columnNames = tableSchema.map((col) => col.column_name);
74
- if (!data) {
75
- this.logger.warn(`No data available for ${entity} with ID ${recordId}. Skipping.`);
76
- retryFailCount++;
77
- continue;
78
- }
79
- for (const column of tableSchema) {
80
- const columnName = column.column_name;
81
- if (!Object.prototype.hasOwnProperty.call(data, columnName)) {
82
- continue;
83
- }
84
- if (column.data_type === "numeric" && data[columnName] !== null) {
85
- const numericValue = parseFloat(data[columnName]);
86
- if (!isNaN(numericValue)) {
87
- createData[columnName] = numericValue;
88
- updateData[columnName] = numericValue;
89
- }
90
- else {
91
- createData[columnName] = null;
92
- updateData[columnName] = null;
93
- }
94
- }
95
- else if (column.data_type === "USER-DEFINED" &&
96
- column.udt_name.startsWith("enum_")) {
97
- const enumValues = await this.getEnumValues(column.udt_name);
98
- if (!createData._enumTypes)
99
- createData._enumTypes = {};
100
- if (!updateData._enumTypes)
101
- updateData._enumTypes = {};
102
- createData._enumTypes[columnName] = column.udt_name;
103
- updateData._enumTypes[columnName] = column.udt_name;
104
- if (data[columnName] === null || data[columnName] === "") {
105
- createData[columnName] = null;
106
- updateData[columnName] = null;
107
- }
108
- else if (typeof data[columnName] === "string") {
109
- const matchingValue = this.findMatchingEnumValue(data[columnName], enumValues);
110
- if (matchingValue) {
111
- createData[columnName] = matchingValue;
112
- updateData[columnName] = matchingValue;
113
- }
114
- else {
115
- createData[columnName] = null;
116
- updateData[columnName] = null;
117
- this.logger.warn(`No matching enum value found for ${columnName}="${data[columnName]}" in ${entity}. Using NULL.`);
118
- }
119
- }
120
- else {
121
- const enumValue = data[columnName];
122
- createData[columnName] = data[columnName];
123
- updateData[columnName] = data[columnName];
124
- }
125
- }
126
- else {
127
- createData[columnName] = data[columnName];
128
- updateData[columnName] = data[columnName];
129
- }
130
- }
131
- if (columnNames.includes(recordId)) {
132
- createData[recordId] = data[recordId];
133
- }
134
- const checkExistQuery = `
135
- SELECT 1 FROM "${tenantId}"."${entity}"
136
- WHERE "${recordId}" = $1
137
- LIMIT 1
138
- `;
139
- const existResult = await this.targetPool.query(checkExistQuery, [
140
- data[recordId],
141
- ]);
142
- const recordExists = existResult.rows.length > 0;
143
- if (recordExists) {
144
- const updateFields = Object.keys(updateData)
145
- .filter((key) => key !== recordId && key !== '_enumTypes')
146
- .map((key, index) => {
147
- if (updateData._enumTypes && updateData._enumTypes[key]) {
148
- return `"${key}" = $${index + 2}::${updateData._enumTypes[key]}`;
149
- }
150
- return `"${key}" = $${index + 2}`;
151
- });
152
- if (updateFields.length > 0) {
153
- const updateQuery = `
154
- UPDATE "${tenantId}"."${entity}"
155
- SET ${updateFields.join(", ")}
156
- WHERE "${recordId}" = $1
157
- `;
158
- const updateValues = [
159
- data[recordId],
160
- ...Object.keys(updateData)
161
- .filter((key) => key !== recordId && key !== '_enumTypes')
162
- .map((key) => updateData[key]),
163
- ];
164
- await this.targetPool.query(updateQuery, updateValues);
165
- }
166
- }
167
- else {
168
- const insertFields = Object.keys(createData)
169
- .filter(key => key !== '_enumTypes')
170
- .map((key) => `"${key}"`);
171
- const insertPlaceholders = Object.keys(createData)
172
- .filter(key => key !== '_enumTypes')
173
- .map((key, index) => {
174
- if (createData._enumTypes && createData._enumTypes[key]) {
175
- return `$${index + 1}::${createData._enumTypes[key]}`;
176
- }
177
- return `$${index + 1}`;
178
- });
179
- const insertQuery = `
180
- INSERT INTO "${tenantId}"."${entity}" (${insertFields.join(", ")})
181
- VALUES (${insertPlaceholders.join(", ")})
182
- `;
183
- const insertValues = Object.keys(createData)
184
- .filter(key => key !== '_enumTypes')
185
- .map((key) => createData[key]);
186
- await this.targetPool.query(insertQuery, insertValues);
187
- }
188
- this.logger.log(`Successfully migrated ${entity} with ID ${recordId}`);
189
- retrySuccessCount++;
190
- }
191
- catch (error) {
192
- this.logger.error(`Error retrying ${entity} with ID ${recordId}: ${error.message}`);
193
- this.errorHandler.logError(tenantId, entity, recordId, error, data);
194
- retryFailCount++;
195
- }
196
- }
197
- await tenantPrisma.$disconnect();
198
- }
199
- this.logger.log(`
200
- Retry Summary:
201
- - Total errors: ${totalErrors}
202
- - Successfully retried: ${retrySuccessCount}
203
- - Failed retries: ${retryFailCount}
204
- `);
205
- const remainingErrorsReport = this.errorHandler.generateErrorReport();
206
- this.logger.log("Remaining Errors Report:\n" + remainingErrorsReport);
207
- }
208
- catch (error) {
209
- this.logger.error(`Error in retry process: ${error.message}`, error.stack);
210
- }
211
- finally {
212
- await this.cleanup();
213
- }
214
- }
215
- async getTableSchema(tableName, schemaName) {
216
- try {
217
- const schemaQuery = `
218
- SELECT column_name, data_type, column_default, is_nullable, udt_name
219
- FROM information_schema.columns
220
- WHERE table_name = $1
221
- AND table_schema = $2
222
- ORDER BY ordinal_position
223
- `;
224
- const result = await this.targetPool.query(schemaQuery, [
225
- tableName,
226
- schemaName,
227
- ]);
228
- return result.rows;
229
- }
230
- catch (error) {
231
- this.logger.error(`Error getting schema for table ${tableName} in schema ${schemaName}: ${error.message}`);
232
- return [];
233
- }
234
- }
235
- async getEnumValues(enumTypeName) {
236
- try {
237
- const enumQuery = `
238
- SELECT e.enumlabel
239
- FROM pg_enum e
240
- JOIN pg_type t ON e.enumtypid = t.oid
241
- WHERE t.typname = $1
242
- ORDER BY e.enumsortorder
243
- `;
244
- const result = await this.targetPool.query(enumQuery, [enumTypeName]);
245
- return result.rows.map((row) => row.enumlabel);
246
- }
247
- catch (error) {
248
- this.logger.error(`Error getting enum values for ${enumTypeName}: ${error.message}`);
249
- return [];
250
- }
251
- }
252
- findMatchingEnumValue(value, enumValues) {
253
- if (enumValues.includes(value)) {
254
- return value;
255
- }
256
- const lowerValue = value.toLowerCase();
257
- for (const enumValue of enumValues) {
258
- if (enumValue.toLowerCase() === lowerValue) {
259
- return enumValue;
260
- }
261
- }
262
- const similarValues = enumValues.filter((v) => v.toLowerCase().includes(lowerValue) ||
263
- lowerValue.includes(v.toLowerCase()));
264
- if (similarValues.length === 1) {
265
- return similarValues[0];
266
- }
267
- else if (similarValues.length > 1) {
268
- return similarValues.reduce((prev, curr) => Math.abs(curr.length - value.length) <
269
- Math.abs(prev.length - value.length)
270
- ? curr
271
- : prev);
272
- }
273
- return null;
274
- }
275
- async cleanup() {
276
- this.logger.log("Cleaning up database connections");
277
- await this.targetPrisma.$disconnect();
278
- await this.targetPool.end();
279
- }
280
- }
281
- exports.FailedMigrationRetry = FailedMigrationRetry;
282
- if (require.main === module) {
283
- const run = async () => {
284
- try {
285
- const errorLogPath = process.argv[2];
286
- if (!errorLogPath) {
287
- console.error("Error: No error log file path provided. Please provide the path to the error log file.");
288
- process.exit(1);
289
- }
290
- const retryTool = new FailedMigrationRetry(errorLogPath);
291
- await retryTool.retryFailedMigrations();
292
- process.exit(0);
293
- }
294
- catch (error) {
295
- console.error("Error:", error.message);
296
- process.exit(1);
297
- }
298
- };
299
- run();
300
- }
301
- //# sourceMappingURL=retry-failed-migrations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"retry-failed-migrations.js","sourceRoot":"","sources":["../../src/scripts/retry-failed-migrations.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AAEzB,2CAA8C;AAC9C,iCAAiC;AACjC,2CAAwC;AACxC,yBAAyB;AACzB,mDAAwD;AAExD,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAa,oBAAoB;IAO/B,YAA6B,YAAoB;QAApB,iBAAY,GAAZ,YAAY,CAAQ;QANhC,WAAM,GAAG,IAAI,eAAM,CAAC,sBAAsB,CAAC,CAAC;QAIrD,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