Skip to content

Error: relation 'supabase_migrations.schema_migrations' does not exist

Last edited: 8/12/2026

如果你在 Postgres 日志中看到 relation "supabase_migrations.schema_migrations" does not exist 错误,这通常是因为 Supabase 仪表板在轮询迁移历史导致的。

🌐 If you are observing the error relation "supabase_migrations.schema_migrations" does not exist in your Postgres logs, it is typically caused by the Supabase dashboard polling for migration history.

为什么会发生这种情况? Supabase 仪表板会执行后台查询,从一个由 Supabase CLI 专门管理的表中获取迁移数据。如果你使用的是自定义迁移工具、手动设置,或者还没有通过 CLI 部署迁移,这个表就不会存在,所以日志会报这个错。

如何解决:

  • 忽略错误: 如果你没有使用 Supabase CLI 来管理数据库迁移,这个错误只是仪表盘轮询的无害副作用,可以安全忽略。
  • 初始化迁移元数据:如果你使用 Supabase CLI 来管理你的数据库,运行 supabase db push 会创建 supabase_migrations schema 和 schema_migrations 表,作为应用本地迁移的一部分。注意,这个命令可能也会将任何待处理的迁移文件应用到你的数据库,所以只有在你确实打算这样操作时才运行它。