Drizzle ORM使用Azure PostgreSQL数据库迁移失败

执行 npx drizzle-kit migrate 命令报错:

No config path provided, using default 'drizzle.config.ts'
Reading config file 'E:\nextjs-cloudflare-drizzle\drizzle.config.ts'
Using 'postgres' driver for database querying
[⡿] applying migrations...PostgresError: no pg_hba.conf entry for host "xx.xx.xx.xx", user "postgres", database "database_name", no encryption
    at ErrorResponse (file:///E:/nextjs-cloudflare-drizzle/node_modules/postgres/src/connection.js:788:26)
    at handle (file:///E:/nextjs-cloudflare-drizzle/node_modules/postgres/src/connection.js:474:6)
    at Socket.data (file:///E:/nextjs-cloudflare-drizzle/node_modules/postgres/src/connection.js:315:9)
    at Socket.emit (node:events:514:28)
    at addChunk (node:internal/streams/readable:545:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:495:3)
    at Readable.push (node:internal/streams/readable:375:5)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
  severity_local: 'FATAL',
  severity: 'FATAL',
  code: '28000',
  file: 'auth.c',
  line: '630',
  routine: 'ClientAuthentication'
}

需要在 服务器参数 里,将 require_secure_transport 修改为 off,点击保存后重新部署,再次执行数据库迁移命令。

npx drizzle-kit migrate
No config path provided, using default 'drizzle.config.ts'
Reading config file 'E:\nextjs-cloudflare-drizzle\drizzle.config.ts'
Using 'postgres' driver for database querying
[] migrations applied successfully!
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值