diff options
| author | 0-Zz-ang <s1998319@gmail.com> | 2025-07-10 15:56:13 +0900 |
|---|---|---|
| committer | 0-Zz-ang <s1998319@gmail.com> | 2025-07-10 15:56:13 +0900 |
| commit | 356929b399ef31a4de82906267df438cf29ea59d (patch) | |
| tree | c353a55c076e987042f99f3dbf1eab54706f6829 /db/schema/integration-log.ts | |
| parent | 25d569828b704a102f681a627c76c4129afa8be3 (diff) | |
인터페이스 관련 파일 수정
Diffstat (limited to 'db/schema/integration-log.ts')
| -rw-r--r-- | db/schema/integration-log.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/db/schema/integration-log.ts b/db/schema/integration-log.ts new file mode 100644 index 00000000..d90a36ec --- /dev/null +++ b/db/schema/integration-log.ts @@ -0,0 +1,24 @@ +import { pgTable, text, timestamp, varchar, serial, integer } from 'drizzle-orm/pg-core'; +import { integrations } from './integration'; + +export const integrationLogTable = pgTable('integration_log', { + id: serial("id").primaryKey(), + integrationId: integer("integration_id").notNull().references(() => integrations.id), + executionTime: timestamp('execution_time').notNull().defaultNow(), + status: varchar('status', { length: 50 }).notNull(), // 'success', 'failed', 'timeout', 'pending' + responseTime: integer('response_time'), // 응답시간 (ms) + errorMessage: text('error_message'), // 에러 메시지 + httpStatusCode: integer('http_status_code'), // HTTP 상태 코드 + retryCount: integer('retry_count').default(0), // 재시도 횟수 + requestMethod: varchar('request_method', { length: 10 }), // GET, POST, PUT, DELETE + requestUrl: text('request_url'), // 실제 요청 URL + ipAddress: varchar('ip_address', { length: 45 }), // 요청 IP 주소 + userAgent: text('user_agent'), // User Agent + sessionId: varchar('session_id', { length: 100 }), // 세션 ID + correlationId: varchar('correlation_id', { length: 100 }), // 상관관계 ID + createdAt: timestamp('created_at').notNull().defaultNow(), +}); + +// 타입 정의 +export type IntegrationLog = typeof integrationLogTable.$inferSelect; +export type NewIntegrationLog = typeof integrationLogTable.$inferInsert;
\ No newline at end of file |
