diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-15 00:50:39 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-15 00:50:39 +0000 |
| commit | 15c3ae6536c264db0508e4fc4aaa59c3e6d1af30 (patch) | |
| tree | 8e2ad5e6a06999bfaaf00ab4ee30083a87050bad /app/api | |
| parent | d5d27847a7eded9db59462fa744b76772bc9ce1d (diff) | |
(대표님) 기본계약 및 정기평가 작업사항, OCR 변경사항
Diffstat (limited to 'app/api')
| -rw-r--r-- | app/api/admin/clear-test-data/route.ts | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/app/api/admin/clear-test-data/route.ts b/app/api/admin/clear-test-data/route.ts index 8442e5de..b54adf34 100644 --- a/app/api/admin/clear-test-data/route.ts +++ b/app/api/admin/clear-test-data/route.ts @@ -1,9 +1,9 @@ // app/api/admin/clear-test-data/route.ts import db from '@/db/db' -import { - formEntries, - forms, - formMetas, +import { + formEntries, + forms, + formMetas, tags, tagTypes, tagSubfields, @@ -19,7 +19,7 @@ export async function DELETE(request: NextRequest) { try { // 외래키 참조 순서를 고려하여 삭제 (자식 테이블부터 부모 테이블 순) console.log('Clearing all test data...') - + const deletedCounts = { tagClassAttributes: 0, tagClasses: 0, @@ -28,6 +28,7 @@ export async function DELETE(request: NextRequest) { tagTypes: 0, tagTypeClassFormMappings: 0, vendorDataReportTemps: 0, + templateItems:0, formEntries: 0, tags: 0, forms: 0, @@ -59,6 +60,10 @@ export async function DELETE(request: NextRequest) { deletedCounts.tagTypes = deletedTagTypes.rowCount || 0 console.log('Deleted tag types:', deletedCounts.tagTypes) + const deletedTemplateItems = await db.delete(templateItems); + deletedCounts.templateItems = deletedTemplateItems.rowCount || 0; + console.log('Deleted template items:', deletedCounts.templateItems); + // 6. tagTypeClassFormMappings 삭제 const deletedMappings = await db.delete(tagTypeClassFormMappings) deletedCounts.tagTypeClassFormMappings = deletedMappings.rowCount || 0 @@ -121,7 +126,7 @@ export async function GET() { method: 'DELETE', tables: [ 'tagClassAttributes', - 'tagClasses', + 'tagClasses', 'tagSubfieldOptions', 'tagSubfields', 'tagTypes', |
