From 6e25ab8da8a90a6d9bf40ccc83e36f119fb27568 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Tue, 1 Jul 2025 10:44:02 +0000 Subject: (김준회) 비활성화한 node-cron 진입점 (instrumentation.ts) 추가 및 NONSAP 동기화 개발건 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/oracle-db/nonsap/run-generate-schema.sh | 63 +++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 lib/oracle-db/nonsap/run-generate-schema.sh (limited to 'lib/oracle-db/nonsap/run-generate-schema.sh') diff --git a/lib/oracle-db/nonsap/run-generate-schema.sh b/lib/oracle-db/nonsap/run-generate-schema.sh new file mode 100755 index 00000000..b2e215ae --- /dev/null +++ b/lib/oracle-db/nonsap/run-generate-schema.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +# NonSAP Oracle to PostgreSQL 스키마 생성 스크립트 + +echo "🚀 NonSAP Oracle to PostgreSQL Schema Generation" +echo "================================================" + +# 현재 디렉토리 확인 +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd "$SCRIPT_DIR" + +echo "📍 Working directory: $SCRIPT_DIR" + +# CSV 파일 존재 확인 +if [ ! -f "1.table-and-columns-info.csv" ]; then + echo "❌ Error: 1.table-and-columns-info.csv not found" + exit 1 +fi + +echo "✅ Found CSV file: 1.table-and-columns-info.csv" + +# 1. Oracle TypeScript 타입 생성 +echo "" +echo "📝 Step 1: Generating Oracle TypeScript types..." +if command -v python3 &> /dev/null; then + python3 2.generate-oracle-types.py + if [ $? -eq 0 ]; then + echo "✅ Oracle TypeScript types generated successfully" + else + echo "❌ Failed to generate Oracle TypeScript types" + exit 1 + fi +else + echo "❌ Error: Python3 not found. Please install Python3" + exit 1 +fi + +# 2. PostgreSQL Drizzle 스키마 생성 +echo "" +echo "🐘 Step 2: Generating PostgreSQL Drizzle schema..." +if command -v npx &> /dev/null; then + npx tsx 3.generate-postgres-drizzle-schema.ts + if [ $? -eq 0 ]; then + echo "✅ PostgreSQL Drizzle schema generated successfully" + else + echo "❌ Failed to generate PostgreSQL Drizzle schema" + exit 1 + fi +else + echo "❌ Error: npx not found. Please install Node.js and npm" + exit 1 +fi + +echo "" +echo "🎉 Schema generation completed!" +echo "" +echo "📄 Generated files:" +echo " - oracle-schema.ts (TypeScript types)" +echo " - schema.ts (Drizzle schema)" +echo "" +echo "💡 Usage:" +echo " import { Table } from './oracle-schema';" +echo " import { cmctbVendorGeneral } from './schema';" \ No newline at end of file -- cgit v1.2.3