From 356929b399ef31a4de82906267df438cf29ea59d Mon Sep 17 00:00:00 2001 From: 0-Zz-ang Date: Thu, 10 Jul 2025 15:56:13 +0900 Subject: 인터페이스 관련 파일 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema/integration-log.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 db/schema/integration-log.ts (limited to 'db/schema/integration-log.ts') 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 -- cgit v1.2.3