테이블관리

This commit is contained in:
kjs
2025-08-25 14:08:08 +09:00
parent ce130ee225
commit eb1a6aa206
13 changed files with 1485 additions and 3 deletions

View File

@@ -0,0 +1,30 @@
const { Client } = require("pg");
async function createTestUser() {
const client = new Client({
connectionString: process.env.DATABASE_URL,
});
try {
await client.connect();
console.log("✅ 데이터베이스 연결 성공");
// 테스트용 사용자 생성
await client.query(`
INSERT INTO user_info (user_id, user_name, user_password, status, company_code, data_type)
VALUES ('admin', '테스트 관리자', 'f21b1ce8b08dc955bd4afff71b3db1fc', 'active', 'ILSHIN', 'PLM')
ON CONFLICT (user_id) DO UPDATE SET
user_name = EXCLUDED.user_name,
user_password = EXCLUDED.user_password,
status = EXCLUDED.status
`);
console.log("✅ 테스트 사용자 생성/업데이트 완료");
} catch (error) {
console.error("❌ 오류 발생:", error);
} finally {
await client.end();
}
}
createTestUser();