fix: import-registry 스크립트 수정 + npm sync-registry 추가

- .env + .env.local 모두 로드 (service role key 인식)
- is_active, verified_by 컬럼 제거 (테이블에 없음)
- package.json: npm run sync-registry 스크립트 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
Haewon Kam 2026-04-10 14:25:00 +09:00
parent cd2463fb2d
commit f0bf3bb9b0
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,8 @@
"preview": "vite preview", "preview": "vite preview",
"clean": "rm -rf dist", "clean": "rm -rf dist",
"lint": "tsc --noEmit", "lint": "tsc --noEmit",
"db:sync": "tsx scripts/sync-db-local.ts" "db:sync": "tsx scripts/sync-db-local.ts",
"sync-registry": "tsx scripts/import-registry.ts"
}, },
"dependencies": { "dependencies": {
"@google/genai": "^1.29.0", "@google/genai": "^1.29.0",

View File

@ -14,7 +14,8 @@ import { createClient } from "@supabase/supabase-js";
import { readFileSync } from "fs"; import { readFileSync } from "fs";
import { config } from "dotenv"; import { config } from "dotenv";
config({ path: ".env.local" }); config({ path: ".env" }); // base env (service role key lives here)
config({ path: ".env.local" }); // local overrides (takes precedence)
const SUPABASE_URL = process.env.SUPABASE_URL || process.env.VITE_SUPABASE_URL; const SUPABASE_URL = process.env.SUPABASE_URL || process.env.VITE_SUPABASE_URL;
const SUPABASE_KEY = process.env.SUPABASE_SERVICE_ROLE_KEY; const SUPABASE_KEY = process.env.SUPABASE_SERVICE_ROLE_KEY;
@ -113,8 +114,6 @@ async function main() {
naver_blog_url: cols[COL.naver_blog_url]?.trim() || null, naver_blog_url: cols[COL.naver_blog_url]?.trim() || null,
naver_place_url: cols[COL.naver_place_url]?.trim() || null, naver_place_url: cols[COL.naver_place_url]?.trim() || null,
google_maps_url: cols[COL.google_maps_url]?.trim() || null, google_maps_url: cols[COL.google_maps_url]?.trim() || null,
verified_by: "scrape",
is_active: true,
}); });
} }