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
parent
cd2463fb2d
commit
f0bf3bb9b0
|
|
@ -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",
|
||||||
|
|
|
||||||
|
|
@ -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,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue